Chapter 3: The STM32 Family
You have decided to use an STM32. Good choice — you are now part of the largest 32-bit microcontroller ecosystem on the planet. But with over 1,000 part numbers across a dozen families, choosing the right chip can feel overwhelming. This chapter is your map.
Why STM32?
STMicroelectronics ships over 2 billion STM32 units per year. That scale matters because it means:
- Price: 50-500 INR per chip, even in single quantities
- Availability: stocked by every major distributor, always in production
- Consistent API: learn the peripheral registers on one STM32 and they are nearly identical across the entire lineup
- Documentation: the best datasheets and reference manuals in the industry, all free
- Community: the largest ecosystem of libraries, forums, tutorials, and example code for any MCU family
- Embassy support: first-class async Rust support with
embassy-stm32
Fun Fact: STM32 chips are inside products from Samsung, Dyson, DJI, Tesla, GoPro, and thousands of other companies. When you learn STM32, you are learning the same platform that professional engineers use in shipping products.
The Naming System: Decoding a Part Number
Every STM32 part number tells you exactly what the chip is. Let us decode STM32H743VIT6:
| Segment | Value | Meaning |
|---|---|---|
| STM32 | STM32 | STMicroelectronics 32-bit MCU |
| H | H | Family: High Performance |
| 7 | 7 | Series: Cortex-M7, 480 MHz |
| 43 | 43 | Sub-family: full peripheral set |
| V | V | Pin count: 100 pins (LQFP100) |
| I | I | Flash size: 2 MB |
| T | T | Package: LQFP (Thin Quad Flat Pack) |
| 6 | 6 | Temperature range: -40 to +85 C (industrial) |
Common pin count codes: C = 48 pins, R = 64 pins, V = 100 pins, Z = 144 pins, A = 169 pins.
Common Flash size codes: 8 = 64 KB, B = 128 KB, C = 256 KB, E = 512 KB, G = 1 MB, I = 2 MB.
Once you learn this system, you can glance at any STM32 part number and immediately know its class, capabilities, and package.
Think About It: If you see STM32F411CEU6, what can you tell? F4 family (Cortex-M4F), 11 series, 48-pin count (C), 512 KB Flash (E), UFQFPN package (U), industrial temperature (6). That is the "Black Pill" — the board we recommend for starting out.
The Complete Series Guide
Entry-Level: When Simple Is Enough
| Family | Core | Max Clock | Flash | RAM | Price Range | Best For |
|---|---|---|---|---|---|---|
| F0 | Cortex-M0 | 48 MHz | 16-256 KB | 4-32 KB | 50-150 INR | Simple control, cost-sensitive |
| G0 | Cortex-M0+ | 64 MHz | 16-512 KB | 8-144 KB | 50-150 INR | Modern F0 replacement, better peripherals |
| L0 | Cortex-M0+ | 32 MHz | 8-192 KB | 2-20 KB | 60-180 INR | Ultra-low-power battery devices |
These are the chips you use when you need to toggle a relay, read a temperature sensor, or drive a simple display — and you need to do it for the absolute minimum cost. No FPU, modest resources, but often all you need.
The G0 is the modern pick in this category. It has USB-C support, better ADCs, and more RAM than the aging F0, at the same price.
Mainstream: The Sweet Spot
| Family | Core | Max Clock | Flash | RAM | Price Range | Best For |
|---|---|---|---|---|---|---|
| F1 | Cortex-M3 | 72 MHz | 16 KB - 1 MB | 6-96 KB | 80-250 INR | Legacy designs, huge code base |
| F3 | Cortex-M4F | 72 MHz | 16-512 KB | 16-80 KB | 100-300 INR | Mixed-signal, motor control |
| G4 | Cortex-M4F | 170 MHz | 32 KB - 1 MB | 16-128 KB | 120-350 INR | Modern F3 replacement, math-heavy |
The F1 is the granddaddy — the original STM32 from 2007. Millions of designs use it. It lacks an FPU but remains popular for simple applications.
The G4 is the modern choice here. At 170 MHz with an FPU, DSP instructions, hardware math accelerators (CORDIC and FMAC), and advanced timers, it is a powerhouse for motor control, power conversion, and signal processing.
Workhorse: The One Everyone Knows
| Family | Core | Max Clock | Flash | RAM | Price Range | Best For |
|---|---|---|---|---|---|---|
| F4 | Cortex-M4F | 100-180 MHz | 64 KB - 2 MB | 64-384 KB | 150-400 INR | General purpose, learning, prototyping |
The STM32F4 is the most popular STM32 family. Period. It is fast enough for most applications, cheap enough for hobby projects, and has the largest collection of tutorials, libraries, and community support.
The STM32F411 "Black Pill" board — available for under 300 INR on AliExpress — is our recommended starting board. It runs at 100 MHz, has 512 KB Flash, 128 KB RAM, and enough peripherals for anything a beginner will encounter.
Fun Fact: The STM32F4 was used in the original PX4 flight controller for drones. Many open-source autopilot designs still use it today.
High Performance: When You Need Speed
| Family | Core | Max Clock | Flash | RAM | Price Range | Best For |
|---|---|---|---|---|---|---|
| F7 | Cortex-M7 | 216 MHz | 64 KB - 2 MB | 64-512 KB | 300-600 INR | Graphics, networking, complex DSP |
| H7 | Cortex-M7 | 480 MHz | 128 KB - 2 MB | 128 KB - 1 MB | 350-800 INR | Maximum performance, dual-core |
| H5 | Cortex-M33 | 250 MHz | 128 KB - 2 MB | 256-640 KB | 250-500 INR | Modern high-perf with TrustZone |
The H7 is the flagship. At 480 MHz with double-precision FPU, L1 cache, and up to 1 MB of RAM, it can run a graphical user interface, process audio in real time, or serve as the brain of a robot — all without an operating system.
Some H7 variants are dual-core, with a Cortex-M7 and a Cortex-M4 on the same chip. The M7 handles heavy processing while the M4 manages real-time I/O.
Ultra-Low-Power: Years on a Battery
| Family | Core | Max Clock | Flash | RAM | Price Range | Best For |
|---|---|---|---|---|---|---|
| L4 | Cortex-M4F | 80 MHz | 64 KB - 1 MB | 40-320 KB | 150-400 INR | Battery sensors, wearables, IoT |
| U5 | Cortex-M33 | 160 MHz | 256 KB - 4 MB | 256-2560 KB | 200-500 INR | Next-gen ultra-low-power, TrustZone |
The L4 draws as little as 33 nA in shutdown mode. At that current, a CR2032 coin cell battery (230 mAh) would last over 800 years in standby. In practice, an L4-based sensor node that wakes every few minutes to take a measurement and go back to sleep can run for 5-10 years on a single battery.
The U5 is the modern successor with the Cortex-M33 core, TrustZone security, and even more RAM. It is ideal for secure IoT applications.
Wireless: Built-In Radio
| Family | Core | Radio | Best For |
|---|---|---|---|
| WB | Cortex-M4F + M0+ | Bluetooth 5.0, Zigbee, Thread | Short-range wireless, mesh networks |
| WL | Cortex-M4 + M0+ | LoRa, Sigfox | Long-range (km) low-power IoT |
The WB series has a full Bluetooth 5.0 stack running on the M0+ core while your application runs on the M4F. No external radio module needed.
The WL series integrates a LoRa radio — capable of communication over several kilometers at extremely low power. Perfect for agricultural sensors, city infrastructure, and remote monitoring.
Choosing the Right Chip
If you are staring at this table wondering where to start, here is a simple decision matrix:
| Your Situation | Choose This |
|---|---|
| Learning embedded for the first time | STM32F411 (Black Pill) |
| Cost-sensitive production design | STM32G030 or STM32G070 |
| Battery-powered IoT sensor | STM32L476 or STM32U575 |
| Motor control or power electronics | STM32G431 |
| Graphics, audio, or heavy DSP | STM32H743 |
| Bluetooth or Zigbee needed | STM32WB55 |
| Long-range wireless (LoRa) | STM32WL55 |
| Maximum security (TrustZone) | STM32U575 or STM32H563 |
Think About It: The "best" chip is not the most powerful one — it is the cheapest one that meets your requirements. A $0.50 G0 running a simple thermostat is a better engineering decision than a $5 H7 doing the same job.
STM32H743: A Closer Look
Let us spotlight the STM32H743 to see what a high-end STM32 offers:
- CPU: ARM Cortex-M7 at 480 MHz with double-precision FPU
- Flash: 2 MB (dual-bank, allowing read-while-write)
- RAM: 1 MB total (including 128 KB DTCM at zero wait states)
- Instruction/Data cache: 16 KB each (L1 cache, just like a desktop CPU)
- ADC: 3x 16-bit ADCs at 3.6 Msps (mega-samples per second)
- DAC: 2x 12-bit DACs
- Timers: 22 timers including advanced motor control timers
- Communication: 4x UART, 6x SPI, 4x I2C, USB OTG HS, 2x CAN-FD, Ethernet MAC
- DMA: 2x DMA controllers with 16 streams each, plus MDMA and BDMA
- Other: JPEG codec, Chrom-ART GPU, true random number generator, CRC hardware, AES/DES crypto accelerator
This is a staggering amount of hardware for a chip that costs under 800 INR. For perspective, this single chip has more processing power and more peripherals than the entire computer that guided Apollo 11 to the moon.
Cross-Series Development with Embassy
This is where the STM32 + Embassy combination truly shines. Moving your code from one STM32 family to another requires changing three things:
- The chip feature in
Cargo.toml - The compilation target
- The pin names (because different packages have different pinouts)
The logic stays the same.
// This blink code works on ANY STM32 — just change the pin name #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_stm32::init(Default::default()); // On Black Pill F411: PC13 // On Nucleo F446RE: PA5 // On Nucleo H743ZI: PB0 let mut led = Output::new(p.PC13, Level::High, Speed::Low); loop { led.toggle(); Timer::after_millis(500).await; } }
And in Cargo.toml:
# For STM32F411:
embassy-stm32 = { version = "0.1", features = ["stm32f411ce", "time-driver-any"] }
# target: thumbv7em-none-eabihf
# For STM32H743:
# embassy-stm32 = { version = "0.1", features = ["stm32h743vi", "time-driver-any"] }
# target: thumbv7em-none-eabihf
# For STM32G030:
# embassy-stm32 = { version = "0.1", features = ["stm32g030f6", "time-driver-any"] }
# target: thumbv6m-none-eabi
Notice how the Embassy API is identical. Output::new, led.toggle(), Timer::after_millis — these work across all STM32 families. The Embassy HAL (Hardware Abstraction Layer) translates your intent into the correct register writes for whichever chip you are targeting.
The Reference Manual: Your 3,300-Page Best Friend
Every STM32 family has a Reference Manual (RM) published by STMicroelectronics. The H7's reference manual, RM0433, is over 3,300 pages long.
Do not try to read it cover to cover. Use it as a reference:
- Need to configure the ADC? Search for "ADC" in the PDF and read that chapter.
- Timer not behaving? Check the timer register descriptions.
- Weird peripheral behavior? The RM has timing diagrams, state machines, and detailed explanations for every peripheral.
The reference manual is the ultimate source of truth. Tutorials, Stack Overflow answers, and blog posts can be wrong or outdated. The RM is written by the engineers who designed the silicon. Bookmark it. You will reference it hundreds of times.
Fun Fact: The RM0433 for the STM32H7 series, if printed, would be a stack of paper about 40 cm tall. Nobody has read all 3,300 pages. But everyone has read the 50 pages that matter for their project.
Summary
The STM32 family spans from ultra-cheap entry-level chips to 480 MHz dual-core powerhouses, all sharing a consistent peripheral API and supported by Embassy's unified Rust HAL. The naming system tells you everything about a chip at a glance. For learning, start with the STM32F411 Black Pill. For production, choose the cheapest chip that meets your requirements.
The reference manual is your most important resource. It is enormous, but you only need to read the chapters relevant to the peripherals you are using. Treat it like a dictionary, not a novel.
In the next chapter, we will set up the Rust embedded development environment and get your first program running on real hardware.