Stack consumption in codewarrior IDE 11.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stack consumption in codewarrior IDE 11.1

346 Views
Ramya_12
Contributor I

May i know how to enable stack consumption for coldfire v4 ?

Thanks & regards,

ramya

0 Kudos
3 Replies

332 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

You can see the linker file to see which stack size is assigned to v4.

 

Regards

0 Kudos

325 Views
Ramya_12
Contributor I
Hi,

Thank You for your response, I want complete stack consumption of my application in run time , stack size in .lcf is 256 bytes , can you please help me out how we can proceed , with complete steps and screenshots for codewarrior IDE 11.1 version
Thanks & regards,
Ramya
0 Kudos

230 Views
TomE
Specialist II

You might do better to ask your question in a CodeWarrior forum. This forum is specifically for the ColdFire chips. Are you using one of them?

I've used older chips where the compiler provides a report of stack consumption for each function, and also knows which functions call what other ones. That way (as long as you're not using function pointers) it can work out the "maximum depth" for "main()", and separately for interrupt routines. Then you add the "deepest" for your stack consumption.

I don't know if CodeWarrior does that. It might of might not.

The ColdFIre chips can be used in complicated ways that makes this sort of thing not work (function pointers, registered callbacks and so on). They also have seven interrupt priority levels, so you can have interrupts interrupting other ones. That increases the stack consumption in ways that the programmer has to work out the worse case.

The other way of doing this is to fill the stack with a pattern like "0x5555" and then run the program with as many things happening (network, disk, interrupts, display, USB) as possible. Then examine the stack and see how "deep" the program has been be looking for the "lowest overwrite" in the pattern. Then add a margin as it may go deeper.

Tom

 

0 Kudos