EFM32 (STK3200) cannot move location counter backwards (from 0000000020000490 to 0000000020000000)

Hi guys,

I have just started using Platform-io via VSCode. I have no issue with ESP32 and Atmel project. But I’m getting “.pio/build/efm32zg_stk3200/efm32zg.ld.link_script.ld:89 cannot move location counter backwards (from 0000000020000490 to 0000000020000000)” error message while compling an empty project. I researched many forums b ut they are explaining about an already developed project. A lot of talk has been made about ram usage. In my case, it is completely empty project.

Could you help me?

platformio.ini
[env:efm32zg_stk3200]
platform = siliconlabsefm32
board = efm32zg_stk3200
framework = mbed

This is usually a mesage that arrises when a linker script checks if the application overflows the boundaries of RAM or flash. Judging from the address 0x20000000 your application is overflowing RAM.

Your board has only a measly 4KB of RAM, so no way it can run the full mbed-os 6.x (or 5.x). You’ll need to use mbed-os in baremetal mode.

Copy the platform-ststm32/examples/mbed-rtos-blink-baremetal/mbed_app.json at develop · platformio/platform-ststm32 · GitHub file in the root of your project and retry compilation.

1 Like

It is very interesting. Atmega328p only have 2KB RAM and run realy big project; but Mbed can’t fit in EFM32 with 4KB even if the project is empty. The toolchain is very inefficient.

I tried mbed_app.json but it reduced only 0.3KB of RAM. Still 3,4KB RAM, 39KB ROM is used. I checked with STK3800 board. Here is the output:

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  10.5% (used 3440 bytes from 32768 bytes)
Flash: [=         ]  14.8% (used 38864 bytes from 262144 bytes)
Building .pio\build\efm32wg_stk3800\firmware.bin