change Stack size

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,480件の閲覧回数
binukannur
Contributor III

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

ラベル(1)
0 件の賞賛
返信
1 解決策
1,189件の閲覧回数
stanish
NXP Employee
NXP Employee

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".

http://cache.freescale.com/files/soft_dev_tools/doc/ref_manual/Build_Tools_Utilities.pdf?fsrch=1&sr=...

Hope it helps.

Stan

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,189件の閲覧回数
TICS_Fiona
NXP Employee
NXP Employee

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!

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

0 件の賞賛
返信
1,190件の閲覧回数
stanish
NXP Employee
NXP Employee

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".

http://cache.freescale.com/files/soft_dev_tools/doc/ref_manual/Build_Tools_Utilities.pdf?fsrch=1&sr=...

Hope it helps.

Stan

0 件の賞賛
返信