🛠 Premier Blink Arduino sur la Nucleo-F401RE avec le core STM32duino

STM32 Nucleo-64 famille F4 — phare : Nucleo-F401RE · debutant · Schéma : IMG-stm32f4-nucleo-debutant-2-stm32f4nuc-blink-arduino-stm32duino.svg — Nucleo-F401RE branchée en micro-USB à un PC affichant l'Arduino IDE 2 avec la carte Nucleo F401RE sélectionnée, LED LD2 clignotante

Goals

Set up the STM32duino core (Arduino_Core_STM32) and upload your first sketch to the Nucleo-F401RE. The board name inside the core is NUCLEO_F401RE, supported since core 0.2.1 — the oldest and best-documented of the Nucleo F4 family (F411RE since 0.2.1, F446RE since 1.1.1, F410RB since 2.11.0).

Hardware

Steps

https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json

  1. Arduino IDE 2 → File → Preferences → add the Boards Manager URL:
  2. Boards Manager → install the STM32F4 boards pack from the ST STM32 core.
  3. Tools → Board → STSTM32F4 Boards → Nucleo F401RE.
  4. Plug the board in ; the ST-LINK enumerates a virtual COM port automatically — no driver dance on a modern OS.
  5. Upload the sketch below, then open the serial monitor at 115200.

Code

const int kLedPin = LED_BUILTIN;  // PA5 = on-board LD2 (variant header: LED_GREEN PA5)

void setup {
  pinMode(kLedPin, OUTPUT);
  Serial.begin(115200);           // USART2 via the ST-LINK virtual COM port
}

void loop {
  digitalWrite(kLedPin, HIGH); delay(150);
  digitalWrite(kLedPin, LOW);  delay(150);
  Serial.println("tick");
}

Expected result

LD2 blinks at about 3 Hz and the serial monitor (115200 baud, the ST-LINK VCP) prints tick on every half-period. The core also ships an examples/ tree (blink, sensors, comms) that compiles for NUCLEO_F401RE out of the box — the fastest way to grow from this sketch.

Common mistakes

Autres tutoriels pour cette carte

Exemples de code pour cette carte

← Retour à la fiche 🛠 Tous les tutoriels