# Cannot flash new code

**URL:** <https://community.particle.io/t/cannot-flash-new-code/35196>\
**Category:** Troubleshooting\
**Created:** [August 8, 2017, 1:23am UTC](https://community.particle.io/t/cannot-flash-new-code/35196 "2017-08-08T01:23:40Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjtrolinger](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tjtrolinger](https://community.particle.io/u/tjtrolinger)\
**Post date:** [August 8, 2017, 1:23am UTC](https://community.particle.io/t/cannot-flash-new-code/35196/1 "2017-08-08T01:23:40Z")

</div>

I now have two Photons that will no longer flash any (tried multiple different programs including blinky) new code from the web IDE over Wifi. The WEB IDE says the flash was successful and after the Photon resets normally, but the code on the Photon has not been changed. They will however flash correctly from the CLI in DFU mode over USB. Both of the Photons were flashing without problems from the WEB IDE many times, but then that just stopped working for no apparent reason. I have also tried multiple different firmware versions including the latest release 0.6.2 and using safe mode when flashing.  
This is an issue for me because ultimately these will be remote and I need to be able to update their programming remotely.  
I would appreciate advice on this issue.  
Thanks,  
TJ

---

<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:** [August 8, 2017, 10:41am UTC](https://community.particle.io/t/cannot-flash-new-code/35196/2 "2017-08-08T10:41:00Z")

</div>

What system version have you got installed on your device?

I had troubles after testing 0.7.0-rc.2.

---

<div class="post-metadata">

**Author:** ![tjtrolinger](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tjtrolinger](https://community.particle.io/u/tjtrolinger)\
**Post date:** [August 8, 2017, 7:46pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/3 "2017-08-08T19:46:57Z")

</div>

I did have 0.7.0-rc.2 on for a while but reverted back to 0.6.2.

---

<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:** [August 8, 2017, 7:52pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/4 "2017-08-08T19:52:00Z")

</div>

That might well be the reason.  
Downgrading to 0.6.2 from 0.7.0-rc.2 requires youto downgrade the bootloader too - see release notes

[Particle Device OS Updates Thread - #48 by BDub](https://community.particle.io/t/particle-firmware-updates-thread/14378/48)

> [@](#):
>
> **Note about Downgrading [Photon/P1] OTA:** First downgrade system-part2 back to 0.6.2. Any attempts to write to the DCT while the device is in DFU mode will fail now. At this point, attempting to downgrade system-part1 will fail silently, since the new bootloader (v100) cannot access DCT and read module update info, thus, in order to downgrade from 0.7.0-rc.2 to 0.6.2, photon/p1 firmware modules should be flashed in the following order with 0.6.2 system binaries: system-part2 -\> bootloader (v0.6.2) -\> system-part1.

---

<div class="post-metadata">

**Author:** ![tjtrolinger](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tjtrolinger](https://community.particle.io/u/tjtrolinger)\
**Post date:** [August 8, 2017, 8:03pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/5 "2017-08-08T20:03:29Z")

</div>

I guess I should have read the fine print.

---

<div class="post-metadata">

**Author:** ![tjtrolinger](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tjtrolinger](https://community.particle.io/u/tjtrolinger)\
**Post date:** [August 9, 2017, 12:49am UTC](https://community.particle.io/t/cannot-flash-new-code/35196/6 "2017-08-09T00:49:27Z")

</div>

Where do I get the 0.6.2 bootloader binary?  
I do not see it at the link you provided

> [@Particle Device OS Updates Thread](https://community.particle.io/t/particle-firmware-updates-thread/14378/48):
>
> Firmware 0.7.0-rc.2 Pre-release is out on the [Web IDE](https://build.particle.io) for Core/Photon/P1/Electron released on production servers July 14th, 2017 pencil Please read all notes in the Notes Festival tada below Note: This is a pre-release and is not intended for production yet. We’ve tested this pre-release to the best of our ability and we want to know what you think now! Please understand that some care and attention is necessary when testing this pre-release, and be sure to upgrade to the final release w…

---

<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:** [August 9, 2017, 4:29am UTC](https://community.particle.io/t/cannot-flash-new-code/35196/7 "2017-08-09T04:29:00Z")

</div>

Just scroll down a bit in that post and you'll find

> [@Particle Device OS Updates Thread](https://community.particle.io/t/particle-device-os-updates-thread/14378/48):
>
> #System Binaries (all devices) & Device Upgrader (Photon & Electron)
> 
> [Release 0.7.0-rc.2 Prerelease (Core/Photon/P1/Electron) · particle-iot/device-os · GitHub](https://github.com/spark/firmware/releases/tag/v0.7.0-rc.2)

This is where you'll get the binaries from (when scrolling down again - this time to **Downloads** ;-))

---

<div class="post-metadata">

**Author:** ![tjtrolinger](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tjtrolinger](https://community.particle.io/u/tjtrolinger)\
**Post date:** [August 9, 2017, 11:03pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/8 "2017-08-09T23:03:36Z")

</div>

I flashed over USB system-part2 -\> bootloader (v0.6.2) -\> system-part1 and it still does not accept new programs over the WEB IDE. New programs load correctly using CLI and DFU.

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [August 17, 2017, 6:05pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/9 "2017-08-17T18:05:37Z")

</div>

@tjtrolinger Could you put your device in Listening Mode and run `particle serial inspect` and paste the data here? You’ll want to see v11 bootloader, and v108 for system parts if you have successfully downgraded to 0.6.2.

---

<div class="post-metadata">

**Author:** ![tjtrolinger](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tjtrolinger](https://community.particle.io/u/tjtrolinger)\
**Post date:** [August 17, 2017, 9:14pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/10 "2017-08-17T21:14:22Z")

</div>

Thanks for the reply  
The bootloader is version 100. How do I get it to V11?  
Thanks,  
TJ

Platform: 6 - Photon  
Modules  
Bootloader module #0 - version 100, main location, 16384 bytes max size  
Integrity: PASS  
Address Range: PASS  
Platform: PASS  
Dependencies: PASS  
System module #1 - version 108, main location, 262144 bytes max size  
Integrity: PASS  
Address Range: PASS  
Platform: PASS  
Dependencies: PASS  
System module #2 - version 108, main location, 262144 bytes max size  
Integrity: PASS  
Address Range: PASS  
Platform: PASS  
Dependencies: PASS  
System module #1 - version 108  
User module #1 - version 4, main location, 131072 bytes max size  
UUID: 07918D94C65CB7CDD13CBEDADB4692DF15B6A25FDBAF952D7F5A85956C53E57E  
Integrity: PASS  
Address Range: PASS  
Platform: PASS  
Dependencies: PASS  
System module #2 - version 108  
empty - factory location, 131072 bytes max size

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [August 18, 2017, 2:52pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/11 "2017-08-18T14:52:26Z")

</div>

I’ll have to make the notes clearer about which method doesn’t work for the bootloader, i.e., USB/DFU 🙂  
You can only flash the bootloader OTA or YModem over USB.

Try this, put your Photon in Listening Mode and run:

```
particle flash --serial bootloader-0.6.2-photon.bin
```

---

<div class="post-metadata">

**Author:** ![tjtrolinger](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tjtrolinger](https://community.particle.io/u/tjtrolinger)\
**Post date:** [August 18, 2017, 4:19pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/12 "2017-08-18T16:19:07Z")

</div>

That WORKED!  
I can now flash again from the WEB IDE.  
Thank You for your help.  
TJ

---

<div class="post-metadata">

**Author:** ![KyleG](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kyleg/32/11077_2.png) [@KyleG](https://community.particle.io/u/KyleG)\
**Post date:** [August 19, 2017, 12:53am UTC](https://community.particle.io/t/cannot-flash-new-code/35196/13 "2017-08-19T00:53:02Z")

</div>

Thanks for the assist!

---

<div class="post-metadata">

**Author:** ![UMD](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/umd/32/5850_2.png) [@UMD](https://community.particle.io/u/UMD)\
**Post date:** [October 11, 2017, 12:43am UTC](https://community.particle.io/t/cannot-flash-new-code/35196/14 "2017-10-11T00:43:57Z")

</div>

Suffered a similar situation to @tjtrolinger with Web IDE + 0.7.0.rc2.

Had a case where all things looked normal from a development point of view, but out of the blue, updated application on the Web IDE would not actually update a device, even though we see the normal flashing magenta and all that. (Hence my post [Web IDE - macro to provide build number?](https://community.particle.io/t/web-ide-macro-to-provide-build-number/36624) to assist with know what is on the device has been actually updated.)

I could DFU okay to the device, so DFU'd Tinker, then tried OTA again to no avail. Updated public cloud key. Still no go.

Good news is that this thread cured my woes as I took the advice to:

> particle flash --serial bootloader-0.6.2-photon.bin

Question now arises - does anyone know what kicks off this condition? Specifically worried about this issue being a problem with devices in the field.

---

<div class="post-metadata">

**Author:** ![nh43de](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nh43de](https://community.particle.io/u/nh43de)\
**Post date:** [September 3, 2018, 11:03pm UTC](https://community.particle.io/t/cannot-flash-new-code/35196/15 "2018-09-03T23:03:02Z")

</div>

I have a similar situation where OTA updates are not working for Particle Core running 0.5.4 on an old prototype - am really worried now that we are headed to production with the Photon that we will encounter this issue. Obviously DFU flashing will not work in this case, meaning we would have to rely on OTA updates to fix this or the whole unit will be bricked…

Symptoms: when upgrading firmware target, fails to flash OTA (request timed out). When leaving firmware target unchanged, does not error out but does not update the device with new code. In both cases, after initiating the flash it instantly “freezes” with a breathing green that requires restarting the device - no updates actually occur.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![UMD](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/umd/32/5850_2.png) [@UMD](https://community.particle.io/u/UMD)\
**Post date:** [September 4, 2018, 6:56am UTC](https://community.particle.io/t/cannot-flash-new-code/35196/16 "2018-09-04T06:56:06Z")

</div>

@nh43de, try downloading the bootloader. I believe that this can be done over the air (but there could be a catch 22 here!)

> [@How to flash Photon bootloader by OTA?](https://community.particle.io/t/how-to-flash-photon-bootloader-by-ota/41276):
>
> I find out that bootloader is not backward compatibility. How to flash bootloader by OTA? Is there an API to do it? Thanks!
