Skip to content

Guide

STM32 Blue Pill Pinout: STM32F103C8T6 GPIO, ADC, Peripherals and Programming

A complete STM32F103C8T6 Blue Pill pinout reference: every GPIO port, ADC channel, timer, and communication bus mapped, plus the 5V-tolerance and clone-board considerations that affect wiring decisions.

  • 6 min read
  • Updated November 21, 2026
STM32 Blue Pill Pinout: STM32F103C8T6 GPIO, ADC, Peripherals and Programming

The Blue Pill is a tiny, very cheap breakout board for the STM32F103C8T6, a 72 MHz Arm Cortex-M3 with 64 KB of flash and 20 KB of RAM. It looks like an Arduino Nano, but it runs at 3.3 V, it's programmed differently, and many boards sold today carry clone chips. Get those three things straight and it's a capable 32-bit board for very little money.

Quick answer: the onboard LED is PC13 (active LOW). Analog inputs are PA0–PA7, PB0, PB1 (12-bit). USART1 is PA9/PA10, I2C1 is PB6/PB7, SPI1 is PA5/PA6/PA7, and PB10/PB11 is either I2C2 or USART3, not both. USB uses PA11/PA12. Logic is 3.3 V; most digital pins tolerate 5 V, but the ten analog pins don't. Program it with an ST-Link on the SWD header; the USB port can't flash a new board until a USB bootloader is installed.

Below: the pin function table, power and 5 V tolerance, every bus with code, the three ways to upload, the USB resistor and fake-chip problems, and how the Blue Pill compares with the Black Pill.

STM32 Blue Pill (STM32F103C8T6) pinout diagram
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

Every header pin on the SolderHub Simulator Blue Pill: green is free GPIO, amber and orange need care (JTAG at reset, USB, weak PC13–PC15), red is power, grey is ground, blue is reset.

What's on the Board

  • STM32F103C8T6: Cortex-M3, 72 MHz, 64 KB flash, 20 KB SRAM, no FPU
  • 8 MHz crystal (main clock) and 32.768 kHz crystal (RTC) on PC14/PC15
  • Micro-USB connected to the chip's USB peripheral on PA11/PA12
  • Two jumpers: BOOT0 (top) and BOOT1 (PB2). Both on 0 for normal running
  • 4-pin SWD header at the end: 3.3V, SWDIO (PA13), SWCLK (PA14), GND
  • Reset button, a power LED and the PC13 user LED

The two long headers carry different pins; each side has its own set, plus power and ground at the ends. Silkscreen labels drop the "P": A9 means PA9.

What's on a Blue Pill: micro-USB, PWR and PC13 LEDs, reset button, 3.3 V regulator, STM32F103C8T6, 8 MHz crystal and the SWD header, labelled on the SolderHub Simulator Blue Pill
Interactive Blue Pill pinout: tap any pin

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
Tap or hover any pin for its functions and warnings.

Pin Function Table

PinADCMain peripheral roles5 V tolerantNotes
PA0IN0TIM2_CH1, USART2_CTS, WKUPNo
PA1IN1TIM2_CH2, USART2_RTSNo
PA2IN2USART2_TX, TIM2_CH3No
PA3IN3USART2_RX, TIM2_CH4No
PA4IN4SPI1_NSSNo
PA5IN5SPI1_SCKNo
PA6IN6SPI1_MISO, TIM3_CH1No
PA7IN7SPI1_MOSI, TIM3_CH2No
PA8—TIM1_CH1, MCOYes
PA9—USART1_TX, TIM1_CH2YesSerial bootloader TX
PA10—USART1_RX, TIM1_CH3YesSerial bootloader RX
PA11—USB D−, CAN_RX, TIM1_CH4YesLeave free when using USB
PA12—USB D+, CAN_TXYesHas the USB pull-up resistor
PA15—SPI1_NSS (remap), TIM2_CH1 (remap)YesJTAG pin at reset
PB0IN8TIM3_CH3No
PB1IN9TIM3_CH4No
PB3—SPI1_SCK (remap), TIM2_CH2 (remap)YesJTAG pin at reset
PB4—SPI1_MISO (remap), TIM3_CH1 (remap)YesJTAG pin at reset
PB5—SPI1_MOSI (remap), TIM3_CH2 (remap)Check datasheet
PB6—I2C1_SCL, TIM4_CH1, USART1_TX (remap)Yes
PB7—I2C1_SDA, TIM4_CH2, USART1_RX (remap)Yes
PB8—TIM4_CH3, I2C1_SCL (remap), CAN_RX (remap)Yes
PB9—TIM4_CH4, I2C1_SDA (remap), CAN_TX (remap)Yes
PB10—I2C2_SCL or USART3_TXYesShared: pick one
PB11—I2C2_SDA or USART3_RXYesShared: pick one
PB12—SPI2_NSS, TIM1_BKINYes
PB13—SPI2_SCK, TIM1_CH1NYes
PB14—SPI2_MISO, TIM1_CH2NYes
PB15—SPI2_MOSI, TIM1_CH3NYes
PC13——NoLED, active LOW; weak pin
PC14——No32.768 kHz crystal
PC15——No32.768 kHz crystal

JTAG pins. PA15, PB3 and PB4 start up as JTAG debug pins. If they don't respond as GPIO, JTAG is still enabled on them; disable JTAG while keeping SWD (STM32CubeMX: Debug: Serial Wire, or __HAL_AFIO_REMAP_SWJ_NOJTAG() in code) to free them.

PC13–PC15 are weak. They can sink only about 3 mA and switch slowly. Fine for the LED, not for driving loads or fast signals.

Power Pins and 5 V Tolerance

PinWhat it is
5VUSB power, or an external 5 V input to the onboard 3.3 V regulator
3.3Regulator output, or a regulated 3.3 V input
VBVBAT for the RTC and backup registers; tie to 3.3 V or a coin cell
GGround
RReset (NRST)

Outputs are always 3.3 V. As inputs, the pins marked FT in the STM32F103 datasheet tolerate 5 V, which covers most of Port B and PA8–PA15. The analog-capable pins PA0–PA7, PB0 and PB1 are not 5 V tolerant, and no pin is while it's configured as an analog input. That makes USART1 (PA9/PA10) the convenient choice for a 5 V serial device such as a GPS module, while USART2 (PA2/PA3) needs 3.3 V signals. When in doubt, divide or level-shift.

The small onboard regulator powers the chip as well as the 3.3 V pin. Sensors are fine; servos, LED strips and Wi-Fi modules belong on their own supply.

Power pins: 5V, 3V3, VBAT, GND and RST
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

Not 5 V tolerant: PA0–PA7, PB0, PB1 and PC13–PC15
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

Blink the PC13 LED

sketch.ino
void setup() { pinMode(PC13, OUTPUT); }

void loop() {
  digitalWrite(PC13, LOW);   // LED on (active LOW)
  delay(500);
  digitalWrite(PC13, HIGH);  // LED off
  delay(500);
}

If the LED looks stuck on, your code is probably running with the logic inverted.

PC13: the user LED, lit when the pin is LOW
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

ADC

Two 12-bit ADCs share the same 10 channels: PA0–PA7, PB0 and PB1, with a 0–3.3 V range. In the STM32duino core, analogRead() returns 10-bit values by default for Arduino compatibility; ask for 12 bits:

sketch.ino
void setup() {
  Serial.begin(115200);
  analogReadResolution(12);
}

void loop() {
  int raw = analogRead(PA0);              // 0–4095
  Serial.println(raw * 3.3 / 4095.0, 3);  // volts
  delay(200);
}

A 0–5 V sensor needs a divider first, because these pins aren't 5 V tolerant. For steady readings, keep the source impedance low or add 100 nF from the pin to GND.

The ten ADC channels: PA0–PA7, PB0 and PB1
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

A potentiometer on PA0, powered from the 3.3 V pin so the wiper can't go above 3.3 V. PA0 isn't 5 V tolerant (SolderHub Simulator parts).

PWM and Timers

Four timers drive PWM: TIM1 (advanced, with complementary outputs on PB13–PB15 for motor bridges) and TIM2, TIM3, TIM4 (general purpose), each with four channels. Any pin with a TIMx_CHy entry in the table can output PWM. With STM32duino:

sketch.ino
analogWriteFrequency(20000);   // 20 kHz for motors
analogWriteResolution(12);
analogWrite(PA8, 2048);        // ~50 % on TIM1_CH1

(Older tutorials use pinMode(pin, PWM) and pwmWrite(). Those belong to the retired Maple / Roger Clark core and don't compile on STM32duino.)

Channels on the same timer share one frequency and stay in phase; put a 50 Hz servo and a 20 kHz motor on different timers, for example a servo on PB6 (TIM4) and a motor on PA8 (TIM1).

Every header pin with a timer channel (PWM)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

UART, I2C and SPI

BusPinsNotes
USART1TX PA9, RX PA105 V tolerant; also the ROM serial bootloader
USART2TX PA2, RX PA33.3 V only
USART3TX PB10, RX PB11Same pins as I2C2
I2C1SCL PB6, SDA PB7Remap: PB8, PB9
I2C2SCL PB10, SDA PB11Same pins as USART3
SPI1SCK PA5, MISO PA6, MOSI PA7, NSS PA4Remap: PB3, PB4, PB5, PA15
SPI2SCK PB13, MISO PB14, MOSI PB15, NSS PB12

In STM32duino, declare extra serial ports with their pins:

sketch.ino
HardwareSerial Serial2(PA3, PA2);   // RX, TX
void setup() { Serial2.begin(9600); }

A BME280 on I2C1, for example:

sketch.ino
#include <Wire.h>
#include <Adafruit_BME280.h>

Adafruit_BME280 bme;

void setup() {
  Serial.begin(115200);
  Wire.begin();                       // PB7 = SDA, PB6 = SCL
  if (!bme.begin(0x76)) {
    Serial.println("BME280 not found: check wiring and address (0x76 or 0x77)");
    while (1) delay(10);
  }
}

void loop() {
  Serial.print(bme.readTemperature()); Serial.print(" C  ");
  Serial.print(bme.readHumidity());    Serial.print(" %  ");
  Serial.print(bme.readPressure() / 100.0F); Serial.println(" hPa");
  delay(1000);
}

Wiring: VCC to 3.3, GND to G, SCL to B6, SDA to B7. To use the remapped I2C1 pins, call Wire.setSCL(PB8); Wire.setSDA(PB9); before Wire.begin().

USB and CAN can't run together on this chip. They share a block of internal RAM, not only the PA11/PA12 pins, so a project that needs both needs a different STM32.

USART1 (PA9/PA10), USART2 (PA2/PA3) and USART3 (PB10/PB11)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

I2C1 (PB6/PB7, remap PB8/PB9) and I2C2 (PB10/PB11)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

SPI1 (PA4–PA7, remap PA15/PB3–PB5) and SPI2 (PB12–PB15)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

Uploading Code: Three Options

The F103's built-in ROM bootloader supports the serial port, not USB, so a new Blue Pill can't be flashed over its USB socket.

MethodHardwareBOOT0Best for
ST-Link (SWD)ST-Link V2 or cloneStays at 0Everyone; also gives debugging
Serial bootloader3.3 V USB-serial adapter on PA9/PA10Set to 1 to flash, back to 0 to runNo ST-Link available
USB bootloaderST-Link or serial once, to install itStays at 0Uploading over USB afterwards

Arduino IDE setup (STM32duino): add the STMicroelectronics board manager URL https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json, install STM32 MCU based boards and STM32CubeProgrammer, then choose Generic STM32F1 series → BluePill F103C8. Pick Upload method: STM32CubeProgrammer (SWD) for an ST-Link or (Serial) for a USB-serial adapter. To get Serial over the board's USB port, set USB support: CDC (generic 'Serial' supersede U(S)ART).

ST-Link wiring: 3.3V to 3.3, GND to GND, SWDIO to DIO, SWCLK to CLK. Power the board from the ST-Link or USB, not both.

Serial bootloader: wire the adapter's TX to A10 and RX to A9, move the BOOT0 jumper to 1, press reset, upload, then move BOOT0 back to 0 and reset. Forgetting the last step leaves the board waiting in the bootloader after every reset, which looks exactly like a dead board.

Why won't my Blue Pill take an upload or run?
You try to upload a sketch
Q1 Are you uploading over the board's own USB socket on a fresh board?
yes → The F103's ROM bootloader has no USB. Flash it once with an ST-Link or a 3.3 V USB-serial adapter, or install a USB bootloader first.
no
Q2 Did a serial-bootloader upload finish, but the board now looks dead?
yes → BOOT0 is still on 1, so it waits in the bootloader. Move it back to 0 and reset.
no
Q3 Is the board still not detected over USB after installing a USB bootloader?
yes → Check R10: many clones fit 10 kΩ on D+ (PA12) instead of 1.5 kΩ. Replace it, or add 1.8 kΩ from PA12 to 3.3 V.
no
Q4 Does the ST-Link upload stop with a device ID error?
yes → The chip is probably a clone (CKS32, CS32, GD32 or APM32). Check the marking.
no
Check the SWD wiring (3.3, GND, DIO, CLK) and power the board from only one source.
From the upload table, clone-board notes and common mistakes in this guide.

Clone Boards: Two Problems to Know About

The USB pull-up resistor. USB needs 1.5 kΩ from D+ (PA12) to 3.3 V. Many Blue Pills fit 10 kΩ at R10 instead, so some computers don't detect the board as a USB device. Replace R10 with 1.5 kΩ, or add a 1.8 kΩ resistor from PA12 to 3.3 V in parallel.

Clone or relabelled chips. Many boards carry a CKS32F103, CS32F103, GD32F103 or APM32F103 instead of a genuine STM32. Most run the same code, but some are slower to start, behave differently in the flash or USB, or make STM32CubeProgrammer report an unexpected device ID. Check the chip marking and the ST logo; if an ST-Link upload fails with an ID error, a clone is the likely cause. Buy from a seller that states a genuine STM32, or consider the Black Pill, where clones are much rarer.

USB D− (PA11) and D+ (PA12): R10 is D+'s pull-up
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

Common Mistakes

MistakeFix
LED seems stuck on or blinks invertedPC13 is active LOW
Board "dead" after a serial uploadMove BOOT0 back to 0 and reset
Not detected over USBNo USB bootloader installed, or the R10 resistor problem
5 V sensor on PA0–PA7Those pins aren't 5 V tolerant; divide the signal
I2C2 and USART3 both in the codeThey share PB10/PB11; use I2C1 or USART1/2
PB3, PB4 or PA15 don't respondJTAG still enabled; switch to SWD-only
pinMode(pin, PWM) won't compileThat's the old Maple core; use analogWrite()
ST-Link upload fails with an ID errorClone chip; check the marking
PA15, PB3 and PB4 start as JTAG pins
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V3GNDGND3V3RSTPB11PB10PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0PC15PC14PC13VBAT

Highlighted on the SolderHub Simulator STM32 Blue Pill. Explore every pin on the STM32 Blue Pill board page.

Blue Pill vs Black Pill

Blue Pill (F103C8)Black Pill (F411CE)
Core / clockCortex-M3, 72 MHzCortex-M4F, 100 MHz
Flash / RAM64 KB / 20 KB512 KB / 128 KB
Floating pointSoftwareHardware FPU
USBMicro-USB, needs a bootloaderUSB-C, ROM DFU built in
CAN busYesNo
Clone chipsCommonRare

For a new project, the STM32 Black Pill is usually the better buy. The Blue Pill still makes sense if you already have one, need CAN, or are following a tutorial written for it. For a board with a built-in debugger and Arduino shield headers, see the STM32 Nucleo.

Memory: Blue Pill (F103C8) vs Black Pill (F411CE)
Blue Pill flash
64 KB
Black Pill flash
512 KB
Blue Pill SRAM
20 KB
Black Pill SRAM
128 KB
The Black Pill has 8× the flash and over 6× the SRAM, plus a hardware FPU.

Try your pin plan on a virtual Blue Pill. The SolderHub Simulator has the same STM32 Blue Pill you see in these figures, so you can check the wiring before you flash real hardware.

FAQ

Which pin is the Blue Pill LED? PC13, active LOW.

Is the Blue Pill 5 V tolerant? Most digital pins are, as inputs. PA0–PA7, PB0, PB1 and PC13–PC15 are not. Outputs are always 3.3 V.

Can I program the Blue Pill over USB? Not out of the box. Flash it once with an ST-Link or a USB-serial adapter, or install a USB bootloader first.

What's the ADC resolution? 12-bit (0–4095) over 0–3.3 V. Call analogReadResolution(12) in STM32duino, which defaults to 10-bit.

How many GPIOs are there? 32 on the two long headers, plus PA13/PA14 on the SWD header.

Does it have 128 KB of flash? Many C8T6 chips have 128 KB physically, but only 64 KB is guaranteed. Don't rely on the extra half.


Related guides: STM32 Black Pill pinout · STM32 Nucleo pinout · BME280 vs BMP280 · Arduino Nano pinout

Continue learning

Related articles

All articles

Signal In

Built from what makers search for

The lookups piling up in SolderHub's search bar every day shape what we publish next — new component pages, board guides, and firmware notes, sent out as they go live.

By subscribing you agree to our Privacy Policy. Unsubscribe anytime.