🛠 Mises à jour OTA et flash local DFU avec Particle CLI
Objectives
The Boron bootloader accepts several update paths: OTA via the Particle cloud (remote particle flash), USB in DFU mode, Serial Y-Modem, and even factory re-flashing via buttons. Knowing how to switch between OTA and DFU is the absolute troubleshooting skill: a board that no longer boots, firmware that crashes before cloud connection, or a device "bricked" by deep discharge can be recovered in DFU. You will learn both workflows, Device OS version management (the BRN404X requires 4.x LTS and cannot run on 2.x), and listening mode for network reconfiguration.
Hardware
- 1× Particle Boron + micro-USB data cable
- Particle CLI installed and authenticated (
particle login) - Optional for full debugging: 10-pin SWD connector + debugger (the Boron exposes SWD natively)
Complete Code
The test firmware, intentionally verbose to observe each step:
// Boron — firmware de test de mise a jour
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup {
Serial.begin(9600);
Serial.println("Firmware v2 OK"); // changez le numero a chaque flash
Cellular.on;
Cellular.connect;
}
void loop {
if (Cellular.ready) {
Particle.publish("fw", "v2", PRIVATE);
}
delay(300000);
}
The workflow commands:
# 1) OTA par le cloud (device online) :
particle list
particle flash <device> firmware.bin
# 2) Local via USB, device en mode normal :
particle flash --usb firmware.bin
# 3) DFU (device injoignable) : maintenir Reset, pulsation courte sur MODE,
# relacher Reset, la LED clignote en jaune -> mode DFU
particle flash --usb firmware.bin
# ou en bas niveau :
dfu-util -d 2b04:d00d -a 0 -s 0x1000:leave -D firmware.bin
# 4) Revenir en mode normal si bloque :
particle usb start-mode normal
particle doctor
Expected Verification
In OTA: particle flash ends with "Flashing was successful" and the device comes back online with the new version (new serial line "Firmware v2 OK", fw event published). In DFU: the LED turns blinking yellow before flashing, dfu-util lists the device (dfu-util -l), and the board restarts on the new firmware. Recovery test: flash a firmware that crashes, then recover it in DFU — this is your safety net.
Common Errors
- Confusing listening mode (cyan, network reconfiguration) and DFU (yellow, flash): button gestures differ by the duration of holding MODE, follow the official modes guide.
- Flashing firmware compiled for Device OS 2.x/3.x on a BRN404X: incompatible, it requires 4.0.0+; also align your entire fleet on a single version.
dfu-util: no device matched: cable without data lines, missing DFM driver on Windows, or wrong mode — checkparticle usb dfuand Device Manager.- Unplugging during flash write: possible software brick; DFU mode remains your fallback, keep a signed backup binary handy.
- Relying on OTA for a device that has never connected: without a cellular link (antenna, SIM, coverage), only the USB path works.
Other tutorials for this board
Code examples for this board
clignotante.inoArduinobouton-evenement.inoArduinofonction-distance.inoArduinocapteur-dht.inoArduinoruban-neopixel.inoArduinopwm-respiration.inoArduino