Page 1 of 1

Blink on STM32L011: section `._user_heap_stack' will not fit in region `RAM'

Posted: Wed May 28, 2025 8:33 am
by dusan82
Arduino Version: 2.3.6 Date: 2025-04-09T11:24:04.835Z CLI Version: 1.2.0
STM32 MCU Based Boards 2.10.1
STM32CubeProgrammer-2.19.0
Ubuntu 24.04.2 LTS

I'm trying to make blink work with Generic STL32L011 series (Generic L011F4Px), specifically STM32L011F4P6. When I try to compile it, I get this error:

Code: Select all

/home/arduino2/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/14.2.1-1.1/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: /home/arduino2/.cache/arduino/sketches/01993C4702910C0E65592A755C304C9F/Blink.ino.elf section `._user_heap_stack' will not fit in region `RAM'
/home/arduino2/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/14.2.1-1.1/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 688 bytes
collect2: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
How to fix this problem?

(I think I posted in the wrong board, it should be in STM32L0 based boards)

Re: Blink on STM32L011: section `._user_heap_stack' will not fit in region `RAM'

Posted: Wed May 28, 2025 10:12 am
by GonzoG
Reduce RAM usage (variables).
You can do it by disabling unused peripherals and not needed features.

stm32duino isn't meant to be used on MCUs with low RAM/ROM. It has a lot "bloatware" to make it universal and easy to use.

Re: Blink on STM32L011: section `._user_heap_stack' will not fit in region `RAM'

Posted: Wed May 28, 2025 11:34 am
by dusan82
I don't use any variable it's just a blink example changing 1 pin.
How to disable unused peripherals and not needed features?

Re: Blink on STM32L011: section `._user_heap_stack' will not fit in region `RAM'

Posted: Wed May 28, 2025 8:53 pm
by dusan82
I managed to make blink work in STM32L011 in CubeIDE. Maybe in the arduino menu this particular chip should be shown as "Generic L011F4Px (unsupported, low memory)" or something like that.

Re: Blink on STM32L011: section `._user_heap_stack' will not fit in region `RAM'

Posted: Fri May 30, 2025 10:32 pm
by GonzoG
No, it shouldn't. You can reduce RAM usage to a few 100 bytes disabling unnecessary things.

Output after compiling blink sketch for L011F4:

Code: Select all

Sketch uses 4556 bytes (27%) of program storage space. Maximum is 16384 bytes.
Global variables use 412 bytes (20%) of dynamic memory, leaving 1636 bytes for local variables. Maximum is 2048 bytes.
Almost everything is available on stm32duino's Wiki: https://github.com/stm32duino/Arduino_Core_STM32/wiki
https://github.com/stm32duino/Arduino_C ... figuration