avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #34961] ATtiny4313 stack is being initialized beyond


From: Joerg Wunsch
Subject: [avr-libc-dev] [bug #34961] ATtiny4313 stack is being initialized beyond the range that is addressable by SP
Date: Thu, 01 Dec 2011 13:07:34 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.19) Gecko/2010071610 Firefox/3.0.19

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]