cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WLE5C8 : region `FLASH' overflowed by *** bytes0

Iaomari
Associate II

Hi everyone :)

I'm at the first steps of building a Lora application with STM32WLE5C8 MCU.

While using CubeMX to generate the code, and after defining the pinout of the chip, connectivity, and LORWAN in middleware, I opened the project in CudeIDE and tried to build it, I got :

make: *** [makefile:79: TEST3.elf] Error 1 TEST3 C/C++ Problem

region `FLASH' overflowed by 484 bytes TEST3 C/C++ Problem

TEST3.elf section `.rodata' will not fit in region `FLASH' TEST3 C/C++ Problem

I still didn't start writing the Lora application, I wanted to make sure that the generated files are working correctly.

I tried to make the same settings with STM32WLE55 (which has more flash and ram) and the building process seems to work just fine!

Is there anything I can do to still be able to use the STM32WLE5C8 MCU?

I'm new to STM32 MCU :D

thanks a lot

5 REPLIES 5
Uwe Bonnes
Principal III

Your programm is to big. Try cutting it down or compile better optimized for size.

I agree, try to turn up optimisation settings first.

But be aware that higher optimisation settings broke Cube/HAL code not only once.

@Uwe Bonnes​  @Ozone​ Thank you very much. I can compile the code now.

@Ozone​ can you please tell more about the higher optimization can effect in the code? do you any suggestion about what is possible to do regarding this issue?

thanks

The compiler will throw out variables when he sees no further reference in the module (no cross-module analysis).

This requires a "volatile" qualifier to avoid this problem.

It will reorganize and reorder code that might contain implicit runtime or order assumptions. Try a debugging session of code in the most agressive optimisation settings - from a good compiler (e.g. IAR or Keil).

Race conditions might appear or disappear (often interrupt handler interactions).

> do you any suggestion about what is possible to do regarding this issue?

Test your code properly.

My dayjob involves this for at least 50 % of the time.

The Cube/HAL code receives very little attention in this regard, due to (I think) resource and time constraints.

If you want something tested and approved, you might need to lay down some money.

My company paid a 6-digit sum for the source code of a tested and certified realtime OS.

thank you very much.

I would like to ask few not direct related questions, do you mind if I send you a private message?

best regards.