cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

DiDi_4439146
New Contributor II

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
Reply
1 Solution
Rashi_Vatsa
Moderator
Moderator

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
Reply
5 Replies
Rashi_Vatsa
Moderator
Moderator

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
Reply
DiDi_4439146
New Contributor II

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
Reply
Rashi_Vatsa
Moderator
Moderator

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
Reply
DiDi_4439146
New Contributor II

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

0 Likes
Reply
Rashi_Vatsa
Moderator
Moderator

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
Reply