EmbeddedRelated.com
Forums

IAR for MSP430F2013 and subroutines with more than 4 arguments

Started by jappelino March 17, 2009
jappelino wrote:
> it stumbled a few bytes into the neighboring area, but is it my
> responsibility to check this and not the compilers?

I would say that it's your problem to check this, with the help of the
features provided by the tools.

As Ian pointed out, you can monitor the stack size in the debugger to
check how large it is.

Also, the compiler list file lists the stack usage for each individual
function, and the stack size at each call point. Using this you can find
the max stack depth needed by your application.
> The stack was set to the normal 50 bytes, this is a small cpu with only
> 128 bytes of RAM.
>
> I will try the "--reduce_stack_usage" way shortly.

For a CPU that small, I would recommend using the option.

-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.

Beginning Microcontrollers with the MSP430