Finding Code Size

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

Finding Code Size

Jump to solution
1,107 Views
stanleypond
Contributor I

My compiler will not download my code on an MC9SO8 and I was told the license I am using only allows 64k. I was wondering if there is a way to find what size my current code is? Leong asked the following question in 2011 and is exactly the question I have but was never answered. Thanks. "Similar question here:  Is there a number or numbers that I can read to determine my current code size? Is it the generated bin file size? is it the compiled code size? does it include libraries? library modules that are not used by the linker? If as mentioned ""the size of the binary code output that gets directly programmed to the MCU flash"", then data size also needs to be counted?"Similar question here: Is there a number or numbers that I can read to determine my current code size? Is it the generated bin file size? is it the compiled code size? does it include libraries? library modules that are not used by the linker? If as mentioned ""the size of the binary code output that gets directly programmed to the MCU flash"", then data size also needs to be counted?"

Labels (1)
0 Kudos
1 Solution
782 Views
BlackNight
NXP Employee
NXP Employee

The code size is reported by the linker in the console view, e.g.

Generating Symbol table

Generating DWARF data version 2.0

Code Size: 156

Generating MAP file 'C:\tmp\wsp_10.6\test08\FLASH\test08.map'

Additionally you get the code size in the map, at the end:

ExeFile:

--------

Number of blocks to be downloaded: 4

Total size of all blocks to be downloaded: 156

Erich

View solution in original post

0 Kudos
3 Replies
783 Views
BlackNight
NXP Employee
NXP Employee

The code size is reported by the linker in the console view, e.g.

Generating Symbol table

Generating DWARF data version 2.0

Code Size: 156

Generating MAP file 'C:\tmp\wsp_10.6\test08\FLASH\test08.map'

Additionally you get the code size in the map, at the end:

ExeFile:

--------

Number of blocks to be downloaded: 4

Total size of all blocks to be downloaded: 156

Erich

0 Kudos
782 Views
stanleypond
Contributor I

I was told that the code size reported by the map is not the correct code size for determining if we have the correct license for codewarrior. The following is a quote from the last ticket we opened trying to find this code size:

"Unfortunately there is nowhere to check C object code size of a project in CW. Object code is un-optimized code, while the download code size shown in the map file is after-optomized code size. They are different." So does the map file actually give the size of the code that Code Warrior is using to determine which license is needed?

0 Kudos
782 Views
BlackNight
NXP Employee
NXP Employee

The map file gives that code size.

It is true that you cannot summarize the code size of object files, but what the linker puts out there in the map file should be what it is used.

At least this was my experience.

0 Kudos