🛠 Build local avec Device OS, ARM GCC et 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
- A Linux, macOS, or Windows computer (WSL or native tooling depending on the repository notes)
- ARM GCC toolchain (cortex-m3), GNU make, git, Node.js for the Particle CLI
- 1 Particle Photon with a good USB cable
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
- Compiling with an unsupported Device OS: the datasheet mandates the 2.x LTS range under extended support.
- Missing or incorrectly versioned ARM toolchain: make fails on cortex-m3; install a recent gcc-arm-none-eabi.
- >
- Flashing a binary compiled for another board (Electron or Photon 2/P2): the firmware is specific to the Photon (STM32F205 + BCM43362).
- Device OS is LGPLv3: your proprietary application remains legal, but keep the system's license intact.
Other tutorials for this board
Code examples for this board
clignotante.inoArduinobouton-evenement.inoArduinofonction-distance.inoArduinocapteur-dht.inoArduinoruban-neopixel.inoArduinopwm-respiration.inoArduino