How to retrieve global and static variables size in CW 10.5?

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

How to retrieve global and static variables size in CW 10.5?

Jump to solution
1,202 Views
diegocolombo
Contributor IV

Hi to everybody here

Say that, somewhere ,i erroneously declared an array with [1000] elements instead of[100] as needed,is it possible to put it in evidence in some ordered list?

I enabled the print options in the Project->Properties->Settings->Additional tools  but i'm only able to finde the total sizes in the console


Mytest.elf

   text   data    bss    dec    hex filename

  13604   3136   1596  18336   47a0 Mytest.elf

  13604   3136   1596  18336   47a0 (TOTALS)

Thanks for any help

Diego

PS

I've also posted it here

Code Size Information with gcc for ARM/Kinetis | MCU on Eclipse

0 Kudos
1 Solution
800 Views
BlackNight
NXP Employee
NXP Employee

Hello,

that you are using your own linker file should not prevent the .map file generated.

But I see that you have the --print-map option enabled. With this, the map file is printed to the console view, and not as file. To have it as file, unselect this option:

pastedImage_0.png

Then everything should be fine.

Erich

View solution in original post

0 Kudos
6 Replies
800 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Diego:

Just as Erich suggested, you will find that info in the map file. Here an example:

In my code I have:

static uint8 my_buff[100];

Then in the map file I find the next:

Map_file.png

The first number is the address in RAM, while the second is the size.

Hope this helps!


Regards!
Jorge Gonzalez

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

800 Views
diegocolombo
Contributor IV

Hi Jorge

the matter is that i 'm not able to generate any map file

No result if i  search for it in the project folder.

How can i generate it?

Or should i look for other extensions?

Thanks Jorge

0 Kudos
800 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi Diego:

This file should be in the FLASH folder, after you compile your project.

If it is not in there, go to Project -> Properties -> C/C++ Build -> Settings -> ARM Ltd Windows GCC C Linker; and check in the linker options whether or not there is a flag and a name to generate the map file:

Link_options.png

And also in ARM Ltd Windows GCC C Linker -> Miscellaneous, check if you have a map file name:

MFile_name.png

Regards!

Jorge Gonzalez

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

800 Views
diegocolombo
Contributor IV

Jorge thanks again for your precise indications

These are my options

-T"C:\FRDM_KL25Z WorkSpace\DisplayOnlytest/Project_Settings/Linker_Files/ProcessorExpert.ld" -Xlinker --gc-sections -L"C:\Freescale\CW MCU v10.5\eclipse\../MCU/ARM_GCC_Support/ewl/lib/armv6-m" -Wl,-Map,DisplayOnlytest.map -Xlinker --print-map -n -specs=ewl_c.specs -Xlinker --undefined=__pformatter_ -Xlinker --defsym=__pformatter=__pformatter_ -Xlinker --undefined=__sformatter -Xlinker --defsym=__sformatter=__sformatter

In ARM Ltd Windows GCC C Linker ->Miscellaneous everything looks correct,but still the *.map file is not created

I edited my own linker file,so in PE the build option "Generate linker file" is not active.

Could this have to do with the lack of map file?

Thanks

Diego

0 Kudos
801 Views
BlackNight
NXP Employee
NXP Employee

Hello,

that you are using your own linker file should not prevent the .map file generated.

But I see that you have the --print-map option enabled. With this, the map file is printed to the console view, and not as file. To have it as file, unselect this option:

pastedImage_0.png

Then everything should be fine.

Erich

0 Kudos
800 Views
diegocolombo
Contributor IV

Thank you Erich and Jorge

yes ,unselecting the Print Link Map option everything works fine,i have the .map file now

Have a good week and thanks to everybody just for reading this discussion

Diego

0 Kudos