Hi All,
I need some help with local compile I had it working a few days back but now it does not work at all for me.
To try and debug I have created a very short test code.
#include "application.h"
void setup()
{
Serial.begin(9600);
delay(20000);
}
void loop()
{
Serial.println("Top of Loop");
delay(1000);
Serial.println("Bottom of Loop");
delay(1000);
}
I can compile and flash this with the Particle-DEV ide no problem
When I compile locally I get
C:\spark\firmware\main>make PLATFORM=photon clean all APP=photon
32+0 records in
32+0 records out
32 bytes (32 B) copied, 0.001 seconds, 32 kB/s
4+0 records in
4+0 records out
4 bytes (4 B) copied, 0.117 seconds, 0.0 kB/s
rm: cannot lstat `../../../build/target/user-part/platform-6-m-lto/applications/photon/photon.bin': No such file or directory
text data bss dec hex filename
2036 40 336 2412 96c ../../../build/target/user-part/platform-6-m-lto/applications/photon/photon.elf
Which looks correct to me
But when I flash it to the Photon the RGB led goes through the following sequence of events
Brighter magenta
a couple magenta flashes
off for a bit with D7 on
breathes white
green flashes
cyan flashes
and then it ends up in the breathing magenta forever.
Any ideas why this is happening?
@HardWater, with the separate system and user areas, using local compile requires that the system image matches the firmware version you have in your repo clone. If the system on the Photon doesn’t match, the dynamic link tables will be incorrect and your app won’t work.
The best way to fix this is to switch to the firmware/modules directory, put your Photon in DFU mode and run:
make clean all PLATFORM=photon program-dfu
MAKE SURE you are in the “modules” directory when running this. This will compile and update the system firmware on the Photon to the version you have in your clone.
Next SWITCH BACK (this is important) to firmware/main directory and put your Photon in DFU mode again. From there, you can compile your app and I suggest you do a clean version:
make clean all APP=yourapp PLATFORM=photon program-dfu
This should hopefully fix your issue!
6 Likes
Thanks @peekay123 I will give it a whirl.
1 Like
@peekay123 Hey that worked great.
I had a little problem getting program-dfu to work at first. The problem was that its location was not in my path.
Thanks Again
1 Like
This happened to me after many hours of successful compilation, flashing, and troubleshooting on the local cloud. Something happened and my photons would no longer accept OTA updates. I tried flashing my binaries over USB, which worked, but those binaries would only run in safe mode. However photon-tinker.bin in particle-cli/binaries would flash and run properly both OTA and with USB.
I was able to use this solution to recover. Due to my setup, my compilation host is unable to connect to photons with USB, so I used the advice from @peekay123 to compile. Then I copied the binary artifacts to a machine that can connect with USB, and used the steps: