# Cannot get code to "take"

**URL:** <https://community.particle.io/t/cannot-get-code-to-take/11775>\
**Category:** Troubleshooting\
**Created:** [May 13, 2015, 9:08pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775 "2015-05-13T21:08:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![beroe](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@beroe](https://community.particle.io/u/beroe)\
**Post date:** [May 13, 2015, 9:08pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/1 "2015-05-13T21:08:10Z")

</div>

I am having a frustrating time getting my Spark – er-- Particle core to take up any code. It “breathes” cyan and pulses magenta when I try to flash it, then blinks and re-connects, but the code selected in the Web IDE or desktop Spark Dev app (0.0.22 = VERY FLAKY FOR ME!) is not what runs on the device.

I have other cores which work fine.

I did a factory reset, etc, but no avail.

I am just testing with a simple LED blinking script and also trying to declare some Spark.variables so I can see whether the status changes online. When I try `spark list` from the command line, it always just says:

```
coreW01 (xxxxxxxx) is online
  Functions:
    int digitalread(String args) 
    int digitalwrite(String args) 
    int analogread(String args) 
    int analogwrite(String args) 

```

No idea what to try at this point.

---

<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:** [May 13, 2015, 9:19pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/2 "2015-05-13T21:19:49Z")

</div>

Hmm, that’s really strange! Can you send me your device ID, and I’ll check the logs for ya?

Thanks,  
David

---

<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:** [May 13, 2015, 11:13pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/3 "2015-05-13T23:13:26Z")

</div>

Hi @beroe,

I’ve checked the logs, and I don’t see your core coming back online after a factory reset today or yesterday, can you try updating your factory image, and making sure you’re doing a reset?

[http://support.particle.io/hc/en-us/articles/203108844-Perform-a-Full-Firmware-Upgrade](http://support.particle.io/hc/en-us/articles/203108844-Perform-a-Full-Firmware-Upgrade)

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![beroe](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@beroe](https://community.particle.io/u/beroe)\
**Post date:** [May 13, 2015, 11:31pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/4 "2015-05-13T23:31:41Z")

</div>

OK, I tried that and … it is working!

When all else fails…

Thanks very much for the help.

(BTW. The link to DFUmode from the page you sent is 404. Probably the changeover?)

---

<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:** [May 13, 2015, 11:46pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/5 "2015-05-13T23:46:32Z")

</div>

Heya @beroe,

Sweet! 🙂 Glad it’s working. I reported that busted link to the website folks, thanks!

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![beroe](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@beroe](https://community.particle.io/u/beroe)\
**Post date:** [May 21, 2015, 9:47pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/6 "2015-05-21T21:47:29Z")

</div>

Hi @Dave  
Setting up a new Photon that I got at Maker Faire (!) and trying to upgrade firmware as described above… (I am guessing it is not needed, but getting a Potentially unhandled rejection [4] Timed out (WARNING: non-Error used))

Just wanted to see if this still applies to Photon with its new firmware update method and also… the link to DFU mode is still busted…

From this page:  
[http://support.particle.io/hc/en-us/articles/203108844-Perform-a-Full-Firmware-Upgrade](http://support.particle.io/hc/en-us/articles/203108844-Perform-a-Full-Firmware-Upgrade)  
to this one:  
[http://docs.spark.io/connect/#appendix-dfu-mode-device-firmware-upgrade](http://docs.spark.io/connect/#appendix-dfu-mode-device-firmware-upgrade)

---

<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:** [May 21, 2015, 9:50pm UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/7 "2015-05-21T21:50:47Z")

</div>

Hi @beroe,

Good question! Those updates only apply to the Core, and not the Photon. We're still building troubleshooting guides as issues come up, but here's the guide for updating system firmware on the photon via the CLI in the short-term:

> [@Connected Photon goes to Green Blink when flashed](https://community.particle.io/t/connected-photon-goes-to-green-blink-when-flashed/11934/4):
>
> Sorry, here: [image] (posting files shortly)

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![beroe](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@beroe](https://community.particle.io/u/beroe)\
**Post date:** [May 22, 2015, 12:15am UTC](https://community.particle.io/t/cannot-get-code-to-take/11775/9 "2015-05-22T00:15:21Z")

</div>

Nice! Got it working by updating the CLI and letting it do an OTA update.  
Seems a lot faster than the Cores!
