If you can blink an LED on an Arduino, you're one Saturday afternoon away from your first STM32 build. STM32 is STMicroelectronics' family of 32-bit Arm Cortex-M microcontrollers — the chips inside 3D printers, flight controllers and half the smart gadgets you own. Hobbyists reach them through tiny $5–10 breakout boards, and the two you'll see everywhere are the Blue Pill and the Black Pill. New to STM32 as a whole? Our STM32 for beginners guide is the ground-floor orientation — this page is the hands-on walkthrough.
Why bother, when an Arduino Nano already works? An Arduino Nano's ATmega328 runs at 16 MHz with 2 KB of RAM. The STM32F103 chip on a Blue Pill runs at 72 MHz with 20 KB of RAM and 64 KB of flash — about 4.5× the clock and 10× the memory, for less money. The practical difference isn't just speed: it's that serious DIY instruments become possible on a $5 board, and by the end of this guide you'll have the toolchain to build one — a $6 oscilloscope — yourself.

What to buy for your first Blue Pill build
Blue Pill (STM32F103C8): the $5 classic
The Blue Pill is a small (22 × 53 mm) board built around the STM32F103C8: an Arm Cortex-M3 core at 72 MHz, 64 KB of flash for your program, 20 KB of RAM, and a full-speed USB port. Per ST's datasheet — see our STM32F103C8 Blue Pill part page for the full specs. Real-world price is about $4.20 per board in a 3-pack, or around $9 for a single board with the header pins pre-soldered (our parts research, listings re-checked 2026-11-27; our Blue Pill part page carries the same research asOf 2026-10-16).
Every STM32 oscilloscope project on this site that says "Blue Pill" uses this exact board, which is exactly why it's our default recommendation: the tutorials, wiring diagrams and firmware all match.
Black Pill (STM32F401/F411): the better-muscled sibling
The Black Pill looks nearly identical but carries a newer chip. The variant in our catalog, the STM32F401/F411 Black Pill, uses a Cortex-M4 core with an FPU — a floating-point unit, meaning math with decimal numbers runs at full speed instead of in slow software. The F401CC variant runs at up to 84 MHz with 256 KB of flash and 64 KB of RAM; many Black Pills sold today instead carry the F411, which runs at 100 MHz with 512 KB of flash (specs per the respective ST datasheets). Prices sit in the same ballpark as a Blue Pill from the same sellers.
Buy the Black Pill if you know you'll grow into it — its extra memory and FPU matter for signal processing — or if your first target project runs on it (one of our three scope picks below does).
Clones and fake chips: what you'll actually receive
Honesty first: there is no "official" Blue Pill. ST never made these boards — they have always been made by third parties, so every unit ever sold is technically a clone and build quality varies (this is documented on our own EMBO parts page, checked 2026-11-27). Most boards carry either a genuine-spec STM32 or an equivalent workalike chip, and in practice most of them work fine.
The reliable way to tell what you got is the debug TAP ID — the identification number a debug probe reads back from the chip's test hardware. A genuine STM32F103 reports 0x1BA01477; common clone chips such as the CS32F103 and CH32F103 report 0x2BA01477. (This identification method is documented in Hackaday's STM32-clone coverage from October 2020 and community fake-board guides.) The CS32 is a useful data point on both sides: it runs Arduino sketches happily but trips OpenOCD — the open-source debugging software many toolchains use — on its default STM32F1 profile. Also worth knowing: the GD32F103 is a workalike sold openly under its own brand, not a counterfeit.
Practical takeaway: don't pay extra for listings that promise "genuine ST" chips, buy from a listing with recent reviews, and check the TAP ID when the board arrives (Path A below shows you exactly where it appears).
ST-Link V2 or USB-serial adapter?
To load software onto the board you need one small gadget — and this is where a common beginner stall happens, so here's the direct answer: buy an ST-Link V2 clone. They cost roughly $1.5–4 from the usual AliExpress sellers (listings checked 2026-11-27; ST's official dongle lists around $21–25 and you don't need it). An ST-Link is an Arm SWD debug probe: one device that programs the chip, powers the board, and — with the right software — lets you debug running code. It's also what our scope-project tutorials use.
The alternative is a USB-serial adapter (CP2102-class, about $7–10 on Amazon, listings checked 2026-11-27, e.g. HiLetgo at $7.39). You'd only start here if you already own one — and it stays useful later as a serial console for debugging. Either device covers everything in this guide.
The shopping list
| Item | Rough price | Notes |
|---|---|---|
| Blue Pill (STM32F103C8) | ~$4.20 (3-pack) – ~$9 pre-soldered | the default pick (checked 2026-11-27) |
| Black Pill (STM32F401/F411) | about the same | optional, if your target project uses it |
| ST-Link programmer (V2 clone) | ~$1.5–4 | the recommended pick (checked 2026-11-27) |
| USB-serial adapter (CP2102-class) | ~$7–10 | only if you already own one (checked 2026-11-27) |
| Dupont jumper wires (female–female) | a few dollars | 4 wires for flashing; a breadboard helps later |
A board plus an ST-Link comes to roughly $6–8 before shipping — derived by adding the dated listing prices above, and worth re-checking on the day you buy.
First flash: two ways to put code on the board
"Flashing" means copying firmware — the compiled program that runs on the chip — onto the microcontroller's flash memory. There are two standard ways to do it on a Pill, and you should understand both: the first is the one you'll use daily, the second is the one that rescues you when the first isn't available.
Path A (recommended): ST-Link V2 over SWD
SWD — Serial Wire Debug — is the two-wire interface Arm chips use for programming and debugging: one data line (SWDIO), one clock line (SWCLK). It's how the ST-Link talks to the board.
Wiring (four female–female jumpers, ST-Link end → Blue Pill end):
SWDIO → pin PA13
SWCLK → pin PA14
GND → any GND
3.3V → the pin marked 3V3 (the ST-Link powers the board)
Leave the BOOT0 jumper (the little jumper near the reset button) set to 0 — that's its normal position and means "run my firmware".

Then, on your computer:
Install STM32CubeProgrammer — ST's free, official flashing tool (stm32.com, registration required).
Plug the ST-Link into USB. Open STM32CubeProgrammer, and on the right set Port: SWD, then click Connect.
Read what appears next to the chip name: STM32CubeProgrammer reports the device ID and, in the log, the debug TAP ID. This is the clone check from earlier —
0x1BA01477means a genuine-spec STM32F103;0x2BA01477means a CS32/CH32 workalike (which usually still works fine — see above).Click Open file, pick your compiled firmware (
.hex,.elfor.bin— whatever your toolchain produced), then Start Programming.When it finishes, press the board's reset button. Your firmware is running.
Path B: USB-serial and the built-in bootloader
Every STM32 leaves the factory with a bootloader burned into ROM — a tiny built-in program that can receive new firmware over a serial connection, no debug probe needed. You activate it with the BOOT0 jumper: it tells the chip "load the bootloader first" instead of "run my firmware".
Wiring (USB-serial adapter set to 3.3 V logic — check the jumper or switch on the adapter before connecting):
Adapter TX → board pin PA10 (the board's receive line)
Adapter RX → board pin PA9 (the board's transmit line)
Adapter GND → board GND
Note that TX and RX are crossed — a serial link connects each side's transmitter to the other side's receiver. Uncrossed TX/RX is the single most common reason this path fails.

Then:
Move the BOOT0 jumper to 1, then power the board (plug it in, or press reset if it's already powered).
The chip now waits in its ROM bootloader. Flash with the same STM32CubeProgrammer (choose Port: the adapter's COM port / UART, baud 115200) or the open-source
stm32flashcommand-line tool.Move BOOT0 back to 0 and press reset — the board now runs what you just flashed.
One caveat from the community: some clone chips reportedly ship without the working serial bootloader — one more reason the ST-Link is our default path.
If it doesn't work: the three usual suspects
BOOT0 in the wrong position — must be 0 for Path A and normal running, 1 only while serial-flashing.
TX/RX not crossed on the serial path (adapter TX goes to the board's RX, PA10).
A clone chip with an odd TAP ID — check the ID as in Path A step 3; a board that refuses to talk at all may need a slower SWD clock setting, and a frankly fake chip is a return-the-board situation.
Programming it: STM32duino (Arduino IDE) or PlatformIO?
Two toolchains cover most hobby STM32 work, and both are free. STM32duino is ST's official board package for the Arduino IDE; PlatformIO is an extension for Visual Studio Code. Here's the honest comparison:
| STM32duino (Arduino IDE) | PlatformIO (VS Code) | |
|---|---|---|
| Setup friction | Low if you know the Arduino IDE: add the STM32 board package in Boards Manager and you're compiling in minutes | Steeper first hour: install VS Code, the extension, and learn its project model |
| Libraries | The entire Arduino library ecosystem, plus the core's own USB-serial and CAN examples | Same libraries, with cleaner dependency management (versions pinned per project) |
| Debug support | None for STM32 — your ST-Link is flash-only in the Arduino IDE | Built-in SWD debugging with the ST-Link: breakpoints, variable watch, step-through |

Our verdict for a beginner: start with STM32duino if the Arduino IDE is already familiar — zero new concepts, and everything below works. Move to PlatformIO when a project grows: its dependency handling and real debugger pay off, and it's what you'll see in more advanced builds. Our own scope projects use both worlds: STM32-O-Scope was written for the classic Roger Clark STM32duino core (the community predecessor of ST's official package), pillScope Plus runs on STM32CubeIDE or PlatformIO, and EMBO needs neither (you flash its ready-made firmware). Check each project's tutorial for its exact toolchain.
Your first blink sketch
This is the complete sketch — the on-board LED on a Blue Pill sits on pin PC13 and is active-low (writing LOW turns it on). LED_BUILTIN is defined as PC13 by the board package, so the sketch ports to other STM32duino boards unchanged.
// Blink — STM32 "Blue Pill" (STM32F103C8), STM32duino core.
// PC13 has the on-board LED and is active-low (LOW = LED on).
// LED_BUILTIN is defined as PC13 by the bluepill_f103c8 board variant,
// so this sketch also compiles unchanged on other STM32duino boards.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, LOW); // LED on
delay(500);
digitalWrite(LED_BUILTIN, HIGH); // LED off
delay(500);
}
In the Arduino IDE: install the STM32 board package (Boards Manager → search "STM32" by STMicroelectronics), select Generic STM32F1 series → Blue Pill F103C8, pick your ST-Link as the programmer, and click Upload. Methodology note: we compile-verified this exact sketch on 2026-11-19 with PlatformIO's CI builder (board bluepill_f103c8, Arduino framework) on our desk — it compiles clean to 9,412 bytes of flash (14% of the chip) and 852 bytes of RAM (4%), measured from the build output.
What changed vs Arduino
Coming from an AVR Arduino, four things actually bite:
3.3 V logic, not 5 V. Inputs and outputs work at 3.3 V. Some pins tolerate 5 V (marked "FT" in the datasheet), but assume 3.3 V until you check.
Pin names are port-based. Pins are PA0–PA15, PB0–PB15, PC13… — "PC13" is port C, pin 13. The names are printed on the board.
analogWrite()isn't always PWM. On the F1, pins that have a DAC produce a true analog voltage instead of the PWM you'd expect from Arduino — check the pin's capabilities if you specifically need PWM.Serial goes through USB or a UART pin.
Serialmaps to the chip's UART pins (PA9/PA10 — the same pins as Path B); USB serial needs the core's USB support enabled. This is the #1 "where's my Serial Monitor output?" cause.
Your first build: from blink to a $6 oscilloscope
You now have a working toolchain and a board that blinks. Point it at something useful — the same $5 board is a full instrument. (The "$6" is our EMBO parts research: board plus the bits that scope build needs, re-checked 2026-11-27.)
Fastest first scope: STM32-O-Scope — a minimalist oscilloscope on the very Blue Pill you just blinked, built from the Arduino IDE (its tutorial pins the exact STM32duino core it wants). The quickest path from here to a working instrument.
The upgrade path: EMBO multi-instrument scope — the Blue Pill becomes a USB-connected oscilloscope, logic analyzer, voltmeter and signal generator, controlled from a PC app. Ready-made firmware means no toolchain at all — flash it with Path A. (Honest note from our review: the project has been dormant since 2021; it works, just go in knowing.)
The Black Pill path: pillScope Plus — a self-contained educational oscilloscope on the STM32F401 Black Pill from the buying section above, with its own colour display and on-screen measurements. The maintained, build-it-as-a-tool option.
Whatever you pick next, the board you already own does the job. Browse all STM32 projects and boards for the full list.