Try mbed OS on STM32F4DISCOVERY board

I wanted to try mbed OS on one STM32F4DISCOVERY board, however it was not supported by mbed OS yet. When I saw this discussion - Using a private repository for targets · Issue #610 · ARMmbed/yotta, it inspired me to create required modules to support this board.

New modules for supporting the board:

  1. target-st-stm32f4-disco-gcc
  2. mbed-hal-st-stm32f407vg
  3. cmsis-core-stm32f407xg

Forked modules for pulling in the required modules for supporting this board:

  1. cmsis-core-stm32f4
  2. mbed-hal-st-stm32f4

You could use yotta link and yotta link-target commands to try these modules, refer yotta Documentation - Using yotta link to fix bugs in dependencies about their usages.

Hope this help people to try mbed OS.

Thanks for sharing ! +1

I used this to try mbed on a STM32F411, worked great! Thank you!

I use this to try Mbed on STM32F407 and meet an error , the log as below:

:134:27: fatal error: stm32f407xx.h: No such file or directory
#include “stm32f407xx.h”
compilation terminated.
[5/159] Building C object ym/dlmalloc/source/CM…32f4/yotta_modules/dlmalloc/source/dlmalloc.c.o
ninja: build stopped: subcommand failed.
error: command [‘ninja’] failed

what’s the reason?
Waiting for ideas…

Have you linked the target mentioned in the opening post?

First , I downloaded the four modlue zip files and unzip to the yotta_module folder , download and unzip
the to the yotta_target folder.
Then , I run these cmds as below :

yt target stm32f4-disco-gcc
yotta install mbed-drivers
yotta link-target target-st-stm32f4-disco-gcc-master
yotta link mbed-hal-st-stm32f407vg-master

This is how I almost got it to build:

# make a new directory
mkdir test-stm32f4-disco
cd test-stm32f4-disco/

# clone the target
git clone
cd target-st-stm32f4-disco-gcc/
sudo yt link-target

# clone the dependencies
cd ..
git clone
cd mbed-hal-st-stm32f407vg/
sudo yt link

cd ..
git clone
cd cmsis-core-stm32f407xg/
sudo yt link

cd ..
git clone
cd cmsis-core-stm32f4
sudo yt link

cd ..
git clone
cd mbed-hal-st-stm32f4
sudo yt link

# clone blinky
cd ..
git clone
cd example-mbedos-blinky/
yt link-target stm32f4-disco-gcc
yt link mbed-hal-st-stm32f407vg
yt link cmsis-core-stm32f407xg
yt link mbed-hal-st-stm32f407vg
yt link cmsis-core-stm32f4
yt link mbed-hal-st-stm32f4
# for some reason need to install this one...
yt install mbed-hal-st-stm32f407vg
yt target stm32f4-disco-gcc

# get some files from mbedmicro for this target...
cd ..
git clone
cp mbed/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/*.h example-mbedos-blinky/yotta_modules/mbed-hal-st-stm32cubef4/mbed-hal-st-stm32cubef4/
cp mbed/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/*.c example-mbedos-blinky/yotta_modules/mbed-hal-st-stm32cubef4/mbed-hal-st-stm32cubef4/

# some include thing goes wrong, copy some .h files a folder up
cd example-mbedos-blinky/
cp ./yotta_modules/mbed-hal-st-stm32f407vg/mbed-hal-st-stm32f407vg/* ./yotta_modules/mbed-hal-st-stm32f407vg

# and build
yt build


ym/mbed-hal-st-stm32f407vg/source/mbed-hal-st-stm32f407vg.a(startup_stm32f407xx.s.obj): In function `LoopFillZerobss':
/Users/janjon01/repos/test-stm32f4-2/mbed-hal-st-stm32f407vg/source/bootstrap_gcc/startup_stm32f407xx.s:112: undefined reference to `SystemInitPre'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Which might be because I copied some files over from mbed Classic, might be that we need newer versions of these.

1 Like


Please will this work for stm32f103C8T6 board V5.02 board?


Is mbed simple project working for STM32F2 M3 processor?


Is nucleo board working for any one with Keil IDE?

Thanks for sharing~