Sign in

username:

password:



Not a member?

Search msp430



Search tips

Subscribe to msp430



Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | MSP430 | IAR STACK


Advertise Here

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

IAR STACK - Franco Bucafusco - Jun 4 11:56:28 2009

Hi!
I would like to know if IAR brings to the user some way to know the start
address of the stack as well its size.
I know that project options gives you the chance to change the size, but
also I would like some way to know it at compiler time.

thanks.
[Non-text portions of this message have been removed]

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )


Re: IAR STACK - Anders Lindgren - Jun 8 11:20:18 2009

Franco Bucafusco wrote:
> I would like to know if IAR brings to the user some way to know the start
> address of the stack as well its size.
> I know that project options gives you the chance to change the size, but
> also I would like some way to know it at compiler time.

Hi Franco!

It is possible to get the beginning and end of the stack using the
built-in functions __segment_start and __segment_end.

Note that the stack size is decided at link-time, as it decided by the
linker command file.

For, example, the following will fill the stack with garbage before
launching the application:

#pragma segment="CSTACK"

void the_application(void);

void main()
{
unsigned short *p = __segment_begin("CSTACK");
while (p != __segment_end("CSTACK"))
{
*(p++) = 0xAAAA;
}

the_application();

/* Note: Don't return from "main", the return address has been
* trashed. */
}
-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )