bugAVR C Runtime Library - Bugs: bug #23969, eeprom_read_byte() throws...

 
 

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

bug #23969: eeprom_read_byte() throws interrupt EE_READY although EERIE is cleared, controller resets

Submitter:  Lars Schreiber <l_s_rockfan>
Submitted:  Wed 30 Jul 2008 10:19:30 PM UTC
   
 
Category:  Library Severity:  5 - Blocker
Priority:  9 - Immediate Item Group:  libc code
Status:  Fixed Assigned to:  arcanum
Percent Complete:  100% Open/Closed:  Closed
Release:  1.6.2 Fixed Release:  1.7.0

Mon 18 Aug 2008 11:40:01 PM UTC, comment #1: 

Attached to the bug report now is a new version of eeprom.h with a potential fix to the problem.

Lars, could you download this new file and put it in your toolchain installation (overwriting the old eeprom.h) and try it out? You will need to be sure to remove your workaround with disabling the interrupts so we can verify the fix.

I would also appreciate any other testing and feedback by anyone else, before I decide to commit this.

Thanks,
Eric Weddington

(file #16314)

Eric Weddington <arcanum>
Group administrator
Wed 30 Jul 2008 10:19:30 PM UTC, original submission:  

Hello,

in a project previously built with avr-libc before 1.6 eeprom access through avr-libc worked fine.

After switching to avr-libc 1.6.x the controller resets when accessing the eeprom through avr-libc methods.

This is caused by a thrown EE_READY interrupt from inside eeprom_read_byte() function when EECR|(1<<EERE) value is stored to EECR, although eeprom ready interrupt enable bit (EERIE) isn't set at all. confusing

The corresponding isr body is not defined. Thus the mcu resets (__bad_interrupt).

This problem only occurs after building with optimization level 0 or 1. Testing platforms were ATmega64 and ATmega16.

Disabling interrupts globally before calling eeprom functions worked around the problem, as well as defining empty ISR for EE_READY interrupt or compiling with optimization level 2/3/s.

problem was noticed before under sourceforge.net > winavr > bugtracker:
http://sourceforge.net/tracker/index.php?func=detail&aid=2009732&group_id=68108&atid=520074

Lars Schreiber <l_s_rockfan>

 

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

Attached Files
file #16314:  eeprom.h added by arcanum (10KiB - text/plain - New eeprom.h file with potential fix.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arcanum (Updated the item)
  • -email is unavailable- added by l_s_rockfan (Submitted the item)
  •  

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-19 arcanum Open/ClosedOpen Closed
    2008-08-19 arcanum StatusNeed Info Fixed
        Percent Complete50% 100%
        Fixed ReleaseNone 1.7.0
    2008-08-18 arcanum Attached File- Added eeprom.h, #16314
        StatusNone Need Info
    2008-08-18 arcanum Percent Complete0% 50%
        Assigned toNone arcanum
    2008-08-11 arcanum Priority8 9 - Immediate
    2008-07-31 arcanum Severity3 - Normal 5 - Blocker
        Priority5 - Normal 8

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code