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.
-Max

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:

E:/portingStm32f4/yotta_modules/cmsis-core-stm32f4/cmsis-core-stm32f4/stm32f4xx.h
: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 target-st-stm32f4-disco-gcc-master.zip 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 git@github.com:maxpeng/target-st-stm32f4-disco-gcc.git
cd target-st-stm32f4-disco-gcc/
sudo yt link-target

# clone the dependencies
cd ..
git clone git@github.com:maxpeng/mbed-hal-st-stm32f407vg.git
cd mbed-hal-st-stm32f407vg/
sudo yt link

cd ..
git clone git@github.com:maxpeng/cmsis-core-stm32f407xg.git
cd cmsis-core-stm32f407xg/
sudo yt link

cd ..
git clone git@github.com:maxpeng/cmsis-core-stm32f4.git
cd cmsis-core-stm32f4
sudo yt link

cd ..
git clone git@github.com:maxpeng/mbed-hal-st-stm32f4.git
cd mbed-hal-st-stm32f4
sudo yt link

# clone blinky
cd ..
git clone git@github.com:ARMmbed/example-mbedos-blinky.git
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 git@github.com:mbedmicro/mbed.git
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

However…

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

Hi,

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

Hi,

Is mbed simple project working for STM32F2 M3 processor?

Thanks,
Naeem

Is nucleo board working for any one with Keil IDE?

Thanks for sharing~