2025-07-15 6:34 AM - last edited on 2025-07-15 6:55 AM by Andrew Neil
Hello All,
I am using STM32L011G4U6TR for one of my application development.
I have written a code where I am using,11 GPIO, 1 UART and Internat EEProm.
When I am building the code in I am getting below Error and not able to load the Application on STM32L011G4U6TR board.
If someone could guide how to resolve it, would be helpful. (Have removed the unnecessary arrays variables and using minimum variables to optimized ).
Description Resource Path Location Type
IPL_Handpiece_Control_Board_Firmware.elf section `.text' will not fit in region `FLASH' IPL_Handpiece_Control_Board_Firmware C/C++ Problem
make: *** [makefile:64: IPL_Handpiece_Control_Board_Firmware.elf] Error 1 IPL_Handpiece_Control_Board_Firmware C/C++ Problem
region `FLASH' overflowed by 568 bytes IPL_Handpiece_Control_Board_Firmware C/C++ Problem
Note when I am commenting some part of needed code then, I am able to load it and debug, but I need all the GPIO, UART, EEprom working together. Will do as per suggestions.
Regards,
SMD
2025-07-15 6:40 AM
Your program is limited to the amount of FLASH available.
To reduce program size, you can do a few things:
2025-07-15 6:50 AM - edited 2025-07-15 6:56 AM
@Shiv09 wrote:I am using STM32L011G4U6TR
So it has only 16K of Flash.
The message tells you that you are 568 bytes over that:
IPL_Handpiece_Control_Board_Firmware C/C++ Problem
region `FLASH' overflowed by 568 bytes IPL_Handpiece_Control_Board_Firmware C/C++ Problem
@Shiv09 wrote:Have removed the unnecessary arrays variables and using minimum variables to optimized
That would reduce RAM use, but it's Flash that's overflowing - not RAM.
You need to reduce the code size.
Use the CubeIDE Build Analyser to see what, exactly, is using up all the space.
common space hogs include
As @TDK suggested, try a higher optimisation setting.
PS: