avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #25929] boot.h Fuse read not compatible with Tiny48/


From: Frédéric Nadeau
Subject: [avr-libc-dev] [bug #25929] boot.h Fuse read not compatible with Tiny48/88.
Date: Wed, 25 Mar 2009 12:58:15 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.4 (KHTML, like Gecko) Chrome/2.0.170.0 Safari/530.4

Follow-up Comment #1, bug #25929 (project avr-libc):

Problem is most likely not limited to ATtiny48/88. As far as I can tell it
affect also:
ATmega8/16HVA
ATtiny13/13a
ATtiny167
ATtiny2313
ATtiny43
ATtiny87
ATtiny24/44/84
ATtiny25/45/85
ATtiny261/461/861

The following seems to work. Might consider it as a temporary patch.

#include <avr/io.h>
#include <avr/boot.h>

#define __READ_FUSE_LOCK_BIT_SET (_BV(__SPM_ENABLE) | _BV(RFLB))

#define boot_lock_fuse_bits_get_tiny(address)              
(__extension__({                                           
    uint8_t __result;                                      
    __asm__ __volatile__                                   
    (                                                      
        "ldi r30, %3nt"                                  
        "ldi r31, 0nt"                                   
        "sts %1, %2nt"                                   
        "lpm %0, Znt"                                    
        : "=r" (__result)                                  
        : "i" (_SFR_MEM_ADDR(__SPM_REG)),                  
          "r" ((uint8_t)__READ_FUSE_LOCK_BIT_SET),         
          "M" (address)                                    
        : "r0", "r30", "r31"                               
    );                                                     
    __result;                                              
}))

I don't have the required chips to test the above, but it match the
datasheet.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?25929>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]