Bluepill STM32F103C8 support for Mbed OS 6
Bluepill board support for Mbed OS 6
Warning
It does not work with the Mbed Online Compiler.
This is an example of configuration for the Bluepill board for Mbed OS 6.
It shows how to create a custom board support based on Mbed OS and how to compile a simple Blinky application.
Note this project makes use of the full Mbed OS with RTOS included. It's possible to make changes in the configuration to support the Baremetal profile and reduce memory requirements - see this.
Example application
This repository includes blinky.cpp
as an example application to demonstrate how to use the Bluepill custom board support. It's expected to work out of the box using both Mbed CLI and Mbed Studio.
Note this test application can be ignored using the MBED_BLINKY_EXAMPLE
macro in mbed_app.json
, so you can add your own files and application on top of this project.
You can follow these steps to import and compile with Mbed CLI:
mbed import https://os.mbed.com/users/hudakz/code/mbed-os-bluepill mbed compile -t GCC_ARM -m bluepill
Bluepill and Mbed OS version support
Bluepill | Mbed OS (hash) | Status |
---|---|---|
preview | 6.2.0 (#a2ada74770 ) | Compiles and runs ok |
Updating Mbed OS
Note not every version of Mbed OS is being tested, therefore update at your own risk. Unless strictly required, you should stick to versions of Mbed OS that are known to work ok.
If you do want to udpate Mbed OS, then follow these steps:
cd mbed-os mbed update <mbed-os hash / tag>
Testing
This application has been tested on the Bluepill board and runs ok: it blinks and LED and sends a message over the serial port (115200 bauds - see mbed_app.json
).
However, it's recomended to run regression tests based on the Greentea framework whether possible (more details to be added).
Programming with STLink programming utility
The Bluepill board doesn't have a programming interface on board. However, it's easy to connect an external adapter such as the STLink/V2 and get it working in minutes.
Use the STM32 ST-Link utility to program the binary into the device.
Wire the Bluepill to the STLink and serial adapter as follow:
Bluepill | STLink (20-pin JTAG) | Serial adapter |
---|---|---|
SDWIO (CN4) | 7 | - |
SWCLK (CN4) | 9 | - |
RESET | 15 | - |
GND | 4 | GND |
TX (PA_2) | - | RX |
RX (PA_3) | - | TX |
ST-LINK/V2 JTAG pintout
This is the pinout of the Bluepill board:
Additional example programs
Bare metal on Bluepill
Bare metal with EventQueue on Bluepill
Warning
The examples above are not meant to be compiled with the online compiler. Follow these steps to import and compile them with Mbed CLI:
mbed import Program's_URL mbed compile -t GCC_ARM -m bluepill
Known issues
- Please check the issues reported.
History
Added USB support.
2021-01-08, by hudakz [Fri, 08 Jan 2021 22:21:27 +0000] rev 10
Added USB support.
Bluepill STM32F103C8 support for Mbed OS 6
2020-07-21, by hudakz [Tue, 21 Jul 2020 07:28:50 +0000] rev 9
Bluepill STM32F103C8 support for Mbed OS 6
Bluepill STM32F103C8 support for Mbed OS 6
2020-07-21, by hudakz [Tue, 21 Jul 2020 06:29:53 +0000] rev 8
Bluepill STM32F103C8 support for Mbed OS 6
Bluepill STM32F103C8 support for Mbed OS 6
2020-07-20, by hudakz [Mon, 20 Jul 2020 17:47:46 +0000] rev 7
Bluepill STM32F103C8 support for Mbed OS 6
Bluepill board support for Mbed OS 6
2020-07-08, by hudakz [Wed, 08 Jul 2020 07:21:15 +0000] rev 6
Bluepill board support for Mbed OS 6
Bluepill board support for Mbed OS 6 - mbed-os.lib updated to rev. 165be79392ae7b1...
2020-06-24, by hudakz [Wed, 24 Jun 2020 14:52:57 +0000] rev 5
Bluepill board support for Mbed OS 6 - mbed-os.lib updated to rev. 165be79392ae7b1...
Bluepill board support for Mbed OS 6
2020-06-24, by hudakz [Wed, 24 Jun 2020 08:26:31 +0000] rev 4
Bluepill board support for Mbed OS 6
Custom Bluepill example for Mbed OS 6.
2020-06-04, by hudakz [Thu, 04 Jun 2020 21:43:31 +0000] rev 3
Custom Bluepill example for Mbed OS 6.
Custom Bluepill target example for Mbed OS 6.
2020-05-18, by hudakz [Mon, 18 May 2020 16:53:20 +0000] rev 2
Custom Bluepill target example for Mbed OS 6.
Bluepill board support for Mbed OS 6
2020-05-14, by hudakz [Thu, 14 May 2020 05:13:17 +0000] rev 1
Bluepill board support for Mbed OS 6