Unable to compile blink led example with mbed rtos


I have just installed PlatformIO and while trying to build a few example projects to get acquainted to it, I’m getting and error. Since I’m new to mbed as well, I’m clueless to where the error is.

I’m trying to get the code in the following example page running:


I’ve got a STM32F0Discovery board, which is listed as supported by the mbed framework in the PlatformIO documentation. But trying to build it, I get an error with the following output:

[Tue Aug  9 10:43:04 2016] Processing disco_f051r8 (platform: ststm32, board: disco_f051r8, framework: mbed)
arm-none-eabi-g++ -o .pioenvs/disco_f051r8/firmware.elf -Wl,--gc-sections -Wl,--wrap,main -mcpu=cortex-m0 -mthumb --specs=nano.specs -Wl,-T"/home/carvalhais/.platformio/packages/framework-mbed/variant/DISCO_F051R8/mbed/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM/STM32F0xx.ld" .pioenvs/disco_f051r8/src/main.o -L/home/carvalhais/.platformio/packages/ldscripts -L/home/carvalhais/.platformio/packages/framework-mbed/variant/DISCO_F051R8/mbed/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM -L/home/carvalhais/.platformio/packages/framework-mbed/libs/rtos/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM -L/home/carvalhais/.platformio/packages/frameworkmbed/libs/rtos/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM -L.pioenvs/disco_f051r8 -Wl,--start-group -Wl,-whole-archive .pioenvs/disco_f051r8/libFrameworkMbed.a -Wl,-no-whole-archive -lsupc++ -lmbed -lc -lgcc -lc -lgcc -lm -lstdc++ -lnosys -lrtos -lrtx -Wl,--end-group
/home/carvalhais/.platformio/packages/framework-mbed/libs/rtos/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM/librtx.a(HAL_CM0.o): In function `SysTick_Handler':
HAL_CM0.S:(.text+0x12c): multiple definition of `SysTick_Handler'
.pioenvs/disco_f051r8/libFrameworkMbed.a(system_stm32f0xx.o):system_stm32f0xx.c:(.text.SysTick_Handler+0x0): first defined here
collect2: error: ld returned 1 exit status
scons: *** [.pioenvs/disco_f051r8/firmware.elf] Error 1
========================= [ ERROR ] Took 0.48 seconds =========================

Any help would be greatly appreciated. Thanks in advance,


Hi @carvalhais!
Currently, we don’t have support for mbedOS 5. You’d better start with these examples.

@valeros thanks very much for your kind answer.

I just tried to build and run the code at


as you indicated and I’m still getting the same error.

I was able to use the the example at:


So I would assume the error I’m getting is triggered by the inclusion of rtos.h

(sorry about the lack of proper links, it seems I have a new user limitation regarding to that)

Hm, I can confirm that we have this linker issue with this board.
Could you please open an issue in ststm32 platform repository?

Just opened the ticket, thanks very much for you help on this issue. I’m not sure if I should mark this thread as resolved?

Rtos is not supported on this board because of too small amount of memory.