image size

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

image size

Jump to solution
958 Views
mehdikarimibiuk
Contributor V

I have a bareboard project for my MK10DN512ZVLL10 MCU with image afx file size of 124KB. This seems to be a large file! It seems that I am using a quarter of my flash space! Is that true?

I have started this project and as I am adding components and developing my code, this project might grow up to 400KB mybe! But this does not make sense if my image is going to take up my whole flash memory!

This is even without having the MQX!

Tags (2)
1 Solution
744 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

the elf file includes debug information, so this file is big. the real flash image(for example, s19 file) is much smaller than elf file. see this link for how to create s19 file. http://mcuoneclipse.com/2012/09/13/s-record-generation-with-gcc-for-armkinetis/ can this help?

View solution in original post

0 Kudos
7 Replies
745 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

the elf file includes debug information, so this file is big. the real flash image(for example, s19 file) is much smaller than elf file. see this link for how to create s19 file. http://mcuoneclipse.com/2012/09/13/s-record-generation-with-gcc-for-armkinetis/ can this help?

0 Kudos
744 Views
mehdikarimibiuk
Contributor V

Thanks it is 49KB now!

So how can I know where and at what address this image is exactly loaded?

Is this something that I can set or see at least?

I am going to have two images, one factory image and the other upgraded image, therefore I need to know the detail about at what location exactly these images are going to be saved.

0 Kudos
744 Views
BlackNight
NXP Employee
NXP Employee

Have a look at the format/content of the S19 file (SREC (file format) - Wikipedia, the free encyclopedia): it contains the address in clear text.

744 Views
mehdikarimibiuk
Contributor V

n/a

0 Kudos
744 Views
mjbcswitzerland
Specialist V

The SREC format contains the binary code represented in ASCII HEX (2 bytes for each byte) plus a header (about 10 extra bytes per line) and a checksum (another 2 bytes per line) so it will generally by about 2.4x larger than the binary content that it represents (ignoring holes between areas of data).

Any Flash sectors that are not occupied by program code can be used to store other things. When the chip is fully erased the content of all sectors is 0xff, oxff,...

Regards

Mark

744 Views
mjbcswitzerland
Specialist V

Hi

afx is an elf file containing program code and debug information. It is several times larger than the actual binary code. Create a binary output to see the actual code size you have.

Regards

Mark

0 Kudos
744 Views
mehdikarimibiuk
Contributor V

My elf and afx files are of same size! but when I generate srec, it is more than fifty percent overhead savings!

0 Kudos