🛠 Le core Zephyr : sketches ELF chargés à chaud via llext (fin du reflash complet)
Objectives
The ArduinoCore-zephyr core is set to replace the Mbed core on all supported devices, including the Portenta H7. The concept: a precompiled Zephyr loader remains on the board, and your sketch — compiled as a standalone ELF — is hot-loaded via llext, without a full reflash or reset. Since core release 0.90.0, the loader is automatically installed on the first upload. You will install the core, understand the loading model, and use the Zephyr shell in Debug mode to diagnose loading failures.
Hardware
- 1 × Arduino Portenta H7 + USB-C data cable
- Arduino IDE 2.x / Arduino CLI with the “Arduino Zephyr Boards” platform
- For deep troubleshooting: USB-UART adapter on pins TX0/RX0 (the USB console may be silent if the OS crashes)
- Serial console at 115200 baud
Complete Code
// zephyr_blink.ino — API Arduino standard sur Zephyr RTOS
// 1. Installe "Arduino Zephyr Boards" dans le Board Manager
// 2. Choisis Portenta H7 ; le premier upload installe le loader
// automatiquement (core >= 0.90.0, cible arduino_portenta_h7//m7)
// 3. Les uploads suivants chargent le sketch sans reset complet.
#include <Arduino.h>
void setup {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop {
digitalWrite(LED_BUILTIN, HIGH);
delay(200);
digitalWrite(LED_BUILTIN, LOW);
delay(800);
}
// Astuce du README : compiler en mode Debug pour obtenir le Zephyr
// shell sur la serie par defaut, puis la commande `sketch` lit les
// erreurs de chargement llext.
Expected Verification
After the first upload (loader installation), subsequent uploads are nearly instantaneous on the board side: the sketch starts without the full reflash cycle. In Debug mode, the Zephyr shell responds on the serial port, and the sketch command displays the status of the loaded ELF — the #1 diagnostic tool when nothing starts. The upstream build of the loader is done with ./extra/build.sh portentah7 (target arduino_portenta_h7//m7).
Common Errors
- Sketch fails to load, with no message: switch to Debug mode and read the llext shell; many failures come from unexported symbols — the Zephyr function you need is not yet exposed to sketches (the documented workaround is to add it via
llext_exports.c). - Insufficient stack during loading: loading via the Zephyr shell requires a substantial stack; on RAM-tight builds, the README recommends reducing the shell stack in the board’s .conf.
- Silent console after an OS crash: USB serial depends on live firmware — this is where the USB-UART adapter on TX0/RX0 saves the session (official README advice).
- Mixing Mbed core and Zephyr core on the same board without understanding: APIs, library compatibility, and flash models differ; migration is ongoing and not everything is exported yet.
- Recovering a “bricked” board: double-tap RESET (MCUboot bootloader mode) + “Burn bootloader” in the IDE to start from a clean base.
- >
Other tutorials for this board
- Premier programme : installer le core et faire clignoter la LED (M7 à 480 MHz !)
- Se connecter au Wi-Fi avec le module Murata 1DX (station WPA2)
- Apprivoiser les connecteurs 80 broches : bouton, LED et entrée analogique
- Dual-core M7 ↔ M4 : appels de fonctions distants avec la bibliothèque RPC
- Client HTTPS/TLS : interroger une API sécurisée via le Murata 1DX
- Serveur web sur le port Ethernet 10/100 embarqué
Code examples for this board
clignotante.inoArduinobouton-poussoir.inoArduinopwm-respiration.inoArduinoentree-analogique.inoArduinomulti-uart.inoArduinocapteur-i2c-bmp280.inoArduino