Most STM32 boards make you buy a separate ST-Link programmer before you can upload a single line of code. The Nucleo skips that problem entirely — it ships with a genuine ST-Link debugger built right onto the board, so you plug in one USB cable and you're flashing and debugging immediately, breakpoints included.
The tradeoff for that convenience is a pinout that looks intimidating at first glance: two different header systems stacked on top of each other, an Arduino-compatible set and a much larger ST-specific set, both exposing largely the same underlying pins under different names.
Once you understand why both exist, it stops being confusing and starts being genuinely convenient. Here's the full breakdown, using the popular NUCLEO-F411RE as the reference board — the Nucleo-64 family shares this exact layout across most of its models.
Nucleo-64 at a glance
| Question | Answer (NUCLEO-F411RE) |
|---|---|
| Chip | STM32F411RE, Cortex-M4F up to 100 MHz, 512 KB flash, 128 KB SRAM |
| Logic level | 3.3 V |
| Arduino header | Uno R3 layout (CN5, CN6, CN8, CN9) |
| ST Morpho headers | CN7 and CN10, 38 pins each |
| Debugger | ST-LINK/V2-1 on the same board, with a virtual COM port |
| Serial Monitor pins | USART2 on PA2/PA3, which are D1/D0 |
| User LED / button | LD2 on D13 (PA5), B1 on PC13 |
| Default I2C / SPI | I2C D14/D15, SPI D10–D13 |
| Power from VIN | 7–12 V, current falls as voltage rises |
What is on the board
A Nucleo-64 is really two boards on one PCB: an ST-LINK/V2-1 debugger section and the target STM32 section. Because the debugger is built in, there is no separate ST-Link purchase and no programmer cable. One USB cable flashes, debugs (with real breakpoints) and gives you a serial port. You can even snap the ST-LINK off along the perforation later if you want a bare MCU board, though most people never do.
This guide uses the NUCLEO-F411RE as the example. The Nucleo-64 family shares the same connector layout, but the exact STM32 pin behind each Arduino name can change between models, so always check your own board's user manual (UM1724).
Two header systems, one set of pins
Arduino Uno R3 headers (CN5, CN6, CN8, CN9) are female headers in the Uno's exact positions, so Arduino shields plug straight in. They carry the familiar names D0–D15, A0–A5, 5V, GND and VIN.
ST Morpho connectors (CN7, CN10) are two 38-pin male headers on the board edges. They expose almost every pin of the chip under its real port name (PA5, PB6, PC13).
Every Arduino pin is also on the Morpho headers. D13 and PA5 are the same wire. You can plug a shield into the Arduino headers and still probe those exact signals on Morpho.
The full Arduino to STM32 map (NUCLEO-F411RE)
| Arduino | Connector | STM32 pin | Role |
|---|---|---|---|
| D0 | CN9 | PA3 | USART2 RX (ST-LINK virtual COM port) |
| D1 | CN9 | PA2 | USART2 TX (ST-LINK virtual COM port) |
| D2 | CN9 | PA10 | |
| D3 | CN9 | PB3 | PWM (TIM2_CH2) |
| D4 | CN9 | PB5 | |
| D5 | CN9 | PB4 | PWM (TIM3_CH1) |
| D6 | CN9 | PB10 | PWM (TIM2_CH3) |
| D7 | CN9 | PA8 | |
| D8 | CN5 | PA9 | |
| D9 | CN5 | PC7 | PWM (TIM3_CH2) |
| D10 | CN5 | PB6 | PWM (TIM4_CH1), SPI chip select |
| D11 | CN5 | PA7 | PWM (TIM1_CH1N), SPI MOSI |
| D12 | CN5 | PA6 | SPI MISO |
| D13 | CN5 | PA5 | SPI SCK and the green LED LD2 |
| D14 | CN5 | PB9 | I2C SDA |
| D15 | CN5 | PB8 | I2C SCL |
| A0 | CN8 | PA0 | ADC1_0 |
| A1 | CN8 | PA1 | ADC1_1 |
| A2 | CN8 | PA4 | ADC1_4 |
| A3 | CN8 | PB0 | ADC1_8 |
| A4 | CN8 | PC1 (or PB9) | ADC1_11, or I2C SDA with solder bridges changed |
| A5 | CN8 | PC0 (or PB8) | ADC1_10, or I2C SCL with solder bridges changed |
Source: ST UM1724 (STM32 Nucleo-64 boards). The six PWM pins on the Arduino header are D3, D5, D6, D9, D10 and D11, the same set the Uno uses.
Four traps Nucleo newcomers hit
1. D0 and D1 are the ST-LINK serial port. They are USART2 (PA3/PA2), which is also what the on-board virtual COM port uses. A shield that drives D0/D1, or a wire you leave on them, will garble your Serial Monitor. Keep both free.
2. D13 is the LED and the SPI clock. PA5 drives LD2 and also SPI1 SCK. An SPI shield or display will flicker the green LED, and a wire on D13 loads the LED circuit.
3. I2C is D14/D15, not A4/A5. On a Uno, I2C is A4/A5. On a Nucleo, the default is D14 (SDA) and D15 (SCL). A4/A5 only carry I2C if you change the solder bridges (SB46 and SB52 ON, SB51 and SB56 OFF), which also stops them working as analog pins.
4. The analog pins are 3.3 V. Most digital pins tolerate 5 V, but any analog input must stay at or below 3.3 V. A 5 V analog sensor on an Arduino-shield analog pin can damage the chip.
Powering the board
| Source | How | Notes |
|---|---|---|
| USB | ST-LINK USB cable, JP5 on U5V (pins 1–2) | Default. Programming, debugging and serial over one cable |
| VIN | 7–12 V on CN6 pin 8 or CN7 pin 24 | Goes through the on-board regulator |
| E5V | Regulated 5 V on the Morpho connector | JP5 on E5V (pins 2–3) and JP1 removed |
VIN current drops as the input voltage rises, because the linear regulator turns the difference into heat. ST specifies a maximum of 800 mA at 7 V, 450 mA between 7 and 9 V, and 250 mA between 9 and 12 V. If you power motors or an LED strip from VIN, use a lower input voltage or, better, a separate 5 V supply with a shared ground.
LED and button
| Part | Pin | Notes |
|---|---|---|
| LD2, green user LED | D13, PA5 (PB13 on a few Nucleo-64 models) | Active HIGH: HIGH turns it on |
| B1, blue user button | PC13 (CN7 pin 23) | Reads LOW when pressed, HIGH when released |
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(USER_BTN, INPUT); // B1 is wired to PC13
}
void loop() {
digitalWrite(LED_BUILTIN, digitalRead(USER_BTN) == LOW ? HIGH : LOW); // LED on while pressed
}If USER_BTN is not defined for your board, use PC13 instead. Unlike the Black Pill's PC13 LED, the Nucleo LED is active HIGH, which matches Arduino conventions.
ADC and PWM
The ADC is 12-bit (0–4095) with up to 16 external channels. The Arduino header exposes A0–A5; the rest are on Morpho.
int value = analogRead(A0); // 0–4095, input must stay at or below 3.3 VPWM works on pins with a timer channel, not every GPIO. On the Arduino header those are D3, D5, D6, D9, D10 and D11; more are available on Morpho.
analogWrite(D9, 128); // about 50 % dutyUART, SPI and I2C
| Bus | Pins | Notes |
|---|---|---|
| USART2 | D1 (TX, PA2) / D0 (RX, PA3) | Routed to the ST-LINK virtual COM port, so it shows up as a COM port on your PC |
| USART1 | PB6 / PB7 | Free for your own peripherals (shared with D10 on the Arduino header) |
| SPI1 | D13 SCK (PA5), D12 MISO (PA6), D11 MOSI (PA7), D10 or any pin for chip select | Matches Arduino shield positions |
| I2C1 | D14 SDA (PB9), D15 SCL (PB8) | Default Arduino I2C |
USART2's virtual COM port is a major advantage over an Uno: you can debug over the same USB cable you program with, while other USARTs talk to a GPS or Bluetooth module.
Set up Arduino IDE for a Nucleo
- Install STM32CubeProgrammer from ST. The default upload method needs it.
- In Arduino IDE open File → Preferences and add this to Additional Boards Manager URLs:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json - Open Tools → Board → Boards Manager, search STM32 MCU based boards and install it.
- Choose Tools → Board → STM32 boards groups → Nucleo-64, then Board part number → Nucleo F411RE.
- Leave Upload method on STM32CubeProgrammer (SWD). Plug in the board over USB.
- Open the blink example and upload. Open the Serial Monitor on the ST-LINK COM port.
Use the on-board ST-LINK on another STM32 chip
The Nucleo can program and debug a separate STM32 target. Remove both CN2 jumpers, then connect the CN4 SWD header to your target:
| CN4 pin | Signal |
|---|---|
| 1 | VDD_TARGET (reference voltage from the target) |
| 2 | SWCLK |
| 3 | GND |
| 4 | SWDIO |
| 5 | NRST |
| 6 | SWO (reserved) |
Put the CN2 jumpers back to program the chip on the Nucleo again. If you use NRST from CN4, the manual says SB12 must be OFF.
Common mistakes and how to avoid them
Putting a 5 V analog signal on an analog pin. Analog inputs are 3.3 V only.
Leaving a wire on D0/D1 and then wondering why the Serial Monitor is garbled. Those pins are the virtual COM port.
Expecting A4/A5 to be I2C. The default Nucleo I2C is D14/D15.
Powering motors from VIN. At 9–12 V you only get about 250 mA.
Assuming the LED and button are on the same pins on every Nucleo-64. They are in the same positions, but the underlying STM32 pin can change between models.
Ignoring the Morpho headers. They expose far more pins and peripherals than the Arduino set.
Quick answers
Why two sets of headers? The Arduino headers give you shield compatibility. The Morpho headers give you nearly every STM32 pin under its real name.
Do I need a separate programmer? No. The ST-LINK is built in.
Are analog pins 5 V tolerant? No, 3.3 V maximum.
Can I use the Serial Monitor and another UART at once? Yes. USART2 is the virtual COM port; other USARTs stay free.
Will my Uno shields work? Most do. Shields that need 5 V analog signals or I2C on A4/A5 need attention.
Nucleo or Black Pill? The Nucleo adds a built-in debugger and Arduino shield compatibility. The Black Pill is smaller and cheaper. If you are coming from an Uno, read the Arduino Uno pinout guide side by side.
Sources
- ST UM1724: STM32 Nucleo-64 boards user manual
- Zephyr documentation for the Nucleo F411RE
- STM32duino Board Manager files
Pin assignments can differ between Nucleo-64 models, so confirm against the user manual for your exact board.



