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

 
 

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

Submitted by:  Lars Schreiber <l_s_rockfan>
Submitted on:  Wed 30 Jul 2008 10:19:30 PM UTC  
 
Category: LibrarySeverity: 5 - Blocker
Priority: 9 - ImmediateItem Group: libc code
Status: FixedPercent Complete: 100%
Assigned to: Eric Weddington <arcanum>Open/Closed: Closed
Release: 1.6.2Fixed Release: 1.7.0

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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>
Project AdministratorIn charge of this item.
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.)

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by arcanum (Updated the item)
  • -unavailable- added by l_s_rockfan (Submitted the item)
  •  

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

     

     

    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Aug 2008 07:25:12 PM UTCarcanumOpen/ClosedOpen=>Closed
    Tue 19 Aug 2008 07:24:34 PM UTCarcanumStatusNeed Info=>Fixed
      Percent Complete50%=>100%
      Fixed ReleaseNone=>1.7.0
    Mon 18 Aug 2008 11:40:01 PM UTCarcanumAttached File-=>Added eeprom.h, #16314
      StatusNone=>Need Info
    Mon 18 Aug 2008 06:55:20 PM UTCarcanumPercent Complete0%=>50%
      Assigned toNone=>arcanum
    Mon 11 Aug 2008 02:48:44 AM UTCarcanumPriority8=>9 - Immediate
    Thu 31 Jul 2008 03:57:17 AM UTCarcanumSeverity3 - Normal=>5 - Blocker
      Priority5 - Normal=>8

    Back to the top


    Powered by Savane 3.1-cleanup1