🛠 Mises à jour OTA et sauvetage par USB DFU

Particle Photon · avance · Schéma : IMG-particle-photon-avance-2-photon-ota-dfu.svg — deux chemins de flash du Photon : OTA par le cloud vers la zone de sauvegarde 128 Ko, et USB DFU en bootloader

Objectives

Master the two firmware update methods: wireless update via Particle Cloud (enabled by the 128 KB OTA backup flash zone described in the datasheet's memory map) and USB DFU recovery mode when nothing else works.

Hardware

Complete Code

// photon-ota-dfu.ino — firmware versionne pour tester le canal OTA
// Compilation puis flash OTA :
//   particle flash <nom_du_device> .
// ou depuis un binaire compile :
//   particle flash <nom> firmware.bin
// Par REST aussi : PUT /v1/devices/<id> avec -d file=@firmware.bin

SYSTEM_THREAD(ENABLED);

void setup {
  pinMode(D7, OUTPUT);
  Serial.begin(9600);
  Serial.println("Firmware v2.0 - canal OTA operationnel");
  Serial.println(System.version);   // version du Device OS installe
  // Recommandation officielle : rester sur la branche 2.x LTS,
  // les versions 1.x et 3.x sont en fin de support.
}

void loop {
  digitalWrite(D7, HIGH); delay(100);
  digitalWrite(D7, LOW);  delay(100);   // motif rapide = v2
}

Expected Verification

After running particle flash <name> ., the Photon downloads the binary over Wi-Fi, blinks in two colors during writing, then restarts with the new firmware (fast D7 LED, serial trace v2.0). In case of a broken firmware: hold SETUP, press RESET, the LED blinks yellow (DFU mode confirmed by the datasheet), then flash via USB with the appropriate DFU tool to restore a Device OS 2.x LTS.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials