🛠 Migrer un projet mbed Nucleo-F4 en 2026 : Mbed CE, Zephyr ou CubeIDE

STM32 Nucleo-64 famille F4 — phare : Nucleo-F401RE · avance · Schéma : IMG-stm32f4-nucleo-avance-9-stm32f4nuc-migration-projets-mbed-2026.svg — un projet mbed marqué plateforme fermée en juillet 2026 se divise en trois chemins maintenus : Mbed CE, Zephyr RTOS et STM32CubeIDE

Goals

You (or a tutorial you are following) built a Nucleo-F4 project on the online mbed platform. That platform is gone: mbed's online services were sunset in July 2026 and Mbed OS is no longer actively maintained by Arm. This tutorial maps the migration options — Mbed CE, Zephyr, STM32CubeF4/CubeIDE — and ports a classic mbed blinky to each destination.

Why this matters

The Nucleo line launched in February 2014 with mbed IDE support as a headline feature (ST joined mbed in December 2013). A decade of Nucleo tutorials, sample code and blog posts assume the mbed website. None of it works as written anymore.

Option A — Mbed CE (closest to zéro changes)

The community fork mbed-ce/mbed-os (github.com/mbed-ce/mbed-os) continues Mbed OS. Your DigitalOut/Serial code survives ; the toolchain moves from the dead website to mbed CLI and local builds.

// mbed CE — compiles essentially unchanged from the old online project
#include "mbed.h"

DigitalOut led(LED1);        // LED1 = LD2 = PA5 on Nucleo boards
int main {
    while (true) {
        led = !led;
        This::wait(500ms);
    }
}

Option B — Zephyr (in-tree board, long-term support)

nucleo_f401re is an in-tree Zephyr board. The mbed DigitalOut led(LED1) becomes a devicetree alias lookup:

#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
int main(void) {
    gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE);
    while (1) { gpio_pin_toggle_dt(&led); k_msleep(500); }
}

Build: west build -b nucleo_f401re <app>; flash: west flash (STM32CubeProgrammer runner by default, OpenOCD or J-Link also work over the on-board ST-LINK).

Option C — STM32CubeF4 / CubeIDE

ST's package ships projects for the STM32F401RE-Nucleo; clone --recursive and regenerate pin configuration in CubeMX. This is also the path if you need the licensed middleware (STemWin, TouchGFX, STM32_Audio) — click-through, available only from st.com with an account.

Migration checklist

  1. Export and archive the old project source before more links rot.
  2. Replace timing: mbed Ticker/Timeout → Zephyr k_work_delayable/threads, or HAL timers.
  3. Replace Serial pc(USBTX, USBRX) → USART2 on PA2/PA3, the ST-LINK VCP (the Arduino core names it plain Serial).
  4. Re-check the memory budget per variant: F401RE has 512 KB flash / 96 KB SRAM, but the F410RB only 128 KB / 32 KB — a binary that fit the F401 may not fit its little sibling.

Expected result

The same LD2 heartbeat on a maintained toolchain, with a written-down mapping for every mbed API your project used.

Common mistakes

Autres tutoriels pour cette carte

Exemples de code pour cette carte

← Retour à la fiche 🛠 Tous les tutoriels