# Device reverts to previously flashed code

**URL:** https://community.particle.io/t/device-reverts-to-previously-flashed-code/55341
**Category:** Firmware
**Tags:** photon
**Created:** [March 26, 2020, 12:00am UTC](https://community.particle.io/t/device-reverts-to-previously-flashed-code/55341 "2020-03-26T00:00:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![anpl0907](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@anpl0907](https://community.particle.io/u/anpl0907)
#### Post date: [March 26, 2020, 12:00am UTC](https://community.particle.io/t/device-reverts-to-previously-flashed-code/55341/1 "2020-03-26T00:00:49Z")

</div>

Hi,

I am starting on a new project where my device reads data from a couple sensors. My code filters the data and prints data in the terminal. I am using a photon from a previous project. My issue occurs when I flash new code to my device from safe mode or any mode for that matter. The photon works as expected and then after about 20-30seconds, the LED turns red then white and then starts running the code from the previous project.

I have tried updating device firmware and resetting the device.  
I don’t think that I have to update anything in the web IDE right?

---

<div class="post-metadata">

### Author: ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)
#### Post date: [March 26, 2020, 7:25am UTC](https://community.particle.io/t/device-reverts-to-previously-flashed-code/55341/2 "2020-03-26T07:25:53Z")

</div>

> [@anpl0907](#):
>
> I am using a photon from a previous project.

Has that Photon been assigned to a _product_ (using `PRODUCT_ID()` in code or assigned via the console)?  
That would cause the behaviour you are seeing.

You need to release the device from the product.

---

<div class="post-metadata">

### Author: ![anpl0907](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@anpl0907](https://community.particle.io/u/anpl0907)
#### Post date: [March 26, 2020, 2:31pm UTC](https://community.particle.io/t/device-reverts-to-previously-flashed-code/55341/3 "2020-03-26T14:31:39Z")

</div>

Ok! I’ll give that a go and let you know how it goes.

---

<div class="post-metadata">

### Author: ![anpl0907](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@anpl0907](https://community.particle.io/u/anpl0907)
#### Post date: [March 30, 2020, 8:09pm UTC](https://community.particle.io/t/device-reverts-to-previously-flashed-code/55341/4 "2020-03-30T20:09:16Z")

</div>

@ScruffR Yes that solved the issue.Thanks!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/6/4/64635adccc35238caa19e9b553ec3e98b163d026.png) [@system](https://community.particle.io/u/system)
#### Post date: [September 29, 2020, 8:09am UTC](https://community.particle.io/t/device-reverts-to-previously-flashed-code/55341/5 "2020-09-29T08:09:17Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
