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

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

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

Jump to solution
1,056 Views
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 !

Labels (1)
0 Kudos
Reply
1 Solution
872 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
4 Replies
873 Views
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 Kudos
Reply
872 Views
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 Kudos
Reply
872 Views
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 Kudos
Reply
872 Views
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.