Skip to content

Guide

STM32 Black Pill Pinout: STM32F411 GPIO, ADC, Timers and Peripherals

Complete STM32 Black Pill (STM32F411CEU6) pinout reference: GPIO ports, 12-bit ADC, timers/PWM, USART, SPI, I2C, and the 3.3V-only pins to watch out for.

  • 6 min read
  • Updated November 21, 2026
STM32 Black Pill Pinout: STM32F411 GPIO, ADC, Timers and Peripherals

The Black Pill is the STM32 community's answer to the Blue Pill: a cheap, breadboard-friendly board with a genuine STM32F411CEU6, USB-C, a user button and a 100 MHz Cortex-M4 with hardware floating point. WeAct Studio designed it, and it has largely replaced the Blue Pill as the first STM32 board to buy, mainly because counterfeit chips are far less of a problem.

Quick answer: the onboard LED is PC13 (active LOW), the KEY button is PA0, analog inputs are PA0–PA7, PB0, PB1 (12-bit), I2C1 is PB6/PB7, SPI1 is PA5/PA6/PA7, USART1 is PA9/PA10, USB uses PA11/PA12, and SWD debugging uses PA13/PA14. Logic is 3.3 V; most pins tolerate 5 V as digital inputs, but not all, and none in analog mode. To flash over USB, hold BOOT0, tap NRST, release BOOT0.

Below: the full pin function table, power, every peripheral's default pins, DFU and Arduino IDE setup, the F401 vs F411 variants, and the mistakes that catch people out.

STM32 Black Pill (WeAct STM32F411CEU6) pinout diagram
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

Every header pin on the SolderHub Simulator Black Pill, in WeAct's order with USB-C at the top: green is free GPIO, amber and orange need care (JTAG at reset, USB, KEY, weak PC13–PC15), red is power, grey is ground, blue is reset.

Black Pill Specs (F411 and F401 Versions)

Three chips ship on boards that look identical, so check the marking on yours:

STM32F411CEU6STM32F401CEU6STM32F401CCU6
CoreCortex-M4FCortex-M4FCortex-M4F
Max clock100 MHz84 MHz84 MHz
Flash512 KB512 KB256 KB
SRAM128 KB96 KB64 KB
I2C / SPI / USART3 / 5 / 33 / 4 / 33 / 4 / 3

The pinout is the same for all three. This guide uses the F411, the most common version. Boards also carry a 25 MHz crystal (HSE), a 32.768 kHz crystal for the RTC, and a footprint on the back for an optional SPI flash chip. When USB is in use, the clock is usually set to 96 MHz rather than 100, because USB needs an exact 48 MHz clock.

What's Actually on the Board

WeAct's board puts the STM32F4 next to a USB-C socket wired to the chip's own USB (PA11/PA12), a 3.3 V regulator, the 25 MHz and 32.768 kHz crystals, and three buttons: BOOT0 (hold at reset for the ROM DFU bootloader), NRST (reset) and KEY (PA0 to GND). There's a red power LED, a blue user LED on PC13, and a 4-pin SWD header at the end opposite the USB socket.

What's on a WeAct Black Pill: USB-C, BOOT0 and NRST buttons, 3.3 V regulator, STM32F411CEU6, 25 MHz crystal, PWR and PC13 LEDs, KEY button and SWD header, labelled on the SolderHub Simulator Black Pill
Interactive Black Pill pinout: tap any pin

40 of 40 pins match

PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

Pin Function Table

STM32 pins are named by port and number (PA0–PA15, PB0–PB15, PC13–PC15). The 48-pin F411 package has no PB11, so there's no gap in the header to look for: that pin simply doesn't exist.

PinADCDefault peripheral rolesNotes
PA0ADC1_IN0TIM2_CH1, TIM5_CH1, USART2_CTSKEY button (to GND); wake-up pin
PA1ADC1_IN1TIM2_CH2, TIM5_CH2
PA2ADC1_IN2USART2_TX, TIM2_CH3
PA3ADC1_IN3USART2_RX, TIM2_CH4
PA4ADC1_IN4SPI1_NSSSPI flash footprint (CS)
PA5ADC1_IN5SPI1_SCK, TIM2_CH1SPI flash footprint
PA6ADC1_IN6SPI1_MISO, TIM3_CH1SPI flash footprint
PA7ADC1_IN7SPI1_MOSI, TIM3_CH2SPI flash footprint
PA8—TIM1_CH1, I2C3_SCL, MCO1
PA9—USART1_TX, TIM1_CH2
PA10—USART1_RX, TIM1_CH3Also used by the USB DFU bootloader
PA11—USB D−, USART6_TXLeave free when using USB
PA12—USB D+, USART6_RXLeave free when using USB
PA13—SWDIODebug; avoid using as GPIO
PA14—SWCLKDebug; avoid using as GPIO
PA15—TIM2_CH1, SPI3_NSSJTAG pin, free with SWD
PB0ADC1_IN8TIM3_CH3
PB1ADC1_IN9TIM3_CH4
PB2—BOOT1Pulled down on the board; best left alone
PB3—SPI1_SCK (alt), I2C2_SDA, TIM2_CH2JTAG pin, free with SWD
PB4—SPI1_MISO (alt), I2C3_SDA, TIM3_CH1JTAG pin, free with SWD
PB5—SPI1_MOSI (alt), TIM3_CH2
PB6—I2C1_SCL, USART1_TX (alt), TIM4_CH1
PB7—I2C1_SDA, USART1_RX (alt), TIM4_CH2
PB8—I2C1_SCL (alt), TIM4_CH3
PB9—I2C1_SDA (alt), TIM4_CH4
PB10—I2C2_SCL, SPI2_SCK
PB12—SPI2_NSS
PB13—SPI2_SCK, TIM1_CH1N
PB14—SPI2_MISO, TIM1_CH2N
PB15—SPI2_MOSI, TIM1_CH3N
PC13——Onboard LED, active LOW; weak pin (see below)
PC14——32.768 kHz crystal; not usable as GPIO
PC15——32.768 kHz crystal; not usable as GPIO

That leaves about 28 freely usable GPIOs once USB, SWD and the RTC crystal are accounted for.

In the Arduino IDE (STM32duino core), use the names directly:

sketch.ino
void setup() { pinMode(PC13, OUTPUT); }
void loop() {
  digitalWrite(PC13, LOW);  delay(500);   // LOW = LED on
  digitalWrite(PC13, HIGH); delay(500);
}

Power Pins and 5 V Tolerance

PinWhat it is
5VUSB VBUS, or an external 5 V input (feeds the onboard 3.3 V regulator)
3V3Regulator output for the chip and small sensors, or a regulated 3.3 V input
VBVBAT: a coin cell here keeps the RTC and backup registers alive
GNDGround
RNRST, the reset line (same as the NRST button)

The logic is 3.3 V. Outputs only ever reach 3.3 V, so a 5 V module that needs a 5 V HIGH may not see one. As inputs, most pins are marked FT (5 V tolerant) in the STM32F411 datasheet, but a few are not, and no pin is 5 V tolerant while it's set as an analog input. Before feeding 5 V into a pin, check its I/O type (FT, TC or TT) in the datasheet's pin table; otherwise use a divider or level shifter. The simplest safe habit is to treat the whole board as 3.3 V.

PC13, PC14 and PC15 are weak. They sit in the backup power domain and can only sink about 3 mA, at low speed. That's enough for the onboard LED, not for driving anything else. Use another pin for loads and fast signals.

Don't run motors, LED strips or servos from the 3V3 pin: the small onboard regulator also powers the chip, and a dip resets it.

Power pins: two 5V, two 3V3, VBAT, GND and NRST
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

PC13–PC15: weak pins (LED and RTC crystal)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

ADC

One 12-bit ADC with 10 external channels: PA0–PA7, PB0 and PB1. The input range is 0–3.3 V, and STM32duino returns 10-bit values by default for Arduino compatibility, so set 12 bits explicitly:

sketch.ino
analogReadResolution(12);
int raw = analogRead(PA1);              // 0–4095
float volts = raw * 3.3 / 4095.0;

Compared with the ESP32, the STM32 ADC is linear across the range and has no Wi-Fi conflicts, so it's pleasant for sensor work. Keep the source impedance low (under about 10 kΩ) or add a 100 nF capacitor at the pin for stable readings.

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

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

A potentiometer on PA1, powered from 3V3. Not PA0: that pin also carries the KEY button, and pressing it pulls the reading to 0 (SolderHub Simulator parts).

PWM and Timers

The F411 has TIM1 (advanced, with complementary outputs for motor drivers), TIM2 and TIM5 (32-bit), TIM3, TIM4 and TIM9–11 (16-bit). PWM works on any pin with a timer channel in the table above:

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

Pins on the same timer share one frequency. If a servo (50 Hz) and a motor (20 kHz) end up on the same timer, one of them breaks, so put them on different timers, for example a servo on PB6 (TIM4) and a motor on PA8 (TIM1).

Every header pin with a timer channel (PWM)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

UART, I2C and SPI

BusDefault pinsAlternatives
USART1TX PA9, RX PA10TX PB6, RX PB7
USART2TX PA2, RX PA3—
USART6TX PA11, RX PA12Conflicts with USB
I2C1SCL PB6, SDA PB7SCL PB8, SDA PB9
I2C2SCL PB10, SDA PB3—
I2C3SCL PA8, SDA PB4—
SPI1SCK PA5, MISO PA6, MOSI PA7PB3, PB4, PB5
SPI2SCK PB13, MISO PB14, MOSI PB15—

In STM32duino, Serial is the USB port when you select USB support: CDC (generic 'Serial' supersede U(S)ART). Hardware UARTs are separate objects:

sketch.ino
HardwareSerial Serial1(PA10, PA9);     // RX, TX

void setup() {
  Serial.begin(115200);    // USB
  Serial1.begin(9600);     // GPS, Bluetooth module, etc.
}

For I2C, Wire.begin() uses PB7/PB6. To move it, call Wire.setSDA(PB9); Wire.setSCL(PB8); before Wire.begin(). The board has no I2C pull-ups; most breakout modules include them, bare chips need 4.7 kΩ to 3.3 V.

The SPI flash footprint on the back connects to PA4–PA7. It's empty on most boards, so SPI1 is free. If you solder a W25Q flash chip there, keep PA4 as its chip-select and use another pin for other SPI devices' CS.

USART1 (PA9/PA10 or PB6/PB7), USART2 (PA2/PA3), USART6 (PA11/PA12)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

I2C1 (PB6/PB7 or PB8/PB9), I2C2 (PB10/PB3), I2C3 (PA8/PB4)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

SPI1 (PA5–PA7 or PB3–PB5) and SPI2 (PB13–PB15)
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

Programming the Black Pill

Arduino IDE (STM32duino)

  1. In File → Preferences, add the board manager URL https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json.
  2. Install STM32 MCU based boards in the Boards Manager, and install STM32CubeProgrammer from ST (needed for uploads).
  3. Select Board: Generic STM32F4 series, Board part number: BlackPill F411CE (or F401CC/CE for those chips).
  4. Set Upload method: STM32CubeProgrammer (DFU), or (SWD) with an ST-Link.
  5. Set USB support: CDC (generic 'Serial' supersede U(S)ART) so Serial appears as a COM port.

Entering DFU mode

Hold BOOT0, press and release NRST, then release BOOT0. The board appears as STM32 BOOTLOADER in Device Manager, and the upload can start. The F411's ROM bootloader is known for sometimes not appearing on the first try; if it doesn't, repeat the sequence, or hold BOOT0 while plugging in the USB cable. After the upload, press NRST to run your code.

Black Pill upload or Serial not working?
You click Upload in the Arduino IDE
Q1 Is STM32 BOOTLOADER missing from Device Manager with Upload method set to DFU?
yes → Hold BOOT0, tap NRST, release BOOT0. If it still doesn't appear, hold BOOT0 while plugging in the cable, or use an ST-Link.
no
Q2 Did the upload finish, but your sketch isn't running?
yes → The chip is still in the bootloader. Press NRST to run your code.
no
Q3 Does the ST-Link no longer connect after an upload?
yes → Your sketch reused PA13/PA14 (SWD). Hold NRST while connecting ("connect under reset").
no
Q4 Is there no Serial output over USB?
yes → Set USB support: CDC (generic 'Serial' supersede U(S)ART) and reselect the port.
no
Uploads and Serial are fine. Check your wiring and pin choices next.
From the programming steps and common mistakes in this guide.

ST-Link (SWD)

Connect an ST-Link V2 to the 4-pin header at the end of the board: 3V3, SWDIO (PA13), SWCLK (PA14), GND. SWD uploads don't need BOOT0, they work every time, and they let you debug with breakpoints in STM32CubeIDE or PlatformIO. An ST-Link clone costs less than the board and is worth having.

Common Mistakes

MistakeWhat happensFix
LED code written active-HIGHLED is on when you expect offPC13 is active LOW: LOW = on
Driving a load from PC13–15Weak or no outputThose pins sink ~3 mA; use another pin
No Serial output over USBUSB CDC not enabledSet USB support: CDC and reselect the port
DFU device doesn't appearBootloader timing quirkRetry BOOT0 + NRST, or use an ST-Link
Board stops responding to the ST-LinkSketch reused PA13/PA14Hold NRST while connecting ("connect under reset")
USART6 and USB fightBoth use PA11/PA12Use USART1 or USART2 instead
Servo and motor PWM interfereSame timer, one frequencyMove one to a different timer
5 V sensor on an analog pinPin is not 5 V tolerant in analog modeDivide the signal to 3.3 V
PA11/PA12: USB D−/D+, also USART6
PB12PB13PB14PB15PA8PA9PA10PA11PA12PA15PB3PB4PB5PB6PB7PB8PB95VGND3V35VGND3V3PB10PB2PB1PB0PA7PA6PA5PA4PA3PA2PA1PA0RSTPC15PC14PC13VBAT

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

Black Pill vs Blue Pill vs Nucleo

Black Pill (F411)Blue Pill (F103)Nucleo-64
Core / clockCortex-M4F, 100 MHzCortex-M3, 72 MHzVaries by model
RAM128 KB20 KBVaries
USBUSB-C, ROM DFU bootloaderMicro-USB, needs a bootloader flashedST-Link USB
Programmer neededNo (DFU)Usually (ST-Link or USB-serial)No, built in
Counterfeit chipsRareCommonNo
Arduino shieldsNoNoYes

Pick the Black Pill for a small, cheap, capable board on a breadboard; the Blue Pill only if you already have one; a Nucleo if you want a built-in debugger and Arduino shield headers.

SRAM: the three Black Pill chips vs the Blue Pill
STM32F411CEU6 (100 MHz)
128 KB
STM32F401CEU6 (84 MHz)
96 KB
STM32F401CCU6 (84 MHz)
64 KB
Blue Pill STM32F103C8 (72 MHz)
20 KB
All three Black Pill chips share the same pinout; check the marking to know which one you have.

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

FAQ

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

Which pin is the KEY button? PA0. It connects to GND when pressed, so use pinMode(PA0, INPUT_PULLUP) and read LOW for pressed.

How many GPIOs does it have? 34 GPIOs in total, about 28 free once USB, SWD and the RTC crystal are taken.

Is the Black Pill 5 V tolerant? Most pins are, as digital inputs only. Outputs are 3.3 V, and analog inputs must stay at or below 3.3 V. Check a pin's FT marking in the datasheet before relying on it.

Do I need an ST-Link? Not to upload: USB DFU works. An ST-Link makes uploads more reliable and adds debugging.

Can I program it with MicroPython? Yes. MicroPython has an official port for STM32F411 Black Pill boards, flashed over DFU.

F401 or F411? The F411 is faster and has more RAM; the pinout and code are the same. Either is a good buy.


Related guides: STM32 Blue Pill pinout · STM32 Nucleo pinout · ESP32 pinout · Arduino Uno 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.