Opens in a new tab

Blue Pill STM32F103C8T6 Pinout

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.

Blue Pill STM32F103C8T6 – pinoutBlue Pill STM32F103C8T6 – pinoutchiptron.eu · CC BY 4.0STM32F103C8BOOTRESETPC13PWR3.3 DIO CLK GND PB12 NSS2 PB13 SCK2 PB14 MISO2 PB15 MOSI2 PA8 PA9 TX1 PA10 RX1 PA11 USB D− PA12 USB D+ PA15 JTDI PB3 PB4 PB5 PB6 SCL1 PB7 SDA1 PB8 PB9 5V ↔ 5 V from USB (no diode), or 5 V power input GND 3V3 ↔ 3.3 V from the regulator, or 3.3 V power input GND GND 3V3 ↔ NRST ← Reset – logic 0 holds the chip in reset (RESET button) PB11 RX3 PB10 TX3 PB1 ADC12_IN9 PB0 ADC12_IN8 PA7 MOSI1 ADC12_IN7 PA6 MISO1 ADC12_IN6 PA5 SCK1 ADC12_IN5 PA4 NSS1 ADC12_IN4 PA3 RX2 ADC12_IN3 PA2 TX2 ADC12_IN2 PA1 ADC12_IN1 PA0 ADC12_IN0 WKUP PC15 OSC32 OUT PC14 OSC32 IN PC13 LED (active low) VBAT ← Backup supply for the RTC and backup registers (1.8–3.6 V battery) GPIO UART I2C SPI ADC (analog) Power Ground (GND) Control / reset
Download:PNGSVG
Pin table – Blue Pill (STM32F103C8T6)
NameDirectionUARTI2CSPIPWMADCNote
PB12input/outputCK3NSS2
PB13input/outputCTS3SCK2T1CH1N
PB14input/outputRTS3MISO2T1CH2N
PB15input/outputMOSI2T1CH3N
PA8input/outputCK1T1CH1
PA9input/outputTX1T1CH2
PA10input/outputRX1T1CH3
PA11input/outputCTS1T1CH4USB D− (occupied when USB is used)
PA12input/outputRTS1USB 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.
PA15input/outputT2CH1After reset JTDI (JTAG) – GPIO only after disabling JTAG. After remapping, SPI1 NSS.
PB3input/outputT2CH2After reset JTDO – GPIO only after disabling JTAG. After remapping, SPI1 SCK.
PB4input/outputT3CH1After reset NJTRST – GPIO only after disabling JTAG. After remapping, SPI1 MISO.
PB5input/outputT3CH2After remapping, SPI1 MOSI. The only one of PB3–PB15 that is not 5V tolerant.
PB6input/outputSCL1T4CH1I2C1 SCL (default). USART1 TX after remapping. 5V tolerant.
PB7input/outputSDA1T4CH2I2C1 SDA (default). USART1 RX after remapping. 5V tolerant.
PB8input/outputT4CH3After remapping, I2C1 SCL or CAN RX. 5V tolerant.
PB9input/outputT4CH4After remapping, I2C1 SDA or CAN TX. 5V tolerant.
5Vinput/outputConnected 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–
3V3input/output3.3 V from the regulator, or 3.3 V power input
VBATinputBackup supply for the RTC and backup registers (1.8–3.6 V battery)
PC13input/outputOnboard 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.
PC14input/outputWeak pin (max. 3 mA, 2 MHz) – 32.768 kHz crystal for RTC
PC15input/outputWeak pin (max. 3 mA, 2 MHz) – 32.768 kHz crystal for RTC
PA0input/outputCTS2T2CH1ADC12_IN0
PA1input/outputRTS2T2CH2ADC12_IN1
PA2input/outputTX2T2CH3ADC12_IN2
PA3input/outputRX2T2CH4ADC12_IN3
PA4input/outputCK2NSS1ADC12_IN4
PA5input/outputSCK1ADC12_IN5
PA6input/outputMISO1T3CH1ADC12_IN6
PA7input/outputMOSI1T1CH1N, T3CH2ADC12_IN7
PB0input/outputT1CH2N, T3CH3ADC12_IN8
PB1input/outputT1CH3N, T3CH4ADC12_IN9
PB10input/outputTX3SCL2T2CH3
PB11input/outputRX3SDA2T2CH4
NRSTinputReset – logic 0 holds the chip in reset (RESET button)
3V3input/output3.3 V from the regulator, or 3.3 V power input
GND–
GND–
3V3input/output3.3 V from the regulator, or 3.3 V power input
PA13input/output
PA14input/output
GND–

Pins used on the board

These chip pins are used by parts on the board and are not broken out:

PinFunction on the board
PB2BOOT1 – jumper on the board (with BOOT0 = 1 and BOOT1 = 0 the bootloader starts over USART1)
BOOT0BOOT0 jumper – 0 = boot from flash, 1 = system bootloader
PD0, PD1Krystal 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.

Related Articles