SpotlightKid / mbed-blackpill-demos

Small demo firmware programs for "Black Pill" board with STM32F411CEU6 MCU using mbed. Each branch has a different demo project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Black Pill mbed LED Switch Example

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.

Compilation

export PROFILE=develop
./build.sh

See also these notes on setting up your mbed development environment on Arch Linux.

Flashing

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

Connections

None.

The example used the on-board blue LED (connectd to pin PC_13) and the USER switch (connected to pin PA_0).

Notes

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

References

About

Small demo firmware programs for "Black Pill" board with STM32F411CEU6 MCU using mbed. Each branch has a different demo project.


Languages

Language:C 91.5%Language:Shell 4.2%Language:Python 3.4%Language:C++ 0.8%