🛠 Prise en main de la Nucleo-F401RE : ST-LINK, LED LD2 et alimentation
Goals
Meet the STM32 Nucleo-64 boards built around STM32F4 MCUs — Nucleo-F401RE, F410RB, F411RE and F446RE — using the flagship Nucleo-F401RE (MB1136 reference board) as the reference. By the end of this tutorial you will know what each chip, LED and jumper on the board does, and you will have made the on-board user LED blink with zéro external wiring.
Hardware
- 1× Nucleo-F401RE (any Nucleo-64 F4 board works the same way)
- 1× micro-USB cable that carries data (the board connector is micro-B, full-speed)
- Any PC with a USB port — no external debugger needed, the ST-LINK is on board
The facts that matter
- MCU (flagship F401RE): ARM Cortex-M4F, single core, 84 MHz, single-precision FPU + DSP instructions, 512 KB flash, 96 KB SRAM, LQFP64 package. VDD range 1.7–3.6 V.
- On-chip peripherals: 12-bit ADC with 16 channels, RTC, 1 advanced-control + 7 general-purpose timers, 2 watchdogs, 3× USART/UART, 3× I2C, 4× SPI, SDIO, USB 2.0 OTG FS, DMA controller, I2S.
- ST-LINK/V2-1 on board enumerates as three devices at once: SWD debugger, virtual COM port, and USB mass-storage device.
- LEDs: LD1 (USB/COM), LD2 (user, on PA5), LD3 (power). Buttons: USER and RESET.
- Power: USB VBUS or an external source at 3.3 V, 5 V or 7–12 V, selected by power jumpers. >
Steps
- Check the board jumpers are at factory default (USB power, 3.3 V rail feeding the MCU).
- Plug the micro-USB cable into the board connector and your PC. LD3 (power) comes on immediately.
- In your OS device manager, the ST-LINK should enumerate as a debugger + COM port (+ mass storage).
- Flash the smoke-test sketch below (any toolchain — the next tutorial covers Arduino STM32duino).
Smoke-test code
void setup { pinMode(LED_BUILTIN, OUTPUT); } // LED_BUILTIN = PA5 = LD2
void loop {
digitalWrite(LED_BUILTIN, HIGH); delay(200);
digitalWrite(LED_BUILTIN, LOW); delay(1800);
}
Expected result
LD2 (green) blinks once per second ; LD3 stays on ; LD1 follows USB activity. Your program runs from bare flash — there is no end-user bootloader (no UF2/CircuitPython drive) ; code goes in through the on-board ST-LINK over SWD, or the ROM serial bootloader.
Common mistakes
- Expecting the MCU's USB OTG peripheral on the board connector: the micro-USB socket talks to the ST-LINK side, not to the F401's OTG pins (those sit on the morpho headers).
- A charge-only cable: no COM port ever appears — try another cable.
- Hunting for datasheets with scripts: st.com blocks non-browser fetchers — download UM1760 (board manual) and RM0368 (reference manual) from a browser.
- >
Autres tutoriels pour cette carte
- Premier Blink Arduino sur la Nucleo-F401RE avec le core STM32duino
- Console série sur le ST-LINK VCP : printf, ADC 12 bits et piège du USB
- STM32CubeF4 et HAL : blink + UART printf générés pour la Nucleo-F401RE
- ADC 12 bits et PWM sur la Nucleo-F401RE : oversampling, millivolts et LED en fondu
- Zephyr RTOS sur la Nucleo-F401RE : west build, devicetree et west flash
- Bare-metal sur le STM32F401 : clignoter LD2 en écrivant les registres GPIO