5 years, 11 months ago.

How to reduce generated binary image?

Hi All,

I am evaluating the ST microelectronics's Nucelo series STM32f401RE board with the Mbed-os.

I downloaded the Mbed-os led blink example code and compile it. The generated binary size is around 55kB. So,i commented out the Digitalout LED object and further code related to it. I just keep the void main only and compile it. It generated the also same size binary file. In embedded device the Memory is always concern. Why it take lots of size?I

My queries regarding to binary size is as below, 1. how to reduce the generated binary size ? 2. Is there any document for generated binary footprint size ?

Please let me know if you need more information from my side.

Thanks, Parth

1 Answer

5 years, 11 months ago.

There are several official mbed posts on this topic. Bottom line is there are a bunch of contributing factors. And it is entirely possible to reduce memory footprint by trading off some features if that is a design decision you want to make.

https://os.mbed.com/blog/entry/Optimizing-memory-usage-in-mbed-OS-52/

https://os.mbed.com/blog/entry/Reducing-memory-usage-by-tuning-RTOS-con/

Personally, I would be cautious spending too much time worrying about the flash footprint unless you are certain you really need that extra bit of memory.

Accepted Answer

Thanks Graham S. for your detailed information.

posted by Parth Modi 14 Jun 2018