Finding Code Size

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Finding Code Size

跳至解决方案
1,124 次查看
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?"

标签 (1)
0 项奖励
1 解答
799 次查看
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 项奖励
3 回复数
800 次查看
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 项奖励
799 次查看
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 项奖励
799 次查看
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 项奖励