2025-12-10 3:41 AM - last edited on 2025-12-10 3:43 AM by Andrew Neil
Good morning.
Could anyone tell me about this error and how to resolve it.
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3 .rel1.win32_1.0.0.202411081344/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: Oscillo_STM32G431CBU.elf section `.bss' will not fit in region `RAM'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3 .rel1.win32_1.0.0.202411081344/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: region `RAM' overflowed by 54928 bytes
I'm using IDE 1.19 to compile the code for a G431CBU
Grateful
Valter Matos
2025-12-10 3:45 AM - edited 2025-12-10 3:57 AM
Hello,
region `RAM' overflowed by 54928 bytes
Maybe you declared a large table in the RAM..
Use const for the table declaration to relocated it into the flash if that table content keeps unchanged in your application
2025-12-10 3:49 AM
The key part of the message is:
section `.bss' will not fit in region `RAM'It's telling you that your code uses more RAM than is available on the chip.
Specifically:
region `RAM' overflowed by 54928 bytes
It needs 54,928 more bytes.
The STM32G431CBU has 128K bytes of RAM; your code is using 54K more than that - so about 182K total.
You have 2 choices:
2025-12-10 4:32 AM
It's a relatively small code, without many tables, and I still don't know how to optimize it.
2025-12-10 4:45 AM
@ValterMatos wrote:without many tables,
It's not about the number - it's about the total amount of RAM that they occupy...
@ValterMatos wrote:I still don't know how to optimize it.
Nobody can help you without seeing the code!