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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  None
Submitted:  Wed 31 Mar 2004 06:20:00 PM UTC
   
 
Category:  Header Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  troth
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

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>
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>
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.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-04-20 troth StatusNone Fixed
    Open/ClosedOpen Closed
2004-04-06 troth Assigned toNone troth

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code