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.

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.
What you’ll build
Section titled “What you’ll build”- A flashing LED, then a button that changes the flash pattern
defmtlogging, viewed throughprobe-rsover 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
What you need
Section titled “What you need”- 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-rsand thethumbv7em-none-eabihftarget installed
Before you start
Section titled “Before you start”- Structs, enums, and pattern matching — register access is all enums and
match - Traits and generics — HALs are built from traits
- Concurrency and async — the last third of the track is async
Articles
Section titled “Articles”- What you need to start embedded Rustthe board, the probe, and the cables
- Setting up the embedded toolchainthe target triple, probe-rs, and cargo flash
- Blinking an LEDembedded-hal, cortex-m, and a first flash
- Understanding no_stdno allocator, no panic message, no libc
- Reading a button with GPIO inputpull-ups, debounce, and polling versus interrupts
- PWM and controlling brightnesstimers and duty cycle
- Talking to an I2C sensorreading temperature from a BMP280
- Serial output and logging on a microcontrollerdefmt, RTT, and why not println!
- Async tasks on a microcontrollerembassy, and several things at once
- Sleep, wake, and battery lifelow-power modes and the current you actually measure
Where the code lives
Section titled “Where the code lives”embedded-stm32/ in the examples repository —
one cargo project, one tag per article.