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

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

[avr-libc-dev] [bug #47113] XMegaE series won't write eeprom


From: Scott Price
Subject: [avr-libc-dev] [bug #47113] XMegaE series won't write eeprom
Date: Wed, 10 Feb 2016 21:53:55 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

URL:
  <http://savannah.nongnu.org/bugs/?47113>

                 Summary: XMegaE series won't write eeprom
                 Project: AVR C Runtime Library
            Submitted by: scottprice
            Submitted on: Wed 10 Feb 2016 03:53:54 PM CST
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: libc code
                  Status: None
        Percent Complete: 0%
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: Any
           Fixed Release: None

    _______________________________________________________

Details:

This bug is in 2.0.0.

None of the eeprom write or update functions work on the XMega32E5.  It seems
to be a problem stemming from this block of code starting at line 119 in
libc/misc/eewr_byte.S:

#if     defined (NVM_EEMAPEN_bm)
        std     Z + NVM_DATA0 - NVM_BASE, r18
#else
        movw    XL, addr_lo
        subi    XL, lo8(-MAPPED_EEPROM_START)
        sbci    XH, hi8(-MAPPED_EEPROM_START)
        st      X, r18
#endif

In the XMegaE series the memory mapping can't be turned off (it doesn't have
NVM_EEMAPEN_bm) so it uses the code in the #else.  However, this code seems to
do nothing.  If the code is changed so that it uses the line under the if
statement, it writes the eeprom properly.  I tested it using the patch
attached, but I don't know enough about the other XMega processors to know if
it will break anything else.

As I dig into this more I am confused, though.  NVM_EEMAPEN_bm is not defined
for the E5 series, in the ioxXe5 header files.  Yet if the code, before this
patch, seems to be building like it has that defined.  The patch was just
removing the #if statement, only leaving what is in the #else block.  That
should have been what was built for the E5.





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 10 Feb 2016 03:53:54 PM CST  Name: libc.patch  Size: 539B   By:
scottprice

<http://savannah.nongnu.org/bugs/download.php?file_id=36306>

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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