Stack consumption in codewarrior

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

Stack consumption in codewarrior

1,422 Views
pratibhasurabhi
Contributor V

I have enabled stack usage in linker in properties in codewarrior. I then added the ISRs and startup in entries section in .prm file.

In map file we could see the stack consumption but the entire project tree as per functions was not created.

I want to confirm how the stack usage is calculated using this setting and how it can be verified.

0 Kudos
7 Replies

1,159 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

To investigate your issue, please let me know:

1. what's your chip part number?

2. Your CW version.

Thanks,

Jun Zhang

0 Kudos

1,159 Views
pratibhasurabhi
Contributor V

Hi

To investigate your issue, please let me know:

1. what's your chip part number? S12ZVM128

2. Your CW version.V10.7

Thanks & Regards

Pratibha Surabhi

Tata Consultancy Services Limited

Mailto: pratibha.surabhi@tcs.com

Website: http://www.tcs.com

0 Kudos

1,159 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Pratibha Surabhi,

Please send me demo code of this problem, thus I can look into the problem directly.

Please note, I don't need your working project, just a demo project to showcase your issue is good. Thanks.

Best Regards

Jun Zhang

0 Kudos

1,159 Views
pratibhasurabhi
Contributor V

Hi Zhang ,

There is no error actually .We just wanted to confirm how much reliable is

that stack consumption option for stack estimation .

Thanks & Regards

Pratibha Surabhi

Tata Consultancy Services Limited

Mailto: pratibha.surabhi@tcs.com

Website: http://www.tcs.com

0 Kudos

1,159 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

When using -StackConsumption , the linker automatically computes the stack consumption estimation for the application's entry point. This includes, typically the _Startup function and the user-provided vector table entries . Since it is not possible to determine at link-time control-flow dependencies between usual functions and interrupt handlers the linker will compute and print the stack consumption for each vector table entry separately.

The linker also supports advanced features to increase the precision of the estimation. These include:

  • Adding edges to the call graph; the FUNCTION_PAIR directive .
  • Specifying user-defined stack consumption for a function; the CONSUMPTION directive .
  • Specifying a custom call sub-tree; the ROOT directive .
  • Specifying that a specific interrupt can be raised during the execution of a function; the INTERRUPT_FUNCTION directive .
  • Specifying the maximum recursion factor for a function; the RECURSION_FACTOR directive .

Please check if advanced features you need in your project. For more, see " Stack Consumption Computation" in MCU_Build_Tools_Utilities.pdf under your CW11 install folder.


Have a great day,
Jun Zhang

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,159 Views
pratibhasurabhi
Contributor V

Dear Zhang

Thank you very much for the reply .

Please guide in the below mentioned 2 queries

1.The stack usage mentioned in map file and theoretically calculated(by

considering local variables used in function) are not coming same.

We think it is because of stack consumption of library function. So, we

want to know the stack usage of library function.

Request you to guide us for stack consumption calculation using map file.

2.The stack consumption in map file does not include all the functions

being called by ISR .In the dependency tree section all functions are

coming though .

Request you to please guide

Thanks & Regards

Pratibha Surabhi

Tata Consultancy Services Limited

Mailto: pratibha.surabhi@tcs.com

Website: http://www.tcs.com

0 Kudos

1,159 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Pratibha Surabhi,

Please send us your demo code for this two statement:

- "The stack usage mentioned in map file and theoretically calculated(by

considering local variables used in function)  are not coming same."

- " The stack consumption in map file does not include all the functions

being called by ISR

"

we can't  investigate this problem without a specific demo project. Not your working project but a demo project is great.

Thanks for your understanding.

Jun Zhang

0 Kudos