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

 
 

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

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

Submitter:  Joerg Wunsch <joerg_wunsch>
Submitted:  Thu 01 Dec 2011 01:07:32 PM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Startup code
Status:  Invalid Assigned to:  None
Percent Complete:  0% Open/Closed:  Closed
Release:  1.7.* Fixed Release:  None

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>
Group 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>
Group administrator

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-01 joerg_wunsch StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code