After local compilation photon seems not to run application code

TL;DR: when I flash my photons with binaries I’ve compiled locally, they don’t seem to run any application code

setup: local compilation on OSX using the ‘develop’ branch in the ‘firmware’ repo, targeting the photon and building user apps from the ‘main’ directory like:

make PLATFORM=photon APP=tinker

The code compiles, but when I flash it to a photon using the CLI (both OTA and usb give the same results), the photon connects to the cloud (breathing cyan) but does not seem to run the application code in the binary. It seems to do just fine if I’m compiling and flashing via the web IDE

For example, I flashed a photon with the “blink an led” example in the web IDE, and the LED blinks as it should.

I then copied the code from the “blink an led” example into a new blink.cpp file, added the very important

#include "application.h"

and placed it in the folder: ‘firmware-develop/user/applications/blink/’

I can get it to compile from ‘firmware-develop/main’ with:

make PLATFORM=photon APP=blink

and then flash it to the photon with either

particle flash <nameofphoton> ../build/target/user-part/platform-6-m-lto/applications/blink/blink.bin

or put the photon in dfu mode and run:

particle flash --usb ../build/target/user-part/platform-6-m-lto/applications/blink/blink.bin

after flashing, the core connects to the cloud (breathing cyan), but the LED doesn’t blink. I’ve also tried it with tinker, and a similar thing happens:

particle list

shows that this photon is online, but doesn’t list any of the tinker functions or variables. I’ve also tried it with a couple simple test apps to see if I can see serial output from the photon - nope.

I feel like I must be missing something really simple. Any thoughts?


see: Photon not flashing correctly, or always flashing with tinker


can’t believe I missed that one! Was mainly reading in ‘firmware’… Thanks, @kennethlimcp.

1 Like