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.
Highlighted on the SolderHub Simulator STM32 Black Pill. Explore every pin on the STM32 Black Pill board page.
Black Pill Specs (F411 and F401 Versions)
Three chips ship on boards that look identical, so check the marking on yours:
| STM32F411CEU6 | STM32F401CEU6 | STM32F401CCU6 | |
|---|---|---|---|
| Core | Cortex-M4F | Cortex-M4F | Cortex-M4F |
| Max clock | 100 MHz | 84 MHz | 84 MHz |
| Flash | 512 KB | 512 KB | 256 KB |
| SRAM | 128 KB | 96 KB | 64 KB |
| I2C / SPI / USART | 3 / 5 / 3 | 3 / 4 / 3 | 3 / 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.
40 of 40 pins match
Hover or tap any pin on the board
LEFT header · pin 1
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
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.
| Pin | ADC | Default peripheral roles | Notes |
|---|---|---|---|
| PA0 | ADC1_IN0 | TIM2_CH1, TIM5_CH1, USART2_CTS | KEY button (to GND); wake-up pin |
| PA1 | ADC1_IN1 | TIM2_CH2, TIM5_CH2 | |
| PA2 | ADC1_IN2 | USART2_TX, TIM2_CH3 | |
| PA3 | ADC1_IN3 | USART2_RX, TIM2_CH4 | |
| PA4 | ADC1_IN4 | SPI1_NSS | SPI flash footprint (CS) |
| PA5 | ADC1_IN5 | SPI1_SCK, TIM2_CH1 | SPI flash footprint |
| PA6 | ADC1_IN6 | SPI1_MISO, TIM3_CH1 | SPI flash footprint |
| PA7 | ADC1_IN7 | SPI1_MOSI, TIM3_CH2 | SPI flash footprint |
| PA8 | — | TIM1_CH1, I2C3_SCL, MCO1 | |
| PA9 | — | USART1_TX, TIM1_CH2 | |
| PA10 | — | USART1_RX, TIM1_CH3 | Also used by the USB DFU bootloader |
| PA11 | — | USB D−, USART6_TX | Leave free when using USB |
| PA12 | — | USB D+, USART6_RX | Leave free when using USB |
| PA13 | — | SWDIO | Debug; avoid using as GPIO |
| PA14 | — | SWCLK | Debug; avoid using as GPIO |
| PA15 | — | TIM2_CH1, SPI3_NSS | JTAG pin, free with SWD |
| PB0 | ADC1_IN8 | TIM3_CH3 | |
| PB1 | ADC1_IN9 | TIM3_CH4 | |
| PB2 | — | BOOT1 | Pulled down on the board; best left alone |
| PB3 | — | SPI1_SCK (alt), I2C2_SDA, TIM2_CH2 | JTAG pin, free with SWD |
| PB4 | — | SPI1_MISO (alt), I2C3_SDA, TIM3_CH1 | JTAG 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:
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
| Pin | What it is |
|---|---|
| 5V | USB VBUS, or an external 5 V input (feeds the onboard 3.3 V regulator) |
| 3V3 | Regulator output for the chip and small sensors, or a regulated 3.3 V input |
| VB | VBAT: a coin cell here keeps the RTC and backup registers alive |
| GND | Ground |
| R | NRST, 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.
Highlighted on the SolderHub Simulator STM32 Black Pill. Explore every pin on the STM32 Black Pill board page.
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:
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.
Highlighted on the SolderHub Simulator STM32 Black Pill. Explore every pin on the STM32 Black Pill board page.
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:
analogWriteResolution(12);
analogWriteFrequency(20000); // 20 kHz, above hearing, for motors
analogWrite(PA8, 2048); // ~50 % on TIM1_CH1Pins 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).
Highlighted on the SolderHub Simulator STM32 Black Pill. Explore every pin on the STM32 Black Pill board page.
UART, I2C and SPI
| Bus | Default pins | Alternatives |
|---|---|---|
| USART1 | TX PA9, RX PA10 | TX PB6, RX PB7 |
| USART2 | TX PA2, RX PA3 | — |
| USART6 | TX PA11, RX PA12 | Conflicts with USB |
| I2C1 | SCL PB6, SDA PB7 | SCL PB8, SDA PB9 |
| I2C2 | SCL PB10, SDA PB3 | — |
| I2C3 | SCL PA8, SDA PB4 | — |
| SPI1 | SCK PA5, MISO PA6, MOSI PA7 | PB3, PB4, PB5 |
| SPI2 | SCK 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:
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.
Highlighted on the SolderHub Simulator STM32 Black Pill. Explore every pin on the STM32 Black Pill board page.
Highlighted on the SolderHub Simulator STM32 Black Pill. Explore every pin on the STM32 Black Pill board page.
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)
- In File → Preferences, add the board manager URL
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json. - Install STM32 MCU based boards in the Boards Manager, and install STM32CubeProgrammer from ST (needed for uploads).
- Select Board: Generic STM32F4 series, Board part number: BlackPill F411CE (or F401CC/CE for those chips).
- Set Upload method: STM32CubeProgrammer (DFU), or (SWD) with an ST-Link.
- Set USB support: CDC (generic 'Serial' supersede U(S)ART) so
Serialappears 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.
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
| Mistake | What happens | Fix |
|---|---|---|
| LED code written active-HIGH | LED is on when you expect off | PC13 is active LOW: LOW = on |
| Driving a load from PC13–15 | Weak or no output | Those pins sink ~3 mA; use another pin |
No Serial output over USB | USB CDC not enabled | Set USB support: CDC and reselect the port |
| DFU device doesn't appear | Bootloader timing quirk | Retry BOOT0 + NRST, or use an ST-Link |
| Board stops responding to the ST-Link | Sketch reused PA13/PA14 | Hold NRST while connecting ("connect under reset") |
| USART6 and USB fight | Both use PA11/PA12 | Use USART1 or USART2 instead |
| Servo and motor PWM interfere | Same timer, one frequency | Move one to a different timer |
| 5 V sensor on an analog pin | Pin is not 5 V tolerant in analog mode | Divide the signal to 3.3 V |
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 / clock | Cortex-M4F, 100 MHz | Cortex-M3, 72 MHz | Varies by model |
| RAM | 128 KB | 20 KB | Varies |
| USB | USB-C, ROM DFU bootloader | Micro-USB, needs a bootloader flashed | ST-Link USB |
| Programmer needed | No (DFU) | Usually (ST-Link or USB-serial) | No, built in |
| Counterfeit chips | Rare | Common | No |
| Arduino shields | No | No | Yes |
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.
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



