7 years, 10 months ago.

mbed online compiler binary code size reduction

Hello,

I wrote the code that I am able to flash into the flash memory (32k) of the L031K6. I am using the online IDE (mbed) and the code size is few bytes less than 32k. Now I want to add a deepsleep() function to save more power. The problem is that the size of the output binary file will exceed the limit. In order to reduce the size what do you suggest? I tried to export the program to an offline toolchain (I tried Kiel and GCC-ARM). I recompiled also the library but the code is even bigger. I tried with several compiler flags like -0s and -DNDEBUG but nothing helped. What can I do to reduce the code size? Apparently the online compiler is the best in term of code size, can I rebuild the libraries so that the size is reduced? Now I am using .bld file for precompiled libraries but maybe recompiling them somehow I can reduce the size. Any suggestion?

Thanks

Be the first to answer this question.