Blue Pill is a cheap development board with the STM32F103C8T6 chip (ARM Cortex-M3, 72 MHz). For the price of an Arduino Nano, it offers a 32-bit processor, USB, CAN, a 12-bit ADC and twice as many interfaces. It’s programmed in the Arduino IDE (STM32duino), STM32CubeIDE or PlatformIO, and uploaded via ST-LINK (SWD connector) or a USB-serial converter.
The board is made by many manufacturers to the same design; the pin layout is the same on all of them.
Specifications
- STM32F103C8T6: ARM Cortex-M3 72 MHz, 64 KB flash (often 128 KB), 20 KB RAM
- 32 GPIO on the headers, 10 of them analog inputs (12-bit)
- 3× UART, 2× I2C, 2× SPI, CAN, USB 2.0 Full Speed, 4 timers with PWM
- 22 5V-tolerant pins (PA8–PA15, PB2–PB4, PB6–PB15)
- micro USB, SWD connector, BOOT0/BOOT1 jumpers, LED on PC13
- 53 × 23 mm
The STM32F103 doesn’t let you freely choose the function of every pin: each peripheral has default pins and one remap (AFIO). The diagram shows the default pins – after remapping, USART1 is on PB6/PB7, I2C1 on PB8/PB9 and SPI1 on PA15/PB3/PB4/PB5.
In the Arduino IDE (STM32duino core), select the board “Generic STM32F1 series” and the model “BluePill F103C8”. Uploading via ST-LINK on the SWD connector is the most reliable; uploading via USART1 (PA9/PA10) works with the BOOT0 jumper set to 1.
Pinout and pin table
Hover over a pin in the diagram or a table row; use the filter to highlight a bus. You can download the pinout as PNG or SVG.
| Name | Direction | UART | I2C | SPI | PWM | ADC | Note |
|---|---|---|---|---|---|---|---|
| PB12 | input/output | CK3 | NSS2 | ||||
| PB13 | input/output | CTS3 | SCK2 | T1CH1N | |||
| PB14 | input/output | RTS3 | MISO2 | T1CH2N | |||
| PB15 | input/output | MOSI2 | T1CH3N | ||||
| PA8 | input/output | CK1 | T1CH1 | ||||
| PA9 | input/output | TX1 | T1CH2 | ||||
| PA10 | input/output | RX1 | T1CH3 | ||||
| PA11 | input/output | CTS1 | T1CH4 | USB D− (occupied when USB is used) | |||
| PA12 | input/output | RTS1 | USB D+. The board has a pull-up R10 to 3.3 V – it should be 1.5 kΩ, but 10 kΩ or 4.7 kΩ is often fitted, so the board fails to enumerate on some computers. Fix: replace R10 or add 1.8 kΩ between PA12 and 3.3 V. | ||||
| PA15 | input/output | T2CH1 | After reset JTDI (JTAG) – GPIO only after disabling JTAG. After remapping, SPI1 NSS. | ||||
| PB3 | input/output | T2CH2 | After reset JTDO – GPIO only after disabling JTAG. After remapping, SPI1 SCK. | ||||
| PB4 | input/output | T3CH1 | After reset NJTRST – GPIO only after disabling JTAG. After remapping, SPI1 MISO. | ||||
| PB5 | input/output | T3CH2 | After remapping, SPI1 MOSI. The only one of PB3–PB15 that is not 5V tolerant. | ||||
| PB6 | input/output | SCL1 | T4CH1 | I2C1 SCL (default). USART1 TX after remapping. 5V tolerant. | |||
| PB7 | input/output | SDA1 | T4CH2 | I2C1 SDA (default). USART1 RX after remapping. 5V tolerant. | |||
| PB8 | input/output | T4CH3 | After remapping, I2C1 SCL or CAN RX. 5V tolerant. | ||||
| PB9 | input/output | T4CH4 | After remapping, I2C1 SDA or CAN TX. 5V tolerant. | ||||
| 5V | input/output | Connected directly to the USB connector's VBUS without a diode – do not power from USB and an external 5 V supply at the same time. | |||||
| GND | – | ||||||
| 3V3 | input/output | 3.3 V from the regulator, or 3.3 V power input | |||||
| VBAT | input | Backup supply for the RTC and backup registers (1.8–3.6 V battery) | |||||
| PC13 | input/output | Onboard LED (3.3 V → LED → 510 Ω → PC13), lit at logic 0. PC13–PC15 are powered through the backup domain switch: only 3 mA, max. 2 MHz, must not source current. | |||||
| PC14 | input/output | Weak pin (max. 3 mA, 2 MHz) – 32.768 kHz crystal for RTC | |||||
| PC15 | input/output | Weak pin (max. 3 mA, 2 MHz) – 32.768 kHz crystal for RTC | |||||
| PA0 | input/output | CTS2 | T2CH1 | ADC12_IN0 | |||
| PA1 | input/output | RTS2 | T2CH2 | ADC12_IN1 | |||
| PA2 | input/output | TX2 | T2CH3 | ADC12_IN2 | |||
| PA3 | input/output | RX2 | T2CH4 | ADC12_IN3 | |||
| PA4 | input/output | CK2 | NSS1 | ADC12_IN4 | |||
| PA5 | input/output | SCK1 | ADC12_IN5 | ||||
| PA6 | input/output | MISO1 | T3CH1 | ADC12_IN6 | |||
| PA7 | input/output | MOSI1 | T1CH1N, T3CH2 | ADC12_IN7 | |||
| PB0 | input/output | T1CH2N, T3CH3 | ADC12_IN8 | ||||
| PB1 | input/output | T1CH3N, T3CH4 | ADC12_IN9 | ||||
| PB10 | input/output | TX3 | SCL2 | T2CH3 | |||
| PB11 | input/output | RX3 | SDA2 | T2CH4 | |||
| NRST | input | Reset – logic 0 holds the chip in reset (RESET button) | |||||
| 3V3 | input/output | 3.3 V from the regulator, or 3.3 V power input | |||||
| GND | – | ||||||
| GND | – | ||||||
| 3V3 | input/output | 3.3 V from the regulator, or 3.3 V power input | |||||
| PA13 | input/output | ||||||
| PA14 | input/output | ||||||
| GND | – |
Pins used on the board
These chip pins are used by parts on the board and are not broken out:
| Pin | Function on the board |
|---|---|
| PB2 | BOOT1 – jumper on the board (with BOOT0 = 1 and BOOT1 = 0 the bootloader starts over USART1) |
| BOOT0 | BOOT0 jumper – 0 = boot from flash, 1 = system bootloader |
| PD0, PD1 | Krystal 8 MHz (OSC_IN, OSC_OUT) |
What to watch out for
- Pins PA0–PA7, PB0, PB1, PB5 and PC13–PC15 are not 5V tolerant.
- The R10 pull-up on USB D+ is often 10 kΩ instead of 1.5 kΩ – the board may then fail to enumerate as a USB device.
- PC13–PC15 can sink only 3 mA and must not source current (the LED on PC13 lights at logic 0).
- PA15, PB3 and PB4 are JTAG pins after reset – you can use them as GPIO only after disabling JTAG (SWD stays enabled).
- The 5V pin is connected directly to USB without a diode – don’t power the board from USB and an external supply at the same time.
- Many boards carry a clone chip (CS32F103, GD32F103, APM32F103) – OpenOCD may report a different ID.
STM32 on chiptron.eu/
Projects and guides on chiptron.eu/:
- STM32duino – how to start with STM32 like an Arduino
- HScope – an oscilloscope with a smartphone and Blue Pill
More pinouts
See all pinouts on the Pinouts page.