Hai,
I have 40 KB code size in MC9S08DZ128 controller. The most of the actions taken place in ISR.
Is it necessary to change my stack size in codewarrior studio when Iam using more code in ISR?
It has 8KB RAM area but in default stack size is 0200H
Solved! Go to Solution.
Hello,
Since S08 architecture has limited set of CPU registers complex code that contains complex C expressions may cause CPU registers/temporary values are saved/restored to/form stack more often and this could also increase stack consumption. But as Fiona indicated most of stack space is consumed by local variables, interrupt context saving and nested subroutines calls.
There is a linker switch "-StackConsumption" which may help you to estimate stack size required by your application.
For more information please see the MCU_Build_Tools_Reference_manual.pdf, Section "Stack Consumption Computation".
Hope it helps.
Stan
Hello Binu
The stack space is used for local variables and temporaries and storing callee saved registers according to the calling convention. So whether you needs more stack size depends on the data size of local data and calling convention, not on code size.
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello,
Since S08 architecture has limited set of CPU registers complex code that contains complex C expressions may cause CPU registers/temporary values are saved/restored to/form stack more often and this could also increase stack consumption. But as Fiona indicated most of stack space is consumed by local variables, interrupt context saving and nested subroutines calls.
There is a linker switch "-StackConsumption" which may help you to estimate stack size required by your application.
For more information please see the MCU_Build_Tools_Reference_manual.pdf, Section "Stack Consumption Computation".
Hope it helps.
Stan