URL: <http://savannah.nongnu.org/bugs/?34961>
Summary: ATtiny4313 stack is being initialized beyond the range that is addressable by SP Project: AVR C Runtime Library Submitted by: joerg_wunsch Submitted on: Thu 01 Dec 2011 02:07:32 PM CET Category: Library Severity: 3 - Normal Priority: 5 - Normal Item Group: Startup code Status: None Percent Complete: 0% Assigned to: None Open/Closed: Open Discussion Lock: Any Release: 1.7.* Fixed Release: None _______________________________________________________ Details: 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.) _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?34961> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev