# Spark Core Died?

**URL:** <https://community.particle.io/t/spark-core-died/2847>\
**Category:** Troubleshooting\
**Created:** [February 14, 2014, 10:44am UTC](https://community.particle.io/t/spark-core-died/2847 "2014-02-14T10:44:39Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![choosatron](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/choosatron/32/665_2.png) [@choosatron](https://community.particle.io/u/choosatron)\
**Post date:** [February 20, 2014, 6:26am UTC](https://community.particle.io/t/spark-core-died/2847/21 "2014-02-20T06:26:10Z")

</div>

Not to my knowledge. Of course, there is all that code in the ported SD card library, that is the messiest code I don’t know well at all…the printer library was arduino ported but much less complicated. Any tips on how to debug this?

---

<div class="post-metadata">

**Author:** ![mohit](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mohit/32/1971_2.png) [@mohit](https://community.particle.io/u/mohit)\
**Post date:** [February 20, 2014, 4:24pm UTC](https://community.particle.io/t/spark-core-died/2847/22 "2014-02-20T16:24:45Z")

</div>

From the video and the description it seems that the Core is constantly resetting (white-green-cyan-red). This is typically caused by a watch dog reset. The Core is basically hard faulting somewhere.

Now that you have figured your way out of it, how is the Core breathing cyan without a WiFi connection?

Is it possible to take a look at your code?

Thanks!

---

<div class="post-metadata">

**Author:** ![choosatron](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/choosatron/32/665_2.png) [@choosatron](https://community.particle.io/u/choosatron)\
**Post date:** [February 20, 2014, 4:27pm UTC](https://community.particle.io/t/spark-core-died/2847/23 "2014-02-20T16:27:00Z")

</div>

Yes, the ‘dark death’ is RGD LED dim (off), and D7 slightly on.

As far as the 1 minute death, it is more like a 1 minute coma.  
Update, it appears that at a minute when everything ‘stops’, there are occasions where if I continue to wait, the last command or items being processed will get spit out (it’ll finish printing) and the Core will reset itself at the same time.

Blarg.

---

<div class="post-metadata">

**Author:** ![choosatron](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/choosatron/32/665_2.png) [@choosatron](https://community.particle.io/u/choosatron)\
**Post date:** [February 20, 2014, 4:42pm UTC](https://community.particle.io/t/spark-core-died/2847/24 "2014-02-20T16:42:32Z")

</div>

The red blinking issue was solved. That was a fault of my own while trying to track down the dark death. I have currently bypassed the dark death by not initializing anything upfront, just defining pointers and moving constructor logic to an init() method called in setup after initializing them.

The current issue is the 1 minute coma. I connect to WiFi just fine, but after 1 minute everything stops (though it continues to breath). Then if I wait, it’ll spit out the last action and reset itself. I will time this delay and see if it matches anything.

As far as socket timeout issue, I investigated the netapp\_timeout\_values set from firmware to common-lib, as it declares the CC3000 to have a default value of 60 seconds. The firmware, however, sets the value DEFAULT\_SEC\_INACTIVITY, which in common-lib’s config.h is 0, so infinity timeout. Dead end there.

---

<div class="post-metadata">

**Author:** ![zachary](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zachary/32/20717_2.png) [@zachary](https://community.particle.io/u/zachary)\
**Post date:** [February 20, 2014, 4:47pm UTC](https://community.particle.io/t/spark-core-died/2847/25 "2014-02-20T16:47:11Z")

</div>

I think the 60 second coma is highly likely tied to network activity. With latest master, try fiddling with the defines at the end of this file in the common lib to see whether the the amount of time until reset changes.

> <https://github.com/particle-iot/core-common-lib/blob/master/SPARK_Firmware_Driver/inc/config.h>

---

<div class="post-metadata">

**Author:** ![choosatron](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/choosatron/32/665_2.png) [@choosatron](https://community.particle.io/u/choosatron)\
**Post date:** [February 20, 2014, 4:54pm UTC](https://community.particle.io/t/spark-core-died/2847/26 "2014-02-20T16:54:19Z")

</div>

Curious…if I comment out WLAN entirely, the printer starts behaving in strange ways, as if corrupted data is getting sent to it triggering different visual settings.

Yes, I can send the code. It is my quick attempt at getting the old firmware to function on the new hardware so I know I can continue basic demos. This means it is not pretty, and hacked together…so we’ll see. 🙂 I’ll email it over if I don’t find anything with Zachary’s timeout settings he pointed out below don’t reveal anything.

---

<div class="post-metadata">

**Author:** ![choosatron](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/choosatron/32/665_2.png) [@choosatron](https://community.particle.io/u/choosatron)\
**Post date:** [February 20, 2014, 4:54pm UTC](https://community.particle.io/t/spark-core-died/2847/27 "2014-02-20T16:54:37Z")

</div>

Will try right now! Paaaaaaadding.

---

<div class="post-metadata">

**Author:** ![choosatron](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/choosatron/32/665_2.png) [@choosatron](https://community.particle.io/u/choosatron)\
**Post date:** [February 20, 2014, 5:06pm UTC](https://community.particle.io/t/spark-core-died/2847/28 "2014-02-20T17:06:43Z")

</div>

Nope. I had messed with INACTIVITY before when I found 60 seconds was the CC3000 default, but nothing changes when I mess with any of the other values either. :-{

---

<div class="post-metadata">

**Author:** ![zachary](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zachary/32/20717_2.png) [@zachary](https://community.particle.io/u/zachary)\
**Post date:** [February 20, 2014, 6:03pm UTC](https://community.particle.io/t/spark-core-died/2847/29 "2014-02-20T18:03:36Z")

</div>

K, testing your code. At least with latest master of the other two repos it’s reseting because of the watchdog, probably hard fault. I’ll use gdb to figure out where the fault is, as well as try it with the revisions you state above of the other libs.

---

<div class="post-metadata">

**Author:** ![choosatron](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/choosatron/32/665_2.png) [@choosatron](https://community.particle.io/u/choosatron)\
**Post date:** [February 26, 2014, 7:35pm UTC](https://community.particle.io/t/spark-core-died/2847/30 "2014-02-26T19:35:55Z")

</div>

Ok! I’ve fixed the 60 second coma. Hopefully this will be enough information for you folk to tell me what is probably getting triggered.

I setup my boards RGB LED to change colors once a second, so it was easy to see if something was holding up the loop. I noticed that despite claims in the thermal printer code it would block while printing, which can take anywhere from 2-3 seconds, averaging around 4-6 seconds, and sometimes even a little higher.

I removed the blocking code so the loop would keep zipping along even while printing, working on my own safeties to keep the user from providing input, and now it works just fine.

So! We know that the blocking delay is directly causing the problem, and for some reason it will work fine up until 1 minute passes. When the 5-6 seconds of occasional blocking are gone, the 1 minute coma doesn’t seem to occur. Any ideas? At the very least, I can move forward, but I’d love to understand the dangerous waters I’ve found myself in. 🙂

[Previous page](https://community.particle.io/t/spark-core-died/2847.md?page=1)
