CCS has option to set the Stack Size. By default it has some fixed size.
my only question was is there way to know if i am overflowing the expected
stack size.
and answer is Yes .I figured it out in CCS there is an option which check
the stack over flow and breaks the code execution on stack overflow.
i am not sure but some tools used to have info options which generates
which function uses how much stack. and it is very useful.
On Sat, Mar 15, 2014 at 11:27 AM, wrote:
> I do not know exactly what you mean by "stack
allocation is correct or
> not". I think CCS Linker allocates as much as physically possible the
> amount of SRAM for the stack. Thus in a sense, this is correct. However,
> this does not mean that (a) the stack will never overflow at run-time, and
> (b) all that memory will actually be used by the stack.
>
> The amount of stack needed depends mostly on the code you wrote and the
> input at run-time. (To a lesser degree, the stack size also depends on how
> the compiler translated your code into machine code.) CCS is unable to
> estimate how much stack is needed. It does have the option that you can
> tell it an estimated stack size (and this has a default value in case you
> did not tell it). In case there is not enough SRAM with this estimated
> stack size, CCS Linker will generated an error msg and abort. Otherwise, it
> will allocate all the available SRAM to the stack (not just the estimated
> size).
>
> The default value of the estimated stack size is not very meaningful.
>
>