Maclain Lobdell

tip - how to see your project code size without digging in the map file  (CodeWarrior >=10.3 print size feature)

Discussion created by Maclain Lobdell Employee on Apr 21, 2014

Hi,

I just learned how to do this and thought I would share.  This is a feature of CodeWarrior for MCUs 10.3 and later with gcc selected as compiler.  Someone asked me if there was a "button" that you could push to see what your compiled code size was, instead of having to open and scrutinize the map file which has this info.  Looks like there is not a button, but there is a check box to enable it to print this information to the console window.


So, in summary, to enable the project size to be printed to the console window after a build,  I did this.

 

Go to Project…Properties…C/C++ Build…Settings…

 

Tool Settings (Tab)…Additional Tools…  check Print Size

 

                print_size.png

 

Build Artifact (Tab)…remove all spaces in the Artifact name: field.  In my case, I replaced the folder name “Int Flash SramData Debug” with “Int_Flash_SramData_Debug”.

print_size_no_spaces.png

 

Now when the project is built, it runs the GNU Print Size utility to print the code size to the console. The code size is shown for in text, data, and bss sections as well as total size in decimal and hexadecimal format.

 

print_size_console.png

 

Mac L

Outcomes