bugAVR C Runtime Library - Bugs: bug #8391, Fuse mask in boot.h wrong?

 
 

bug #8391: Fuse mask in boot.h wrong?

Submitted by:  None
Submitted on:  Wed 31 Mar 2004 06:20:00 PM UTC  
 
Category: HeaderSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedPercent Complete: 0%
Assigned to: Theodore A. Roth <troth>Originator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 20 Apr 2004 06:48:16 PM UTC, comment #2:

I decided to change the macro to take the complement of lock_bits as I previously suggested.

The fix has been committed to HEAD and 1.0 branches.

Theodore A. Roth <troth>In charge of this item.
Tue 06 Apr 2004 08:19:10 PM UTC, comment #1:

Looks like we have the mask bits inverted in boot.h.

It also looks like there's some confusion in the __boot_lock_bits_set() macro. When using this macro, the lock_bits argument is really the BLB bits that will be cleared (i.e. written to 1). It seems to me that the proper fix for this would be changing this line in the __boot_lock_bits_set() macro:

uint8_t value = (uint8_t)(lock_bits|__BOOT_LOCK_BITS_MASK);

to this:

uint8_t value = (uint8_t)(~(lock_bits));

which would make __BOOT_LOCK_BITS_MASK unnecessary.

I would like to think this over some more and will post a patch to the dev list soon.

BTW: Instead of noting the sleep bug here, it would have been better to just post a follow-up comment for that bug.

Theodore A. Roth <troth>In charge of this item.
Wed 31 Mar 2004 06:20:00 PM UTC, original submission:

Fuse-Mask in boot.h may be wrong. In current (31 Mar 04):

/* Define the bit positions of the Boot Lock Bits. */
#define BLB12 5
#define BLB11 4
#define BLB02 3
#define BLB01 2
#define __BOOT_LOCK_BITS_MASK (_BV(BLB01) | _BV(BLB02) \
| _BV(BLB11) | BV(BLB12))

didn't work for me in an AVRStuido STK500-plugin-compatible bootloader on an ATmega16. To fix this issue here it has been changed like this:

/* Define the bit positions of the Boot Lock Bits. */
#define BLB12 5
#define BLB11 4
#define BLB02 3
#define BLB01 2
// mt:
#define LB2 1
#define LB1 0
#define LOCK6 6
#define LOCK7 7
#define __BOOT_LOCK_BITS_MASK (_BV(LB1) | _BV(LB2) | \
_BV(LOCK6) | _BV(LOCK7))

BTW. The bug I've submited regarding sleep.h and ATmega169 haven't been fixed so far. At least a remark in the documentation (like the one in/for eeprom.h) would avoid time-consuming debugging on the users-side until someone has time to fix this bug.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 20 Apr 2004 06:48:16 PM UTCtrothStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Tue 06 Apr 2004 08:19:10 PM UTCtrothAssigned toNone=>troth

Back to the top


Powered by Savane 3.1-cleanup1