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

USB superspeed peripherals

DiDi_4439146
Level 3
10 replies posted 10 questions asked 5 replies posted
Level 3

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
Rashi_Vatsa
Moderator
Moderator 500 solutions authored 1000 replies posted 750 replies posted
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
5 Replies
Rashi_Vatsa
Moderator
Moderator 500 solutions authored 1000 replies posted 750 replies posted
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
DiDi_4439146
Level 3
10 replies posted 10 questions asked 5 replies posted
Level 3

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
Rashi_Vatsa
Moderator
Moderator 500 solutions authored 1000 replies posted 750 replies posted
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
DiDi_4439146
Level 3
10 replies posted 10 questions asked 5 replies posted
Level 3

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

0 Likes
Rashi_Vatsa
Moderator
Moderator 500 solutions authored 1000 replies posted 750 replies posted
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
0 Likes