Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 12, 2011 15:43:59

Sebastien C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Data section and stack


Hello,

First thank you very much for your work on avr-gcc.



I am developping a software for atmega.

Is there a way to know if stack pointer is entering in data section ?

(with interrupt for example )



Thank you very much for your help

Sebastien_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#2 Jan. 12, 2011 19:09:09

Joerg W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Data section and stack


Salut Sebastien,

please, better subscribe to the list in order to not miss replies.

"Sebastien Chretien" <s.chret...@enko-creatio.fr> wrote:

> Is there a way to know if stack pointer is entering in data section ?

You can read out the stack pointer, and compare it against the symbol
_end which is provided by the linker and marks the last allocated SRAM
address.

While developing, you might monitor the stack usage by initially
filling up all SRAM with a known pattern, and then observe the amount
of stack that overwrites this pattern, e.g. using JTAG debugging.

--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#3 Jan. 13, 2011 13:07:55

Sebastien C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Data section and stack


Guten Tag Wunch ^^,
Thank you very much for your help.
Your second solution is very interesting. I am going to use it.

Best regards,
Sebastien

-----Message d'origine-----
De : Joerg Wunsch
Envoyé : mercredi 12 janvier 2011 20:09
À : avr-gcc-l***@*ongnu.org
Cc : Sebastien Chretien
Objet : Re: Data section and stack

Salut Sebastien,

please, better subscribe to the list in order to not miss replies.

"Sebastien Chretien" <s.chret...@enko-creatio.fr> wrote:

> Is there a way to know if stack pointer is entering in data section ?

You can read out the stack pointer, and compare it against the symbol
_end which is provided by the linker and marks the last allocated SRAM
address.

While developing, you might monitor the stack usage by initially
filling up all SRAM with a known pattern, and then observe the amount
of stack that overwrites this pattern, e.g. using JTAG debugging.

--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

Board footer

Moderator control

Enjoy the 23rd of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support