How to shrink size of image?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DiDi_4439146
Level 3
Level 3
First solution authored 10 sign-ins 10 replies posted

Any tips how how to shrink down the size of the images made from the ez usb suite? This is particularly useful when using fail safe boot mode which will only allow approximately 118k bytes per image on a 2mB EEPROM.

Thanks!

0 Likes
1 Solution

Hello,

You can refer to this web link http://blog.atollic.com/the-ultimate-guide-to-reducing-code-size-with-gnu-gcc-for-arm-cortex-m

You can enable the Link Time Optimization by checking the last box in the Settings >Tool settings> Optimization.

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
5 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please let me know what is the image size and how much to be reduced.

You can try building the firmware in release mode and let me know if it helps

Regards,

Rashi

Regards,
Rashi
0 Likes

max size is about 119,000 bytes and I'm pretty close to that, so basically any amount of shrinking is good... looking for the easiest ways first - already building release

0 Likes

Hello,

You can increase the optimization level

Path: Properties>C/C++ Build>Settings>Optimization

optimize.png

As shown in the figure, you will have different.

Every time you change the optimization level, please check the functionality of the firmware doesn't change.

Also, let me know which compiler are you using. Is is the ARM GCC compiler?

Regards,

Rashi

Regards,
Rashi
0 Likes

Yes, ARM GCC. Also I am already using -O3, any other tips?

0 Likes

Hello,

You can refer to this web link http://blog.atollic.com/the-ultimate-guide-to-reducing-code-size-with-gnu-gcc-for-arm-cortex-m

You can enable the Link Time Optimization by checking the last box in the Settings >Tool settings> Optimization.

Regards,

Rashi

Regards,
Rashi
0 Likes