# My core never gets to breathing cyan, it's only ever 'fast cyan'

**URL:** <https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414>\
**Category:** Troubleshooting\
**Created:** [January 27, 2014, 4:07pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414 "2014-01-27T16:07:26Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [January 27, 2014, 4:07pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/1 "2014-01-27T16:07:27Z")

</div>

Hey Guys!

I just wanted to reach out to any users that are having trouble getting their cores online. If your core connected to your wifi, but is fast blinking cyan forever (not green), please post here, or message me with your core id.

These steps might also be helpful:

> **[Troubleshooting: My Core is flashing yellow/red lights after it connects to wifi](https://community.particle.io/t/troubleshooting-my-core-is-flashing-yellow-red-lights-after-it-connects-to-wifi/627)**
>
> Hey Guys! In case anyone is having trouble connecting to the cloud and you see this problem, and it doesn’t go away after a few minutes, please reach out to us at hello@particle.io. I will be releasing a fix for this soon. Thanks! David

To clarify: If your core has ever made it to ‘breathing cyan’ please ignore this post.

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![weakset](https://avatars.discourse-cdn.com/v4/letter/w/82dd89/32.png) [@weakset](https://community.particle.io/u/weakset)\
**Post date:** [January 29, 2014, 1:24pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/2 "2014-01-29T13:24:55Z")

</div>

Just wanted to say, that this fast cyan can be caused with too much memory allocation on global variables in user app.

For example this code will get you Core to state that can only be fixed with factory reset, or local dfu-util flash with nicer code.

```
    char tmp[4096];

void setup() {

}

void loop() {

}

```

A great way to waste 3-5 hours while debugging the main code elsewhere and forgetting that temp array you added with many lines of other code.

---

<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:** [January 29, 2014, 3:23pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/3 "2014-01-29T15:23:27Z")

</div>

Good call! I wonder if this improvement would help prevent these kind of heartaches in the future?

> **[How to know how much RAM/Flash i am using](https://community.particle.io/t/how-to-know-how-much-ram-flash-i-am-using/2150)**
>
> When using the web IDE it would be great when we compile for it to show how much ram & flash the app we created is using up. right now i have no idea how close to the wall i am.

---

<div class="post-metadata">

**Author:** ![aamirjvm](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/aamirjvm/32/20955_2.png) [@aamirjvm](https://community.particle.io/u/aamirjvm)\
**Post date:** [January 30, 2014, 5:33am UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/4 "2014-01-30T05:33:56Z")

</div>

@Dave my core was working fine at my sister’s house. Then I came home and connected it to my WiFi and I am getting ‘fast cyan’ blinking. It won’t connect. My core id is 53ff6b065067544830340187

---

<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:** [January 30, 2014, 6:00am UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/5 "2014-01-30T06:00:26Z")

</div>

@Dave what @weakset is saying is that something as simple as allocating 4Ki of memory for a character array crashes something in the Core. In fact, I saw this same thing last night with a 2Ki buffer. That’s not going to eat up all of the 17KB or so that are available… so you won’t perceive it as a red flag.

So there is something else happening that’s an issue, maybe with the compiler? We should be able to define a 10Ki buffer if we want, right?

😄

---

<div class="post-metadata">

**Author:** ![weakset](https://avatars.discourse-cdn.com/v4/letter/w/82dd89/32.png) [@weakset](https://community.particle.io/u/weakset)\
**Post date:** [January 30, 2014, 11:04am UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/6 "2014-01-30T11:04:53Z")

</div>

Exactly, but I’m not sure if there is necessarily anything wrong. Just something easy to miss even by experienced coder.

When coding PC software, I tend to throw in bigger than necessary temp variables to test stuff. Too small may cause problems, but with PC there is almost infinite amount available (and it can swap to hard disk if you make something really foolish.) 4K did feel good amount to thrown in with 20K total in Core.

The catch with Core is that user app isn’t actually an app. It is two funtions that is called from hidden main app. I have heard people to refer this hidden part as separate firmware, but they are actually coding a small portion of firmware themselves.

Tinker source even says:

```
/* This function loops forever --------------------------------------------*/
void loop()
{
        //This will run in a loop
}

```

In reality that function doesn’t loop forever, but runs repeatedly.

And here comes this fast cyan problem:  
It appears as if only the hidden firmware is still running and reaching the Cloud. It is easy to thing that in this point nothing you have written is even loaded to anywhere.

But actually those variables and constants outside loop() or any other your function have been allocated to memory and this leaves the Core less memory available to do its Cloud stuff etc.

If you declare variables inside the functions, they are released after loop() is finished. For example Core can handle this without hanging up:

```
  #include "application.h"
 
void setup() {
   //Initialize serial and wait for port to open:
   Serial.begin(9600); 
   while(!Serial.available());
}
char done = 0;
void loop() {
	char banana[1024*10];
	if(done==0){
		for(long i=0; i<(1024*10);i++){
			banana[i]=i%256;
		}

		for(long i=0; i<(1024*10);i++){
			Serial.print((int)banana[i]);
			Serial.print(",");
			delayMicroseconds(200);
		}
		done++;
	}
}

```

That is 10K filled up and verified in the first time loop() runs. The first example hangs up somewhere ~2.6K.

---

<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:** [January 30, 2014, 3:02pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/7 "2014-01-30T15:02:31Z")

</div>

Ahh interesting. Just having large-enough globals defined in the user firmware can interfere. This might bring us back to the RTOS / context-switching discussion that was happening in other threads, or I wonder if there might be a way to run user-firmware as a wholly separate application. – That might not make sense from a firmware point of view, just a thought.

I do think that presenting how much free ram / headroom is available, or warning if there isn’t enough free to do the handshake, would prevent some of these headaches. The core does have 20k of ram, but I think something like the lower 10k is occupied by networking and encrypted handshake overhead. I think too that space is shared between the stack and the heap, so it’s not as much as those of us in desktop-land are used to. 🙂

---

<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:** [January 30, 2014, 3:04pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/8 "2014-01-30T15:04:39Z")

</div>

Hi @aamirjvm,

Can you try clearing the wifi profiles, and smart config-ing it again? [http://docs.spark.io/#/connect/troubleshooting-step-3-reboot-and-clear-memory](http://docs.spark.io/#/connect/troubleshooting-step-3-reboot-and-clear-memory)

Thanks!  
David

---

<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:** [January 30, 2014, 3:18pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/9 "2014-01-30T15:18:49Z")

</div>

So why exactly if we have at least let’s say only 8Ki of free RAM, would a 3Ki global buffer hang up the Core, whereas a 7Ki buffer defined locally in loop() does not? I’m not seeing how bouncing back and fourth really fast between the B/G tasks and user tasks is the answer here.

---

<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:** [January 30, 2014, 3:21pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/10 "2014-01-30T15:21:26Z")

</div>

I’m guessing probably that the initialization and handshake need to allocate and free a chunk of memory, which is released when they’re done. Something that isn’t used until a user-function is called would be safe since that would happen after the handshake, where a global would prevent that memory from being available in the first place?

---

<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:** [January 30, 2014, 4:04pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/11 "2014-01-30T16:04:03Z")

</div>

Holy crap how big is this handshake? xD  
 ![](https://sea2.discourse-cdn.com/flex026/uploads/particle/433/533944e3f90c8373.jpg)

---

<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:** [January 30, 2014, 4:11pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/12 "2014-01-30T16:11:35Z")

</div>

omg such giant 🙌's 😃

I think a big part of the giant size has to do with some requirements of the public-key encryption routines. We’re using an embedded library for that stuff, but it’s still pretty huge. We’ve been talking about how we can free that memory back up.

---

<div class="post-metadata">

**Author:** ![Iv4n](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/iv4n/32/1968_2.png) [@Iv4n](https://community.particle.io/u/Iv4n)\
**Post date:** [January 30, 2014, 4:17pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/13 "2014-01-30T16:17:05Z")

</div>

Any idea about specifically how big it takes at it’s biggest 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:** [January 30, 2014, 4:27pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/14 "2014-01-30T16:27:52Z")

</div>

That would be a good question for @zachary or @satishgn – I don’t know offhand yet, but I think those guys would know

---

<div class="post-metadata">

**Author:** ![aamirjvm](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/aamirjvm/32/20955_2.png) [@aamirjvm](https://community.particle.io/u/aamirjvm)\
**Post date:** [January 30, 2014, 5:48pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/15 "2014-01-30T17:48:53Z")

</div>

Hi @Dave, I have tried clearing WiFi profiles and redoing smart config from iPhone 4 several times, with no success. I also did a factory reset, same results - fast cyan flashing. When WiFi has been configured, it goes very quickly from blue, to flashing green, to fast cyan flashing … So I guess this means that firmware has gotten passed the WiFi router login and is struggling with the cloud connection?

Thanks

---

<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:** [January 30, 2014, 6:20pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/16 "2014-01-30T18:20:29Z")

</div>

Hi @aamirjvm,

Hmm, yes, fast cyan should indicate that the core is on your network, but it’s having trouble establishing a connection to the server. This could be because a router or firewall is blocking the connection, or it can be because keys on the core aren’t working. Unless you wiped your external flash memory recently, I’m guessing something on your network is blocking your core.

---

<div class="post-metadata">

**Author:** ![aamirjvm](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/aamirjvm/32/20955_2.png) [@aamirjvm](https://community.particle.io/u/aamirjvm)\
**Post date:** [January 30, 2014, 11:31pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/17 "2014-01-30T23:31:00Z")

</div>

HI @Dave, the problem seems to have resolved itself. I enabled “Hot Spot” on my iPhone, and then configured the Spark Core using USB serial terminal. This worked and the core was able to connect to the cloud, and then it started flashing purple which I think is a firmware update. Then I erased WiFi passwords and setup the Spark Core on my home WiFi router using the iPhone app and everything works fine now.

---

<div class="post-metadata">

**Author:** ![zach](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zach/32/20714_2.png) [@zach](https://community.particle.io/u/zach)\
**Post date:** [January 31, 2014, 12:06am UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/18 "2014-01-31T00:06:12Z")

</div>

@aamirjvm I have seen this kind of behavior with networks that have a ‘captive portal’, as an example; the Core attempts to connect to the Cloud and gets intercepted by something else, and tries to do the encrypted handshake with whatever thing got in the way, and just gets stuck. In my case I was able to recover by re-starting, and the captive portal let the Core through the second time. We should write some code to timeout and re-attempt if this happens.

---

<div class="post-metadata">

**Author:** ![Iv4n](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/iv4n/32/1968_2.png) [@Iv4n](https://community.particle.io/u/Iv4n)\
**Post date:** [January 31, 2014, 2:41pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/19 "2014-01-31T14:41:52Z")

</div>

@zach Yesterday night I arrived home and my core was flashing fast cyan, I guess for some reason it re-started and had a handshake problem. I was just curious and left it the whole night and in the morning it was the same, I’m guessing it’s not restarting or timing out, it would be a nice thing to add!

---

<div class="post-metadata">

**Author:** ![kudos](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@kudos](https://community.particle.io/u/kudos)\
**Post date:** [January 31, 2014, 5:03pm UTC](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414/20 "2014-01-31T17:03:30Z")

</div>

It sounds like you have unfortunately encountered the CFOD (Cyan Flash Of Death). Good news is you’re not alone and forces have been mobilized to fix it 😄

> **[Bug bounty: Kill the 'Cyan flash of death'](https://community.particle.io/t/bug-bounty-kill-the-cyan-flash-of-death/1322)**
>
> Hi all, A number of you have encountered a bug where the Spark Core will not hold a persistent connection to the Cloud, and does not successfully attempt to re-connect to the Cloud. Here are a few threads on the topic: NOTE: This is a...

[Next page](https://community.particle.io/t/my-core-never-gets-to-breathing-cyan-its-only-ever-fast-cyan/2414.md?page=2)
