🛠 Dual-core M7+M4 et récupération DFU
Objectives
Leverage the two "system" strengths of the GIGA R1 WiFi: the true dual-core of the STM32H747XI (Cortex-M7 up to 480 MHz + Cortex-M4 up to 240 MHz, programmable separately — for example, Arduino on one, MicroPython on the other, with RPC between them) and native DFU recovery when an upload fails or the 1DX radio module firmware is bricked. You will learn how to restore a bricked board.
Hardware
- Arduino GIGA R1 WiFi board + USB-C cable
- Arduino IDE 2.x with both cores: "Arduino Mbed OS Giga Boards" and/or "Arduino Zephyr Boards" (FQBN
arduino:zephyr:giga, variantarduino_giga_r1_stm32h747xx_m7) - MicroPython officially supported on the board (image to flash for the M4 core or the board, depending on Arduino documentation)
- Command-line tool
dfu-util
Complete Code
M7 core sketch (Arduino side) — the M4 core is programmed separately (MicroPython or second core):
// GIGA R1 WiFi — preuve de vie du coeur M7 + coordination avec le M4
// Le M7 (480 MHz) gere ici le WiFi et la console ; le M4 (240 MHz), programme
// separement (ex. MicroPython officiel), communique avec lui par RPC selon la
// section "Dual Core" de docs.arduino.cc/hardware/giga-r1-wifi.
#include <WiFi.h>
void setup {
Serial.begin(115200); // console sur M7
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("M7 actif — en attente du M4 (flasher MicroPython a cote)");
WiFi.begin("your-ssid", "your-pass");
}
void loop {
static unsigned long t = 0;
if (millis - t > 1000) { // heartbeat 1 Hz sur M7
t = millis;
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
Serial.print("M7 up, WiFi=");
Serial.println(WiFi.status == WL_CONNECTED ? "OK" : "...");
}
}
DFU recovery (terminal, board in bootloader mode):
# Entrer en bootloader : double-tap sur le bouton reset (touche 1200 bps)
# ou via la commande de reboot du core. Le device passe en PID 0x0366.
dfu-util -l # liste : VID 0x2341, PID 0x0366 attendu
dfu-util -a 0 -s 0x08000000:leave -D firmware.bin # reflash du binaire du core
# Firmware radio 1DX brické (plus de WiFi du tout) : lancer le sketch
# FlashFormat fourni avec le core pour restaurer le module.
Expected Verification
The M7 sketch blinks the LED at 1 Hz and announces the WiFi status. By flashing MicroPython onto the board according to the official procedure, the interpreter responds on an independent console — proof that the two worlds coexist (the M7↔M4 RPC examples from the Arduino documentation work on top of this). In DFU mode, dfu-util -l correctly lists a 2341:0366 device, and reflashing restores a board that refused to upload.
Common Errors
- Looking for a universal "startM4": Unlike the Portenta, the GIGA's dual-core architecture is organized around separate flashing of the cores (Arduino + MicroPython, RPC) as described in the Dual Core section of the official documentation; there is no single identical API depending on the core used.
- Wrong PID in DFU: In normal operation, the USB device is
0x2341:0x0666; in bootloader mode, it becomes0x2341:0x0366. Ifdfu-utilsees nothing, the bootloader is not active (try the double-tap again). - WiFi dead after a failed update: The 1DX module firmware can be bricked by bad updates — this is the use case for the FlashFormat sketch, which should be tried before any full reflash.
- Incorrect
-s 0x08000000: The flash address for the H747 indeed starts at 0x08000000, but:leaveis necessary to restart the board after writing; forgetting it leaves the board in bootloader mode. - Overcoming 2 MB of flash: With 2 MB of dual-bank flash and 1 MB of RAM, large sketches (LVGL, vision) reach the limits of the application partition; Zephyr cores document an LLEXT loader at 0x08040000 to offload code — an advanced topic detailed in the platform sheet.
Other tutorials for this board
Code examples for this board
clignotante.inoArduinobouton.inoArduinorespiration.inoArduinoanalogique.inoArduinodac-onde.inoArduinooled-i2c.inoArduino