# My SparkCore falls back to DFU mode after every Flash from the cloud

**URL:** <https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214>\
**Category:** Troubleshooting\
**Created:** [August 5, 2014, 5:32pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214 "2014-08-05T17:32:50Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 5, 2014, 5:32pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/1 "2014-08-05T17:32:51Z")

</div>

Hi.

Everytime I flash new firmware to my Spark Core, it flashes magenta and goes to the usual routine, but then when it resets it goes into DFU mode!. This happens of course without touching anything.

I download the bin and flash it directly using dfu-util and everything works fine. Except if I try to flash it again from the cloud! It goes again into DFU mode.

I tried factory reset, new firmware install using dfu-util, etc, etc, etc… Any ideas? Is this a boot loader problem?

UPDATE: It does this no matter what code I flash to it. I tried several proven firmwares I wrote that run smooth on other devices.

---

<div class="post-metadata">

**Author:** ![Hootie81](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/hootie81/32/2879_2.png) [@Hootie81](https://community.particle.io/u/Hootie81)\
**Post date:** [August 5, 2014, 7:22pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/2 "2014-08-05T19:22:56Z")

</div>

sounds like the yellow flash flash of death… maybe?? search ‘yellow flash’ there are several posts

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 5, 2014, 8:00pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/3 "2014-08-05T20:00:04Z")

</div>

It is exactly the Yellow Flash of Death:

Here's the ref post I found:

> **[Yellow flash of death](https://community.particle.io/t/yellow-flash-of-death/2383/10)**
>
> I don’t know enough about it to say, and I wondered how the DFU util could access the external flash … must be remapped from the bootloader firmware? If so, then yeah it should be doing verification 😄 Not sure if it is… it’s possible it does and...

Thanks for the Info.. yesterday I tried a search but it was way too late for my brain to function normally 😄

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [August 5, 2014, 8:19pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/4 "2014-08-05T20:19:38Z")

</div>

Hi @frlobo,

I’ve seen that issue when the external flash on a core is damaged. Can you try writing something to that area of flash and reading it back to see if it works as expected?

dfu-util -d 1d50:607f -a 1 -s 0x00060000 -v -D core-firmware.bin  
dfu-util -d 1d50:607f -a 1 -s 0x00060000:sizecount -v -U temp.bin

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 5, 2014, 8:59pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/5 "2014-08-05T20:59:15Z")

</div>

I will do this in a couple of hours when I get home. Thank you for your help! I was really lost!

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 6, 2014, 7:06am UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/6 "2014-08-06T07:06:27Z")

</div>

> [@Dave](#):
>
> dfu-util -d 1d50:607f -a 1 -s 0x00060000 -v -D core-firmware.bin

I was about to do the test. .But now my spark core only list with the internal small blue led and does nothing more!!! Not even the reset or power cycle, or long reset works!!

What to do now?

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 6, 2014, 7:17am UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/7 "2014-08-06T07:17:05Z")

</div>

> [@Dave](#):
>
> dfu-util -d 1d50:607f -a 1 -s 0x00060000 -v -D core-firmware.bin

Ok.. I final managed to dfu mode my SparkCore.. Here's the result...

```
dfu-util -d 1d50:607f -a 1 -s 0x00060000 -v -D core-firmware.bin : 

```

A bunch of :

```cpp
Memory segment at 0x00000000 512 x 4096 = 2097152 (rew)
Downloading to address = 0x00060000, size = 78860
Poll timeout 50 ms 

```

And `dfu-util -d 1d50:607f -a 1 -s 0x00060000:sizecount -v -U temp.bin` :

```cpp
Device returned transfer size 1024
Error: Invalid dfuse modifier: sizecount

```

Thanks for your help. Let me know what to do...

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [August 6, 2014, 3:17pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/8 "2014-08-06T15:17:58Z")

</div>

Hi @frlobo,

Ahh, sorry, in this case `sizecount` was meant to be replaced with the size of the blob you read off the flash chip initially. So if you run `ls -l`, or `dir` depending on your system, and update that command to match that number of bytes:

```auto
dfu-util -d 1d50:607f -a 1 -s 0x00060000:78860 -v -U temp.bin 

```

Then you’d want to compare those files with something like:

```auto
diff core-firmware.bin temp.bin

```

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 6, 2014, 5:07pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/9 "2014-08-06T17:07:15Z")

</div>

> [@Dave](#):
>
> dfu-util -d 1d50:607f -a 1 -s 0x00060000

Oops.

@dave In that case.. The first command returned the same..

The second command returned:  
bytes\_per\_hash=1024  
Starting upload: [#############################################################################] finished!

And : temp.bin is 78860

And the diff command, returnes:  
Binary files core-firmware.bin and temp.bin differ

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [August 6, 2014, 9:06pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/10 "2014-08-06T21:06:23Z")

</div>

Hi @frlobo,

Hmm, any chance you could open those files in a hex editor, or send them my way? I’m curious to see how badly they’re different.

This result would indicate that there is a problem with the external flash on that core. If you email us at [hello@spark.io](mailto:hello@spark.io), and mention this thread, we can get you setup with a replacement core.

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 6, 2014, 10:02pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/11 "2014-08-06T22:02:01Z")

</div>

Il send the files tonight.

I do have a jtag shield and programmer should this be boot loader related??

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [August 6, 2014, 10:17pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/12 "2014-08-06T22:17:51Z")

</div>

Hi @frlobo,

I don’t think it’s bootloader related, but you can certainly always erase and re-load that if you want. 🙂 A feature we don’t have in the bootloader, but one that might be nice would be bad sector detection / workarounds for situations like this. So future bootloader improvements might be able to workaround failures like that, but that’s not the case yet.

Alternatively, if you wanted to just keep using that core, you could fish around in your flash chip and find a good sector, and bump up your OTA / backup firmware addresses to that sector instead, but that’s a bit fancy. 🙂

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 7, 2014, 6:43am UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/13 "2014-08-07T06:43:43Z")

</div>

Well… I would if I could… But I am not that good… 😄

Thanks for your help…

Here’s the temp.bin file:

> **[temp.bin](https://www.dropbox.com/s/nyu5fsla6stkqvy/temp.bin)**
>
> Shared with Dropbox

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 12, 2014, 3:14am UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/15 "2014-08-12T03:14:08Z")

</div>

Haven’t had any contact with regards replacing the device…

---

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 13, 2014, 4:47pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/16 "2014-08-13T16:47:22Z")

</div>

@dave Any news on the replacement core?

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [August 13, 2014, 5:14pm UTC](https://community.particle.io/t/my-sparkcore-falls-back-to-dfu-mode-after-every-flash-from-the-cloud/6214/17 "2014-08-13T17:14:37Z")

</div>

Hi @frlobo,

You sent us your shipping address and we confirmed on Thursday August 7th at 4pm, so we’re still working on getting you a replacement.

Thanks,  
David
