Skip to content
Board reference

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

PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Hover or tap any pin on the board

LEFT header · pin 1

PB12

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.PinSignalsStatus
1PB12SPI2_NSS, TIM1_BKINOK
2PB13SPI2_SCK, TIM1_CH1NOK
3PB14SPI2_MISO, TIM1_CH2NOK
4PB15SPI2_MOSI, TIM1_CH3NOK
5PA8TIM1_CH1, MCOOK
6PA9USART1_TX, TIM1_CH2OK
7PA10USART1_RX, TIM1_CH3OK
8PA11USB_DM, CAN_RX, TIM1_CH4Caution
9PA12USB_DP, CAN_TXCaution
10PA15JTDI, SPI1_NSS (remap), TIM2_CH1 (remap)Caution
11PB3JTDO, SPI1_SCK (remap), TIM2_CH2 (remap)Caution
12PB4NJTRST, SPI1_MISO (remap), TIM3_CH1 (remap)Caution
13PB5SPI1_MOSI (remap), TIM3_CH2 (remap)OK
14PB6I2C1_SCL, TIM4_CH1, USART1_TX (remap)OK
15PB7I2C1_SDA, TIM4_CH2, USART1_RX (remap)OK
16PB8TIM4_CH3, I2C1_SCL (remap), CAN_RX (remap)OK
17PB9TIM4_CH4, I2C1_SDA (remap), CAN_TX (remap)OK
185VUSB 5 V, or a 5 V input to the on-board 3.3 V regulator.
19GNDGround
203V33.3 V from the on-board regulator, or a regulated 3.3 V input.

RIGHT · right side

No.PinSignalsStatus
1GNDGround
2GNDGround
33V33.3 V from the on-board regulator, or a regulated 3.3 V input.
4RSTPull LOW to reset, the same as the reset button.
5PB11I2C2_SDA, USART3_RXOK
6PB10I2C2_SCL, USART3_TXOK
7PB1ADC12_IN9, TIM3_CH4OK
8PB0ADC12_IN8, TIM3_CH3OK
9PA7ADC12_IN7, SPI1_MOSI, TIM3_CH2OK
10PA6ADC12_IN6, SPI1_MISO, TIM3_CH1OK
11PA5ADC12_IN5, SPI1_SCKOK
12PA4ADC12_IN4, SPI1_NSSOK
13PA3ADC12_IN3, USART2_RX, TIM2_CH4OK
14PA2ADC12_IN2, USART2_TX, TIM2_CH3OK
15PA1ADC12_IN1, TIM2_CH2, USART2_RTSOK
16PA0ADC12_IN0, TIM2_CH1, WKUPOK
17PC15OSC32_OUTAvoid
18PC14OSC32_INAvoid
19PC13LED, TAMPER-RTCCaution
20VBATBackup 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. 1

    Wire an ST-Link to the SWD header

    3.3V, SWDIO, SWCLK and GND on the 4-pin header at the end.

  2. 2

    Install STM32duino

    Tools → Board → STM32 MCU based boards → Generic STM32F1 series

    Pick BluePill F103C8 and Upload method: STLink.

  3. 3

    Blink PC13

    The LED lights when the pin is LOW.

  4. 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.

Board basics guide coming soon

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

1

More STM32 Blue Pill guides worth reading.