Loading the figure…
ST's 84 MHz Cortex-M4 board with its own ST-LINK programmer: Arduino sockets on top, every pin on the morpho rows, 3.3 V logic, and one mini-USB cable for power, uploads and Serial.
Each lesson runs your own code on the board. Finish its checks to tick it off.
Build the board in the right order, then power it up and check it, as on the bench.
0 of 11 stepsPull the USB cable and anything on VIN or E5V. Never build or repair a live board.
Each fault really happens in the simulation. Trigger one, watch the figure, then read why.
The Nucleo-F401RE is two boards in one. The top third, behind a row of snap-off slots, is an ST-LINK/V2-1: an STM32F103 that runs from the mini-USB socket, programs the target over SWD and passes the target's Serial to your computer as a virtual COM port. Below it is the target: an STM32F401RE (Arm Cortex-M4F at 84 MHz, 512 KB of flash, 96 KB of RAM) with Uno-style Arduino sockets and two 38-pin ST morpho headers that carry every pin. Logic is 3.3 V, but most pins take 5 V as digital inputs. Three jumpers matter: JP5 picks USB or an external supply for +5V, JP6 links the 3.3 V regulator to the MCU (pull it to measure the current), and the two CN2 caps let the ST-LINK reach the target. In the Arduino IDE it is the STM32duino core's Nucleo-64 board: LED_BUILTIN is the green LD2 on D13, USER_BTN is the blue B1 on PC13, and Serial goes through the ST-LINK.
| Header | Pin | Name | Functions | Level | Max current | Notes |
|---|---|---|---|---|---|---|
| CN6 | 1 | NC | – | – | – | |
| CN6 | 2 | IOREF | I/O reference for shields (+3V3) | 3.3 V | – | Tied to +3V3: it tells a shield that this board's logic is 3.3 V. |
| CN6 | 3 | NRST | RESET (active low) | 3.3 V | – | LOW resets the STM32. Shared with B2 and with the ST-LINK, which pulls it during an upload. |
| CN6 | 4 | 3V3 | +3V3 from the LD39050 (U4) | 3.3 V | 500 mA | Output from U4, 500 mA shared with the MCU. It can be an input only when the ST-LINK is snapped off or SB2 and SB12 are open. |
| CN6 | 5 | 5V | +5V rail, output | 5 V | – | Output: +5V from USB (through T2) or from E5V/VIN with JP5 on 2-3. On USB, keep everything within the 300 mA budget. |
| CN6 | 6 | GND | GND | – | – | |
| CN6 | 7 | GND | GND | – | – | |
| CN6 | 8 | VIN | 7-12 V into the LD1117 (U3) | – | – | 7-12 V in, through the LD1117: 800 mA at 7 V, 450 mA up to 9 V, 250 mA up to 12 V. No reverse protection. Move JP5 to 2-3. |
| CN8 | 1 | A0 | PA0, ADC1_IN0 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN8 | 2 | A1 | PA1, ADC1_IN1 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN8 | 3 | A2 | PA4, ADC1_IN4 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN8 | 4 | A3 | PB0, ADC1_IN8 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN8 | 5 | A4 | PC1, ADC1_IN11 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN8 | 6 | A5 | PC0, ADC1_IN10 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN5 | 1 | D8 | PA9, USART1 TX | 3.3 V5 V tolerant | 20 mA | |
| CN5 | 2 | D9 | PC7, PWM TIM3_CH2 (1 kHz) | 3.3 V5 V tolerant | 20 mA | |
| CN5 | 3 | D10 | PB6, PWM TIM4_CH1, SPI CS | 3.3 V5 V tolerant | 20 mA | |
| CN5 | 4 | D11 | PA7, PWM TIM1_CH1N, SPI1 MOSI | 3.3 V5 V tolerant | 20 mA | |
| CN5 | 5 | D12 | PA6, SPI1 MISO | 3.3 V5 V tolerant | 20 mA | |
| CN5 | 6 | D13 | PA5, SPI1 SCK, LD2 | 3.3 V5 V tolerant | 20 mA | LD2 hangs on this pin through 510 Ω. It is also SPI1's clock, so LD2 flickers while SPI runs. |
| CN5 | 7 | GND | GND | – | – | |
| CN5 | 8 | AVDD | VDDA / VREF+ (analog supply and ADC reference) | 3.3 V | – | The ADC's reference (VDDA), tied to VDD through the ferrite L1. It sits where an Uno has AREF but is not an input. |
| CN5 | 9 | D14 | PB9, I2C1 SDA | 3.3 V5 V tolerant | 20 mA | I2C1 (Wire). The board has no pull-ups on it: the module or shield must bring them. |
| CN5 | 10 | D15 | PB8, I2C1 SCL | 3.3 V5 V tolerant | 20 mA | I2C1 (Wire). The board has no pull-ups on it: the module or shield must bring them. |
| CN9 | 1 | D0 | PA3, USART2 RX | – | – | Not connected by default: PA2/PA3 (USART2) go to the ST-LINK, so Serial reaches your computer instead. Closing SB62/SB63 brings them to the header. |
| CN9 | 2 | D1 | PA2, USART2 TX | – | – | Not connected by default: PA2/PA3 (USART2) go to the ST-LINK, so Serial reaches your computer instead. Closing SB62/SB63 brings them to the header. |
| CN9 | 3 | D2 | PA10, USART1 RX | 3.3 V5 V tolerant | 20 mA | |
| CN9 | 4 | D3 | PB3, PWM TIM2_CH2, SWO | 3.3 V5 V tolerant | 20 mA | |
| CN9 | 5 | D4 | PB5 | 3.3 V5 V tolerant | 20 mA | |
| CN9 | 6 | D5 | PB4, PWM TIM3_CH1 | 3.3 V5 V tolerant | 20 mA | |
| CN9 | 7 | D6 | PB10, PWM TIM2_CH3 | 3.3 V5 V tolerant | 20 mA | |
| CN9 | 8 | D7 | PA8 | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 1 | PC10 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 2 | PC11 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 3 | PC12 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 4 | PD2 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 5 | VDD | MCU supply, after JP6 | 3.3 V | – | The MCU's supply, after JP6. Measure here to check that JP6 is on. |
| CN7 | 6 | E5V | External 5 V in (4.75-5.25 V, JP5 on 2-3) | 5 V | – | External 5 V in (4.75-5.25 V), straight onto +5V when JP5 is on 2-3. No protection at all. |
| CN7 | 7 | BOOT0 | BOOT0 (low = run from flash), Strapping pin | 3.3 V | – | Pulled LOW on the board, so the STM32 runs your sketch from flash. A jumper to VDD (pin 5) starts ST's ROM bootloader instead. |
| CN7 | 8 | GND | GND | – | – | |
| CN7 | 9 | - | – | – | – | |
| CN7 | 10 | - | – | – | – | |
| CN7 | 11 | - | – | – | – | |
| CN7 | 12 | IOREF | I/O reference (+3V3) | 3.3 V | – | Tied to +3V3: it tells a shield that this board's logic is 3.3 V. |
| CN7 | 13 | PA13 | SWDIO | 3.3 V5 V tolerant | 20 mA | Used by the ST-LINK for SWD. Don't use these as I/O while it is connected. |
| CN7 | 14 | RESET | NRST (active low) | 3.3 V | – | LOW resets the STM32. Shared with B2 and with the ST-LINK, which pulls it during an upload. |
| CN7 | 15 | PA14 | SWCLK | 3.3 V5 V tolerant | 20 mA | Used by the ST-LINK for SWD. Don't use these as I/O while it is connected. |
| CN7 | 16 | +3.3V | +3V3 from the LD39050 (U4) | 3.3 V | 500 mA | Output from U4, 500 mA shared with the MCU. It can be an input only when the ST-LINK is snapped off or SB2 and SB12 are open. |
| CN7 | 17 | PA15 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 18 | +5V | +5V rail, output | 5 V | – | Output: +5V from USB (through T2) or from E5V/VIN with JP5 on 2-3. On USB, keep everything within the 300 mA budget. |
| CN7 | 19 | GND | GND | – | – | |
| CN7 | 20 | GND | GND | – | – | |
| CN7 | 21 | PB7 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 22 | GND | GND | – | – | |
| CN7 | 23 | PC13 | B1 USER, USER_BTN | 3.3 V5 V tolerant | 3 mA | B1's pin, with R30's 4.7 kΩ pull-up. PC13 sits in the backup domain: it sinks 3 mA at most and must not source current, so never drive an LED from it. |
| CN7 | 24 | VIN | 7-12 V into the LD1117 (U3) | – | – | 7-12 V in, through the LD1117: 800 mA at 7 V, 450 mA up to 9 V, 250 mA up to 12 V. No reverse protection. Move JP5 to 2-3. |
| CN7 | 25 | PC14 | LSE crystal X2 | – | – | Drives the 32.768 kHz crystal X2. Reaches CN7 only with SB48/SB49 closed. |
| CN7 | 26 | - | – | – | – | |
| CN7 | 27 | PC15 | LSE crystal X2 | – | – | Drives the 32.768 kHz crystal X2. Reaches CN7 only with SB48/SB49 closed. |
| CN7 | 28 | PA0 | A0, ADC1_IN0 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN7 | 29 | PH0 | OSC_IN (8 MHz clock from the ST-LINK) | 3.3 V | – | The clock pins: the ST-LINK's 8 MHz clock arrives on PH0 (OSC_IN). In oscillator mode they are not 5 V tolerant; leave them for the clock. |
| CN7 | 30 | PA1 | A1, ADC1_IN1 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN7 | 31 | PH1 | OSC_OUT | 3.3 V | – | The clock pins: the ST-LINK's 8 MHz clock arrives on PH0 (OSC_IN). In oscillator mode they are not 5 V tolerant; leave them for the clock. |
| CN7 | 32 | PA4 | A2, ADC1_IN4 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN7 | 33 | VBAT | RTC backup supply, tied to VDD | 3.3 V | – | The real-time clock's backup supply, tied to VDD through SB45. |
| CN7 | 34 | PB0 | A3, ADC1_IN8 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN7 | 35 | PC2 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 36 | PC1 | A4, ADC1_IN11 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN7 | 37 | PC3 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN7 | 38 | PC0 | A5, ADC1_IN10 | 3.3 V | 20 mA | An ADC input reads 0 to 3.3 V (AVDD). In analog mode the pin is not 5 V tolerant: 4.0 V at most, so power analog sensors from 3V3. |
| CN10 | 1 | PC9 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 2 | PC8 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 3 | PB8 | D15, I2C1 SCL | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 4 | PC6 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 5 | PB9 | D14, I2C1 SDA | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 6 | PC5 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 7 | AVDD | VDDA / VREF+ | 3.3 V | – | The ADC's reference (VDDA), tied to VDD through the ferrite L1. It sits where an Uno has AREF but is not an input. |
| CN10 | 8 | U5V | USB 5 V before the T2 switch | 5 V | – | USB's 5 V before the T2 switch: there as soon as the cable is in. |
| CN10 | 9 | GND | GND | – | – | |
| CN10 | 10 | - | – | – | – | |
| CN10 | 11 | PA5 | D13, SPI1 SCK, LD2 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 12 | PA12 | USB OTG FS D+ | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 13 | PA6 | D12, SPI1 MISO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 14 | PA11 | USB OTG FS D- | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 15 | PA7 | D11, SPI1 MOSI, PWM TIM1_CH1N | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 16 | PB12 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 17 | PB6 | D10, PWM TIM4_CH1 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 18 | - | – | – | – | |
| CN10 | 19 | PC7 | D9, PWM TIM3_CH2 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 20 | GND | GND | – | – | |
| CN10 | 21 | PA9 | D8, USART1 TX | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 22 | PB2 | BOOT1 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 23 | PA8 | D7 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 24 | PB1 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 25 | PB10 | D6, PWM TIM2_CH3 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 26 | PB15 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 27 | PB4 | D5, PWM TIM3_CH1 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 28 | PB14 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 29 | PB5 | D4 | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 30 | PB13 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 31 | PB3 | D3, PWM TIM2_CH2, SWO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 32 | AGND | GND | – | – | |
| CN10 | 33 | PA10 | D2, USART1 RX | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 34 | PC4 | GPIO | 3.3 V5 V tolerant | 20 mA | |
| CN10 | 35 | PA2 | USART2 TX | – | – | Not connected by default: PA2/PA3 (USART2) go to the ST-LINK, so Serial reaches your computer instead. Closing SB62/SB63 brings them to the header. |
| CN10 | 36 | - | – | – | – | |
| CN10 | 37 | PA3 | USART2 RX | – | – | Not connected by default: PA2/PA3 (USART2) go to the ST-LINK, so Serial reaches your computer instead. Closing SB62/SB63 brings them to the header. |
| CN10 | 38 | - | – | – | – | |
| CN4 | 1 | VDD_TARGET | target voltage sense | 3.3 V | – | The ST-LINK's own SWD port, for programming another board. Take the CN2 caps off to use it. |
| CN4 | 2 | SWCLK | SWD clock out | 3.3 V | – | The ST-LINK's own SWD port, for programming another board. Take the CN2 caps off to use it. |
| CN4 | 3 | GND | GND | – | – | |
| CN4 | 4 | SWDIO | SWD data | 3.3 V | – | The ST-LINK's own SWD port, for programming another board. Take the CN2 caps off to use it. |
| CN4 | 5 | NRST | target reset out | 3.3 V | – | The ST-LINK's own SWD port, for programming another board. Take the CN2 caps off to use it. |
| CN4 | 6 | SWO | trace in | 3.3 V | – | The ST-LINK's own SWD port, for programming another board. Take the CN2 caps off to use it. |
Sensors and actuators this board drives, with the real connections.
An LED on PWM pin D9 through 220 Ω: about 5 mA from 3.3 V.
| Part pin | Board pin |
|---|---|
| A | D9Wire colour orange |
| K | GNDWire colour black |
Always use a resistor. A blue or white LED needs about 3 V itself, so from a 3.3 V pin it glows only faintly.
One side to D2, the other to GND, with INPUT_PULLUP. The blue B1 on PC13 needs no wiring at all.
| Part pin | Board pin |
|---|---|
| 1 | D2Wire colour blue |
| 3 | GNDWire colour black |
Ends to GND and 3V3, wiper to A0: analogRead() gives 0-4095 after analogReadResolution(12).
| Part pin | Board pin |
|---|---|
| 1 | GNDWire colour black |
| W | A0Wire colour yellow |
| 3 | 3V3Wire colour red |
Power it from 3V3, never 5V: an ADC input in analog mode takes 4.0 V at most, and reads 4095 for anything above 3.3 V.
Runs from 3V3 on A1: 750 mV at 25 °C and 10 mV per °C.
| Part pin | Board pin |
|---|---|
| +Vs | 3V3Wire colour red |
| Vout | A1Wire colour yellow |
| GND | GNDWire colour black |
Signal on PWM pin D9; the 3.3 V pulse is enough for most hobby servos.
| Part pin | Board pin |
|---|---|
| SIG | D9Wire colour orange |
| GND | GNDWire colour brown |
Power it from its own 5 V supply and join the grounds. On USB the whole board has 300 mA, and a servo starting takes more.
VCC on 5V, TRIG on D7, ECHO on D8. D8 (PA9) is 5 V tolerant, so the 5 V echo needs no divider here.
| Part pin | Board pin |
|---|---|
| VCC | 5VWire colour red |
| TRIG | D7Wire colour yellow |
| ECHO | D8Wire colour green |
| GND | GNDWire colour black |
Take ECHO to a digital pin, never to an input you read with analogRead(): in analog mode a pin takes 4.0 V at most.
VCC on 3V3, SDA on D14, SCL on D15. The GY-521 brings the I2C pull-ups the Nucleo lacks.
| Part pin | Board pin |
|---|---|
| VCC | 3V3Wire colour red |
| GND | GNDWire colour black |
| SCL | D15Wire colour yellow |
| SDA | D14Wire colour blue |
A 0.96 inch I2C OLED runs at 3.3 V on D14/D15; most modules carry their own pull-ups.
| Part pin | Board pin |
|---|---|
| GND | GNDWire colour black |
| VCC | 3V3Wire colour red |
| SCL | D15Wire colour yellow |
| SDA | D14Wire colour blue |