Skip to content
Select theme

Embedded Rust on STM32

What you end up with: firmware running on real hardware. You will blink an LED, read a button, talk to an I2C sensor, run concurrent async tasks with Embassy, and put the chip to sleep between events.

The finished firmware’s tasks interleaved on the executor: the breath, the sensor, and the logger

Embedded is where Rust’s safety story is most convincing — no null pointers, no data races, no undefined behaviour in an interrupt handler — and where the tooling has quietly become better than C’s. It is a small audience, but a loyal one.

  • A flashing LED, then a button that changes the flash pattern
  • defmt logging, viewed through probe-rs over the debug probe
  • A temperature and humidity reading from an I2C sensor
  • Two concurrent async tasks sharing state safely
  • A low-power build that wakes on an interrupt
  • An STM32 board — the STM32F4 “Black Pill” or NUCLEO-F401RE is the cheapest sane choice
  • An ST-Link debug probe (built into NUCLEO boards), on-board or external
  • probe-rs and the thumbv7em-none-eabihf target installed

embedded-stm32/ in the examples repository — one cargo project, one tag per article.