Red Flash Issue

Hey Everyone,

So I’ve got a rather interesting “red flash” issue.

Here’s the timeline of events:

  1. Core has been running some code for the last day or so with no problem (Programmed using WebIDE)
  2. I walk in this morning and the core is rapidly flashing RED (just red)
  3. I press RST… it resets but returns to flashing red (rapidly)
  4. I do a factory reset and put in the WiFi credentials
  5. The core connects to the spark cloud (breathing cyan)
  6. I upload my earlier code (WebIDE)
  7. Core goes through the normal flashing process and then starts blinking red, with no determinable pattern.
  8. I do another factory reset and try a simple LED fade program.
  9. Core flashes and then begins rapidly blinking red
  10. I start writing this message (about 5 minutes after 9.) and while doing so flash the sample LED Blink program
  11. The core successfully flashes and begins blinking
  12. I am now able to flash the previously not-working LED fade program onto the core
  13. I am able to flash the original program onto the core
  14. After walking away from the core for a few minutes I notice it is flash rapidly red again but appears to “recover” after a minute and return to running the code.

What the heck is going on? How did the core “fix” itself and what am I doing that led the core to flash red and not accept new firmware for about 15 minutes?

I have no problem posting code but I figured I’d ask first to see if it was a simple mistake. My code is fairly basic so I don’t think it’s running out of memory but perhaps it is.

Thanks for the help

1.) Post your code here and we can see what’s going on or share a link to a Gist.

The syntax to paste code in the forum is:

 ```cpp
 paste code here...

2.) When you perform a factory reset, the core will copy the factory reset firmware programmed in the...*er....* factory to overwrite the flashed user firmware.

This is based on design as it allows the user to reset the core in an event the user firmware is corrupted...
1 Like
  1. Ok,

Original Code:

LED Fade:

  1. I actually knew this but that was part of my issue. I don’t understand why it would still blink red after being factory reset

[EDIT] So my original thought was that perhaps relying on unsigned char overflow might be “bad.” What I’m essentially doing is

unsigned char brightness = 0;
void loop()
{
    analogWrite(led, brightness); 
    brightness = brightness + 5;
    delay(10);
}

this results in a LED which slowly fades “up” until 255 brightness when the char overflows and then rolls over to 0. Would that cause a memory overflow problem?

I this the latter code might indeed give rise to some overflow but have never tried it before.

The original code looks fine though. Maybe you can try running it again and see how it goes. :slight_smile:

Hey Guys!

If your core sometimes randomly goes from breathing cyan -> briefly flashing red -> back to breathing cyan it could mean you’ve seen us deploying updates to the cloud. Generally this time window is very short (under a second), and happens once a month or so. During the last few weeks we’ve started to add capacity to the cloud, and so these have happened a bit more frequently than we’d like. These should become less frequent again as we add capacity, but you might still catch us in the act. :slight_smile:

When we have it, we’ll also post about scheduled maintenance, so you can plan for it and not have it catch you by surprise. :slight_smile:

Thanks!
David