🛠 Build local avec Device OS, ARM GCC et Particle CLI

Particle Photon · avance · Schéma : IMG-particle-photon-avance-3-photon-build-local.svg — chaîne de build locale : sources C++, make et ARM GCC du dépôt device-os produisant firmware.bin flashé par Particle CLI

Objectives

Free yourself from any online IDE (the old Web IDE has been removed): the currently recommended workflow is to compile the device-os repository with make and ARM GCC, then flash it using the Particle CLI, either OTA or via USB.

Hardware

Complete Code

// photon-build-local.ino — projet minimal pour build local
// Arborescence type :
//   mon-projet/src/mon-projet.ino
//   mon-project/Makefile   (incluant build.mk du dépôt device-os)
#include "application.h"

void setup {
  pinMode(D7, OUTPUT);
  Serial.begin(9600);
  Serial.println("Build local ARM GCC - OK");
}

void loop {
  digitalWrite(D7, HIGH); delay(300);
  digitalWrite(D7, LOW);  delay(300);
}

Expected Verification

In the device-os repository (or a project template that includes it), the command make all (confirmed by the repository's README) produces a firmware.bin file in the build folder. Then: particle flash <device_name> firmware.bin via OTA, or via USB DFU (hold SETUP, press RESET, blinking yellow LED) for a wired flash. The Device OS used must be a 2.x LTS version, as the 1.x and 3.x branches are end-of-life.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials