wath's mean in CW5.1  in .map file

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

wath's mean in CW5.1  in .map file

跳至解决方案
752 次查看
Fan_xy
Contributor III

Hello

 

19667_19667.pngpastedImage_0.png

when enable the stack consumption , what is meaning  in the CW5.1, Init(3)(2)  the second " (2) "  meaning ?

 

 

Thanks !

标签 (1)
0 项奖励
1 解答
568 次查看
trytohelp
NXP Employee
NXP Employee

Hi,

The information is not provided in the current documentation.

See below info about these details:

We checked the linker for the information you asked and it goes like this:

  • 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


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
4 回复数
569 次查看
trytohelp
NXP Employee
NXP Employee

Hi,

The information is not provided in the current documentation.

See below info about these details:

We checked the linker for the information you asked and it goes like this:

  • 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


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
568 次查看
Fan_xy
Contributor III

Thank Pascal.

While i still not clearly.

I know that , for example  fun(3)(0)  , it is meaning the leaf function , that is the last function of one branch.

While  fun(3)(2) , the 2 meaning what ? (in my project , it is Init(3)(2)) .

Thank !

0 项奖励
568 次查看
trytohelp
NXP Employee
NXP Employee

Hi,

Better is to use an example.

In this case I've create a project with the wizard.

After to have enabled the "-M -StackConsumption" options the map file is generated.

Test_1: without local variable

main.c file:

+++++++++++++++

void main(void) {

  /* put your own code here */

  //  int val_1=0;

//  char val_2=0;

    EnableInterrupts;

  for(;;) {

    _FEED_COP(); /* feeds the dog */

  } /* loop forever */

  /* please make sure that you never leave main */

}

+++++++++++++++

Map file

main and _Startup Group

|

+- main              

|  

+- _Startup          

    |

    +- Init(3)(3)              

    |  

    +- main(3)(0)                (see above)

Test_2: with val_1 local variable

main.c file:

+++++++++++++++

void main(void) {

  /* put your own code here */

    int val_1=0;

//  char val_2=0;

...

+++++++++++++++

Map file

main and _Startup Group

|

+- main              

|  

+- _Startup          

    |

    +- Init(3)(3)              

    |  

    +- main(3)(2)                (see above)

Test_3: with val_1 & val_2 local variables

main.c file:

+++++++++++++++

void main(void) {

  /* put your own code here */

    int val_1=0;

  char val_2=0;

...

+++++++++++++++

Map file

main and _Startup Group

|

+- main              

|  

+- _Startup          

    |

    +- Init(3)(3)              

    |  

    +- main(3)(3)  

The second information gives the Stack Consumption which are local variables and other local definition using stack for the function.


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
568 次查看
TICS_Fiona
NXP Employee
NXP Employee

Sorry that I cannot address any document to describe the details for Dependency Tree. From your screenshot, it seems that the function Init() calls two subroutines, and these subroutines may be in assembly code or in libraries.