Show file size on console

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

Show file size on console

886 Views
sokolbiba
Contributor I

Hi every one,

I am trying to show the source files size when building the project. Is there any command to MCUXpresso to make this in an automated way for every project? It would be nice to have all the object files listed and their size.

Regards,

Sokol

Labels (1)
0 Kudos
3 Replies

765 Views
BlackNight
NXP Employee
NXP Employee

Hi Sokol,

yes, you can use the size utility in a postbuild step for this:

pastedImage_1.png

See Listing Code and Data Size for each Source File with GNU and Eclipse | MCU on Eclipse .

Another way would to see what is actually linked would be to use the nm utility with MCUXpresso IDE as shown in Listing Code and Data Size with GNU nm in Eclipse | MCU on Eclipse 

I hope this helps,

Erich

0 Kudos

765 Views
sokolbiba
Contributor I

Hi Eric,

Thank you for your reply. I have done it in that way and there is en error in the console. It is unable to read the files in different directories that excist inside the source directory. Please have a look at the image below. I want this to be a general command. I do not want to change the command for every project in order to show files size for different projects.

Regards,

Sokol

0 Kudos

765 Views
BlackNight
NXP Employee
NXP Employee

Hi Sokol,

you have to tell the size (GNU Binary Utilities: size ) tool where the object files are. It cannot find them in a magical way. So if your directories are different, you have to tell it where it is. If that is not ok for you, you could write a script which goes recursively through the direcories and calls 'size'.

I hope this helps,

Erich

0 Kudos