A simple example firmware for the "Black Pill" board based on an STM32F411CEU6 MCU using mbed OS.
We will use GCC ARM on the command line on Arch Linux.
This basic example toggles the on-board LED on and off on each USER button press.
export PROFILE=develop
./build.sh
See also these notes on setting up your mbed development environment on Arch Linux.
- Connect USB.
- Press and hold BOOT0, then press NRST, release NRST, release BOOT0.
export PROFILE=develop
./flash-dfu.sh
and confirm with 'y'.
If firmware doesn't start successfully, dis- and reconnect USB and try again.
See also these more detailed notes.
None.
The example used the on-board blue LED (connectd to pin PC_13) and the USER switch (connected to pin PA_0).
- The LED pin is active HIGH.
- You may notice some bouncing of the USER button. De-bouncing button presses will be adressed in the next example.