How to enable "Stack Consumption Computation"

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

How to enable "Stack Consumption Computation"

1,257 Views
jayyjyang
Contributor I

I read the help doc for Stack Consumption Computation, yet still not know how to enable this feature. How to use this option"using -StackConsumption" ? Details with screenshots will help a lot. Thank you very much.

Labels (1)
0 Kudos
7 Replies

970 Views
BlackNight
NXP Employee
NXP Employee

It is documented in the manual (see attached screenshot).

Keep in mind that this way is for the HCS08 compiler/linker.

If you would like to do this say for ARM, see GNU Static Stack Usage Analysis | MCU on Eclipse 

I hope this helps,

Erich

0 Kudos

970 Views
jayyjyang
Contributor I

Thank you, Erich. 

In fact, I have read the manual. Just can't find out a place to "enable the linker option". I have never do anything about "the linker option".

That means I am stuck at step 1(see attached screenshot).

Capture.PNG

0 Kudos

970 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Yang,

You can enable "Stack Consumption Computation" refer to the below path :

pastedImage_1.png

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

970 Views
jayyjyang
Contributor I

Hey Alice,

Thank you. It helps a lot.

And now I am at step 3. It outputs this(see the attached here):Capture1.PNG

So no"STACK CONSUMPTION COMPUTATION"section in the MAP file, and no "Maximum Stack Usage is calculated for following path" as the manual shows:(see the attached above)

PS: BTW, what do the numbers mean in the "cpmu_init(3)(0)  ", and why there are two numbers?

0 Kudos

970 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Yang,

- Please see the bottom of .map file , you will find  STACT CONSUMPTION .

- The meaning of numbers is :

  • the first value after the function name represents the stack size required for calling that particular function from its caller (so basically the stack consumption of the ‘call’ itself)
  • the second value after the function name appears only for the leaf functions (functions that don’t call other functions) and represents the stack size consumed by that function

 

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

970 Views
jayyjyang
Contributor I

Hi Alice,

Thank you for the information.

Yes, I have checked the whole MAP file, including the bottom, just not there. 

No STACT CONSUMPTION at all.

Any idea how would this happen?

PS: Here's the bottom of it.

|
+- _Startup (see above)

*********************************************************************************************
STATISTIC SECTION
---------------------------------------------------------------------------------------------

ExeFile:
--------
Number of blocks to be downloaded: 5
Total size of all blocks to be downloaded: 24740

0 Kudos

970 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jay,

Please tell me the version of CW and the part number of your chip, also send your project to me .

BR

Alice

0 Kudos