What you need to start embedded Rust
Step 1 of 10, and the only one that happens away from the keyboard. This article is a shopping list: the board, the probe that flashes it, the sensor the track reads later, and the cables in between. Everything after it is software. The end of the track is firmware on real hardware — an LED on a timer, a button that wakes the chip from sleep, a temperature reading off an I2C sensor — and this step buys what all of that runs on.
What the track builds
Section titled “What the track builds”One board, ten steps, one growing cargo project. In order:
| # | Article | What lands |
|---|---|---|
| 2 | Setting up the embedded toolchain | the target triple, probe-rs, and the first flash |
| 3 | Blinking an LED | embedded-hal, cortex-m, and a blinking LED |
| 4 | Understanding no_std | no allocator, no panic message, no libc |
| 5 | Reading a button with GPIO input | pull-ups, debounce, polling versus interrupts |
| 6 | PWM and controlling brightness | timers and duty cycle |
| 7 | Talking to an I2C sensor | temperature and pressure from a BMP280 |
| 8 | Serial output and logging on a microcontroller | defmt, RTT, and why not println! |
| 9 | Async tasks on a microcontroller | embassy, and several things at once |
| 10 | Sleep, wake, and battery life | low-power modes, and the current you actually measure |
The shape of it: step 2 puts the toolchain on the machine and proves the board works. Steps 3–6 are the GPIO work — output, input, timers. Step 7 adds the first real sensor. Step 8 gives the firmware a way to talk back. Steps 9–10 are where embedded gets interesting: concurrent tasks without an RTOS, and a chip that sleeps between events. Every step’s Rust is written and verified against rustc 1.99.0 with edition 2024, the same compiler and edition the rest of this site uses.
The board: NUCLEO-F401RE
Section titled “The board: NUCLEO-F401RE”ST’s own development board, and the one this track’s code assumes. The chip is an STM32F401RET6: a Cortex-M4 with an FPU at 84 MHz, 512 KB of flash, 96 KB of SRAM, in an LQFP64 package. Modest by desktop standards, and far more than a blinking LED needs.
What makes it the right first board is what is soldered around the chip:
- The debug probe is built in. An ST-LINK/V2-1 sits on the same board. This is the part newcomers don’t know they need until the first flash fails, and the Nucleo is the cheapest way to own one without buying a separate box.
- A user LED and a user button. The LED (LD2) is on PA5, the button (B1) on PC13 — both wired already. Step 3 blinks the LED; step 5 reads the button. No wiring needed for either.
- Arduino Uno V3 headers plus the full ST morpho rows. The I2C1 pins (SCL on PB8, SDA on PB9) sit on the Arduino connector, which is where the sensor plugs in at step 7. The morpho rows break out every remaining STM32 pin for later projects.
- A virtual COM port. The same ST-Link exposes USART2 (PA2/PA3) as a serial port on the PC, so step 8’s serial output needs no extra adapter.
Price: $18.55 at ST’s own store, budgetary $19.00 at quantity one, about $25 from marketplace sellers. One detail worth knowing: a switch on the board lets its ST-Link program other boards. Buy a bare board later and this one becomes its probe.
The probe, and why there is no way around it
Section titled “The probe, and why there is no way around it”A debug probe is not optional, and it is not a burner. It talks SWD — two data pins (SWDIO, SWCLK), plus power and ground — and it does three things: it flashes the chip, it stops the chip at a breakpoint and reads memory, and it carries RTT, the log stream step 8 uses. A USB cable cannot do any of that; the STM32 has no bootloader that speaks USB out of the box.
The Nucleo route above means you already own the probe. If you arrive with a bare board instead, the cheapest thing that works is an ST-Link V2 clone: about $9 on Amazon, a few yuan on 1688 and AliExpress. ST’s official ST-LINK/V2 lists at $25.65. probe-rs, which step 2 installs, talks to ST-Link clones and CMSIS-DAP boards alike, so the cheap probe is not a compromise for anything this track does.
The sensor: a BMP280 breakout
Section titled “The sensor: a BMP280 breakout”Step 7 reads temperature and barometric pressure from a Bosch BMP280 over I2C. The chip itself is a 2 mm square, so what you buy is a breakout: the sensor on a small board with a regulator, level shifting, and pins on a 2.54 mm pitch. Two good options:
- Adafruit’s BMP280 breakout — about $10, assembled, with headers already soldered and a well-documented pinout.
- The generic GY-BMP280 module — about €3 from EU shops, a couple of dollars on AliExpress. Same chip, same regulator, usually without headers soldered.
Either works. The regulator and level shifting matter: the F401’s I/O runs at 3.3 V, and a module that expects 5 V logic would need extra parts. One thing to check before step 7: modules differ on the I2C address — 0x76 and 0x77 both exist in the wild, set by a pad or a solder bridge — and step 7 starts by proving which one answers.
The cables and the small stuff
Section titled “The cables and the small stuff”- A USB cable, mini-B on the board end. The Nucleo’s ST-Link connector is mini-USB, the old phone-cable shape; USB-C and micro-B cables will not fit it.
- Female-to-female Dupont jumper wires. A 40-pack costs a few euros. Four of them — 3.3 V, GND, SCL, SDA — connect the sensor to the Arduino headers with no soldering.
- A multimeter — but not yet. Step 10 measures sleep current in microamps and needs one. Nothing before it does, so this can wait; that article covers what to look for on the dial.
The budget alternative: Black Pill and a Mini Debugger
Section titled “The budget alternative: Black Pill and a Mini Debugger”If $19 for a board feels steep, the WeAct BlackPill STM32F411CEU6 runs about $5 from WeAct’s own AliExpress store: a Cortex-M4F at 100 MHz with 512 KB of flash and 128 KB of SRAM — more RAM than the Nucleo, for a quarter of the price. What it doesn’t have is the probe, a user button, or a serial port. WeAct’s Mini Debugger, about $1–5, is a small board that covers the probe and adds a USB-to-UART port. Together, about $6–10 for everything the Nucleo does except the built-in convenience.
The catch is the code. This track names the Nucleo’s pins — PA5 for the LED, PC13 for the button, PB8/PB9 for I2C — and every printed output assumes that layout. On a Black Pill the LED and button sit on different pins, so you’ll be translating as you go. The Nucleo is the path where nothing needs translating; the Black Pill is the path for someone who already knows which pin is which.
What you don’t need
Section titled “What you don’t need”- No JTAG adapter. SWD is two data pins plus power and ground, and the Nucleo’s ST-Link speaks it.
- No external power supply. USB VBUS runs the board and the sensor together.
- No soldering — if you buy the assembled Adafruit sensor. Generic BMP280 modules usually need headers soldered on first.
- No Windows and no CubeIDE. probe-rs and cargo run the same on macOS, Linux, and Windows. The commands in this track are written on a Mac, but nothing after step 2 is platform-specific.
What the board is not: a low-power specialist. The F4’s sleep modes are real and step 10 measures them, but the STM32L series exists precisely because it sleeps harder. For a first track that is the right trade — the F401RE is the boring, well-documented middle.
What you need to know first
Section titled “What you need to know first”This track does not teach Rust. It assumes:
- Structs, enums, and pattern matching — register access in a HAL is
enums and
matchall the way down. - Traits and generics — the HAL’s peripherals are traits, and step 3 starts by implementing one.
- Concurrency and async — step 9’s Embassy tasks are async functions.
No embedded experience, and no C. A laptop with a free USB port is the rest of the hardware; the software toolchain is step 2’s job.
Where the code lives
Section titled “Where the code lives”From step 2 onward the project lives in embedded-stm32/ in
the examples repository, with one commit
and one tag per article, so you can check out any step and diff it against your own tree.
This article commits nothing — the first tag, stm32-ch02, lands with the toolchain
step, article 2.
Step 2 installs the software: the thumbv7em-none-eabihf target, probe-rs, and the
first program flashed onto the board. The track overview
keeps the full list current as articles land.