6 years, 3 months ago.

Region `FLASH' Overflowed using Mbed-CLI

Whenever I use the Mbed-CLI (mbed compile -m NUCLEO_L031K6 -t GCC_ARM) to compile the code for NUCLEO-L031K6, an error such as "`.text' will not fit in region `FLASH'" and "region `FLASH' overflowed by 6768 bytes" occur.

When I use the online compiler, it works fine.

At first I want to add the optimisation flag "-Os" to the build option. However, it turns out that the Mbed-CLI has already considered such option.

So, is it possible to further reduce the compiled code size using GCC_ARM toolchain?

Thanks in advance

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32L031K6T6 microcontroller.

1 Answer

6 years, 3 months ago.

You could try to use the release build profile - https://os.mbed.com/docs/v5.6/tools/build-profiles.html