STM32 Blue Pill
The cheapest way into ARM Cortex-M3
STM32 Blue Pill · STM32F103C8T6
A cheap breadboard STM32: a 72 MHz Cortex-M3 (STM32F103C8T6) with 64 KB flash and 20 KB SRAM, 32 I/O on two headers, two 12-bit ADCs, four timers, three USARTs, two I2C, two SPI and USB, at 3.3 V with many 5 V-tolerant inputs.
- CPU
- Cortex-M3 72 MHz
- GPIO
- 32
- Flash / SRAM
- 64 KB / 20 KB
- ADC
- 10 × 12-bit
Every header pin at a glance
- 24 safe I/O
- 6 use with care
- 2 avoid
- 0 not available
- 8 power, ground & other
01Pinout
Every pin, live
Port names as used in code (PA9, PB12); the silkscreen drops the P.
40 of 40 pins match
Hover or tap any pin on the board
LEFT header · pin 1
PB12
Safe to use
Nothing else on the board depends on this pin. A good first choice for sensors, LEDs and buttons.
Can be used as
- SPI (direct)
Signals on this pad
- PB12
- SPI2_NSS
- TIM1_BKIN
Full header tables (LEFT, RIGHT)
LEFT · left side
| No. | Pin | Signals | Status |
|---|---|---|---|
| 1 | PB12 | SPI2_NSS, TIM1_BKIN | OK |
| 2 | PB13 | SPI2_SCK, TIM1_CH1N | OK |
| 3 | PB14 | SPI2_MISO, TIM1_CH2N | OK |
| 4 | PB15 | SPI2_MOSI, TIM1_CH3N | OK |
| 5 | PA8 | TIM1_CH1, MCO | OK |
| 6 | PA9 | USART1_TX, TIM1_CH2 | OK |
| 7 | PA10 | USART1_RX, TIM1_CH3 | OK |
| 8 | PA11 | USB_DM, CAN_RX, TIM1_CH4 | Caution |
| 9 | PA12 | USB_DP, CAN_TX | Caution |
| 10 | PA15 | JTDI, SPI1_NSS (remap), TIM2_CH1 (remap) | Caution |
| 11 | PB3 | JTDO, SPI1_SCK (remap), TIM2_CH2 (remap) | Caution |
| 12 | PB4 | NJTRST, SPI1_MISO (remap), TIM3_CH1 (remap) | Caution |
| 13 | PB5 | SPI1_MOSI (remap), TIM3_CH2 (remap) | OK |
| 14 | PB6 | I2C1_SCL, TIM4_CH1, USART1_TX (remap) | OK |
| 15 | PB7 | I2C1_SDA, TIM4_CH2, USART1_RX (remap) | OK |
| 16 | PB8 | TIM4_CH3, I2C1_SCL (remap), CAN_RX (remap) | OK |
| 17 | PB9 | TIM4_CH4, I2C1_SDA (remap), CAN_TX (remap) | OK |
| 18 | 5V | USB 5 V, or a 5 V input to the on-board 3.3 V regulator. | |
| 19 | GND | Ground | |
| 20 | 3V3 | 3.3 V from the on-board regulator, or a regulated 3.3 V input. |
RIGHT · right side
| No. | Pin | Signals | Status |
|---|---|---|---|
| 1 | GND | Ground | |
| 2 | GND | Ground | |
| 3 | 3V3 | 3.3 V from the on-board regulator, or a regulated 3.3 V input. | |
| 4 | RST | Pull LOW to reset, the same as the reset button. | |
| 5 | PB11 | I2C2_SDA, USART3_RX | OK |
| 6 | PB10 | I2C2_SCL, USART3_TX | OK |
| 7 | PB1 | ADC12_IN9, TIM3_CH4 | OK |
| 8 | PB0 | ADC12_IN8, TIM3_CH3 | OK |
| 9 | PA7 | ADC12_IN7, SPI1_MOSI, TIM3_CH2 | OK |
| 10 | PA6 | ADC12_IN6, SPI1_MISO, TIM3_CH1 | OK |
| 11 | PA5 | ADC12_IN5, SPI1_SCK | OK |
| 12 | PA4 | ADC12_IN4, SPI1_NSS | OK |
| 13 | PA3 | ADC12_IN3, USART2_RX, TIM2_CH4 | OK |
| 14 | PA2 | ADC12_IN2, USART2_TX, TIM2_CH3 | OK |
| 15 | PA1 | ADC12_IN1, TIM2_CH2, USART2_RTS | OK |
| 16 | PA0 | ADC12_IN0, TIM2_CH1, WKUP | OK |
| 17 | PC15 | OSC32_OUT | Avoid |
| 18 | PC14 | OSC32_IN | Avoid |
| 19 | PC13 | LED, TAMPER-RTC | Caution |
| 20 | VBAT | Backup supply for the RTC. Tie to 3.3 V or a coin cell. |
02Safety
Pins to avoid, and why
The crystal pins are taken, and a few more come with a catch.
Avoid
2 pins
Wired to something on the board. Leave them alone.
- PC1432.768 kHz crystal. Wired to the RTC crystal on the board. It's also a weak pin (about 3 mA, slow).
- PC1532.768 kHz crystal. Wired to the RTC crystal on the board. It's also a weak pin (about 3 mA, slow).
Use with care
6 pins
Usable with a catch: USB, JTAG at reset, or a weak pin.
- PA11USB D−. Wired to the micro-USB port. Leave it free if you use USB.
- PA12USB D+. Wired to the micro-USB port and its pull-up resistor. Leave it free if you use USB.
- PA15JTAG at reset. Starts up as a JTAG debug pin. Disable JTAG and keep SWD (CubeMX: Debug → Serial Wire) before using it as GPIO.
- PB3JTAG at reset. Starts up as a JTAG debug pin. Disable JTAG and keep SWD (CubeMX: Debug → Serial Wire) before using it as GPIO.
- PB4JTAG at reset. Starts up as a JTAG debug pin. Disable JTAG and keep SWD (CubeMX: Debug → Serial Wire) before using it as GPIO.
- PC13Weak pin + LED. Sinks only about 3 mA and switches slowly; it also drives the on-board LED. Fine for blinking, not for loads.
03Specs
Full specifications
Microcontroller
- Chip
- STM32F103C8T6Arm Cortex-M3, 72 MHz, no FPU.
- Flash / SRAM
- 64 KB / 20 KB
- Clocks
- 8 MHz crystal + 32.768 kHz RTC crystal
Power
- Logic level
- 3.3 VFT pins tolerate 5 V inputs; PA0–PA7, PB0 and PB1 do not.
- Inputs
- Micro-USB 5 V, 5V pin or 3.3 V pin
Peripherals
- ADC
- 2 × 12-bit, 10 channelsPA0–PA7, PB0, PB1.
- Timers / PWM
- TIM1–TIM4, 4 channels each
- Buses
- 3 USART, 2 I2C, 2 SPI, USB, CANUSB and CAN can't run together.
Board
- Programming
- SWD header, serial bootloader or USB bootloader
- Boot jumpers
- BOOT0 and BOOT1 (PB2)
- User LED
- PC13, active LOW
04Buses
Where each bus lives
USART
USART1 PA9/PA10 (5 V tolerant, also the serial bootloader), USART2 PA2/PA3, USART3 PB10/PB11 (shared with I2C2).
I2C
I2C1 on PB6 (SCL) / PB7 (SDA), remappable to PB8/PB9. I2C2 on PB10/PB11.
SPI
SPI1 on PA5 (SCK), PA6 (MISO), PA7 (MOSI), PA4 (NSS); SPI2 on PB13/PB14/PB15/PB12.
Analog
Ten 12-bit channels on PA0–PA7, PB0 and PB1, 0–3.3 V. STM32duino returns 10-bit values unless you call analogReadResolution(12).
05Power & start
Power it up and get connected
Power options
- Micro-USB5 V into the on-board 3.3 V regulator; also USB data on PA11/PA12.
- 5V pinSame 5 V rail as USB.
- 3V3 pinsRegulator output, or a regulated 3.3 V input.
- VBATKeeps the RTC running from a coin cell.
- 1
Wire an ST-Link to the SWD header
3.3V, SWDIO, SWCLK and GND on the 4-pin header at the end.
- 2
Install STM32duino
Tools → Board → STM32 MCU based boards → Generic STM32F1 seriesPick BluePill F103C8 and Upload method: STLink.
- 3
Blink PC13
The LED lights when the pin is LOW.
- 4
No board on your desk?
Open a Blue Pill circuit in the SolderHub Simulator below.
06Gotchas
Things that trip people up
01
PA0–PA7, PB0, PB1 aren't 5 V tolerant
These are the analog-capable pins. Use USART1 (PA9/PA10) or a divider for 5 V signals.
02
PA15, PB3 and PB4 start as JTAG
Disable JTAG (keep SWD) before using them as GPIO.
03
The PC13 LED is active LOW
digitalWrite(PC13, LOW) turns it on. PC13–PC15 are weak pins.
04
USB can't flash a new board
Out of the box, use the SWD header or the serial bootloader on PA9/PA10 (BOOT0 = 1).
05
USB and CAN can't run together
They share internal RAM on this chip, not just the PA11/PA12 pins.
07SolderHub Simulator
Wire up the STM32 Blue Pill without the hardware
Build and run circuits in the SolderHub Simulator, right in your browser.
Board Basics
Introduction, pinout, and protocols — all in one guide.
Sensor Modules & Library
Wiring sensors and modules, plus the library you need to talk to them.
Sensor Integration
Coming soon
Library & Setup
Coming soon
More From This Board
1More STM32 Blue Pill guides worth reading.

