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!
-----------------------------------------------------------------------------------------------------------------------