Flashing -> safe mode -> previous code?

Hi all,

Hopefully someone can help me:
After I have compiled my code and flash it into my Particle Photon, It is running for about 5 seconds, then it is starting flashing magenta. I guess it is the safe mode. After flashing magenta, it starts flashing green until it is connected to the cloud and running stable.
The weird thing is that the code it is finally running has the functionality of the code which was already in flash and not my recently compiled and flashed code. What can be the problem?

The same code is running on an other Photon with firmware version 0.7.0-rc.2 and this Photon is running 0.7.0

What can be wrong?

Is your Photon part of a product, using the products feature in https://console.particle.io?

If so, it will immediately get the released product firmware for that device upon connecting to the cloud, replacing the firmware you just flashed. You need to remove the device from the product or use Mark as Development Device to prevent that.


There are also some other possible reasons for that behaviour

  • your running code is preventing the flash to actually stick - often the case when using SYSTEM_THREAD(ENABLED) - to work around this, you could put your device in Safe Mode first and then start the update
  • your device bootloader isn’t fully functional - you can reflash it via particle flash --serial bootloader-0.7.0-photon.bin
  • the connection is instable for any other reason

To tell whether your update did actually stick at any point, you should get an app/hash event in console.particle.io/logs that informs you about the hash code of the app most recently flashed. If you don’t get that event, the update didn’t stick.


Hi rickkas7 and ScruffR,

Thank you for your reply. The solution of rickkas7 is probably thecorrect one. I thought I removed all my devices from my product, but there was only 1 left in the product, and guess which one :slight_smile:
Thank you for helping, I will test it this evening!