# Spark Cuts Out When Attempting to Flash New Apps

**URL:** <https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790>\
**Category:** Troubleshooting\
**Created:** [July 17, 2014, 4:28pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790 "2014-07-17T16:28:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![daflippymaster](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@daflippymaster](https://community.particle.io/u/daflippymaster)\
**Post date:** [July 17, 2014, 4:28pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/1 "2014-07-17T16:28:25Z")

</div>

The core will initially flash magenta but then dies soon after (no LED lights at all). After a couple seconds the cyan lights come back on and are breathing.

The the web IDE says everything went fine, however the previous program is still on the spark.

I have already installed the cc3000 update via terminal (OSX).

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 17, 2014, 4:33pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/2 "2014-07-17T16:33:43Z")

</div>

@daflippymaster, it sounds like the firmware you currently have on the core has some issues and is preventing a proper OTA flashing.

Since you have `spark-cli` installed,

1. Place the core in DFU mode (blinking yellow)

2. `spark flash --usb tinker`

This will overwrite the firmware on the core. Thereafter, try an OTA download again 😉

---

<div class="post-metadata">

**Author:** ![AndyW](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/andyw/32/686_2.png) [@AndyW](https://community.particle.io/u/AndyW)\
**Post date:** [July 17, 2014, 4:37pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/3 "2014-07-17T16:37:02Z")

</div>

It sounds like you are getting hit by this:

> **[Bug bounty: OTA flash reliability issue](https://community.particle.io/t/bug-bounty-ota-flash-reliability-issue/5438)**
>
> Hi all, We’ve recently uncovered a bug in OTA flash that causes OTA flashes to perform inconsistently; sometimes the Core freezes up right when the flash starts. We’ve got a stability fix for the CC3000 (to dramatically improve the issue often...

We’re hot on the trail of this, but one work around is to add something to change the size of the resulting binary. If you add 16 bytes to the binary (by declaring a const char array of 16 elements) - you may get working again.

---

<div class="post-metadata">

**Author:** ![daflippymaster](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@daflippymaster](https://community.particle.io/u/daflippymaster)\
**Post date:** [July 17, 2014, 4:38pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/4 "2014-07-17T16:38:08Z")

</div>

That did indeed fix it

However, i’ve had issue flashing programs two other times earlier today (both times fixed by reflashing tinker/cc3000

Any ideas on why I would need to keep doing this/why this problem keeps reoccurring?

EDIT: It would seem i’m a victim of CFOD as well -\_\_\_-

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 17, 2014, 4:41pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/5 "2014-07-17T16:41:45Z")

</div>

You are not really experiencing CFOD since you already did the CC3000 patch 😉

It’s a bug in OTA causing the issue. For now, the best and least invasive method is `spark flash --usb tinker` if OTA hanged.

have fun!

---

<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:** [July 25, 2014, 5:09pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/6 "2014-07-25T17:09:52Z")

</div>

Hi @daflippymaster,

One thing that may cause an issue is that your code isn’t run in any kind of sandbox, so it’s possible to write apps that interfere with OTA when you’re doing rapid development. I would try flashing your app over USB with a simple `spark flash --usb myapp.bin` if you’re developing locally, and then fix any issues preventing OTA when you’re ready. 🙂

We’re also hoping to take another look at our OTA process in the next few weeks, and make some significant improvements. 🙂

I hope that helps!

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![daflippymaster](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@daflippymaster](https://community.particle.io/u/daflippymaster)\
**Post date:** [July 30, 2014, 9:14pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/7 "2014-07-30T21:14:54Z")

</div>

@Dave, how do you go from the .ino file to the .bin?

---

<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:** [July 30, 2014, 9:37pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/8 "2014-07-30T21:37:25Z")

</div>

Hi @daflippymaster,

If you’re using the CLI, you can convert from a ‘.ino’ file to a ‘.bin’ by using the `compile` command:

```auto
spark compile myApp.ino --saveTo myApp.bin

```

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![daflippymaster](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@daflippymaster](https://community.particle.io/u/daflippymaster)\
**Post date:** [July 30, 2014, 10:03pm UTC](https://community.particle.io/t/spark-cuts-out-when-attempting-to-flash-new-apps/5790/9 "2014-07-30T22:03:29Z")

</div>

Thanks @Dave, that’ll save a ton of time
