bugAVR C Runtime Library - Bugs: bug #34961, ATtiny4313 stack is being...

 
 

bug #34961: ATtiny4313 stack is being initialized beyond the range that is addressable by SP

Submitted by:  Joerg Wunsch <joerg_wunsch>
Submitted on:  Thu 01 Dec 2011 01:07:32 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: Startup code
Status: InvalidPercent Complete: 0%
Assigned to: NoneOpen/Closed: Closed
Release: 1.7.*Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 01 Dec 2011 01:36:28 PM UTC, comment #1:

Actually, the debugger was fooling me. The XML file had an
incorrect IO bitmap so SPH was excluded from being accessed
by the JTAG ICE. After fixing that, I can read and write
SPH in the debugger, so initializing the stack to RAMEND is
fine even for the ATtiny4313.

Joerg Wunsch <joerg_wunsch>
Project Administrator
Thu 01 Dec 2011 01:07:32 PM UTC, original submission:

The ATtiny4313 only offers the SPL register, so the stack pointer
cannot go beyond 0xff. However, the device features twice the
amount of SRAM, compared to the ATtiny2313, so the SRAM range
goes from 0x60 through 0x15F. Consequently, the header file
sets RAMEND to 0x15F, and the startup code attempts to use
this value for the stack pointer. As there is no SPH register,
this effectively results in the stack pointer being initialized
to 0x5F, so the stack is located in the upper IO space.

Suggestion: use a specific symbol _SPINIT in the device header
file, so the startup code can prefer that value over RAMEND
if it is present (and proceed using RAMEND as it used to for
any header file that does not override the _SPINIT value).

That way, only the startup code and the iotn4313.h file need
to be touched. (There appears to be no other device with that
phenomenon.)

Joerg Wunsch <joerg_wunsch>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by joerg_wunsch (Submitted the item)
  •  

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

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 01 Dec 2011 01:36:28 PM UTCjoerg_wunschStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1