# Electron SOS Code - 13

**URL:** <https://community.particle.io/t/electron-sos-code-13/42241>\
**Category:** Troubleshooting\
**Created:** [June 4, 2018, 4:48pm UTC](https://community.particle.io/t/electron-sos-code-13/42241 "2018-06-04T16:48:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![LabSpokane](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@LabSpokane](https://community.particle.io/u/LabSpokane)\
**Post date:** [June 4, 2018, 4:48pm UTC](https://community.particle.io/t/electron-sos-code-13/42241/1 "2018-06-04T16:48:14Z")

</div>

I’m am getting an SOS when I put my electron to sleep while connected to the cloud. I can find reference to the flash code 1 through 12. Anyone know what lucky 13 flashes signifies?

I get no error when going to sleep and never having connected to the cloud.

Thanks!

---

<div class="post-metadata">

**Author:** ![chipmc](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/chipmc/32/15905_2.png) [@chipmc](https://community.particle.io/u/chipmc)\
**Post date:** [June 4, 2018, 6:35pm UTC](https://community.particle.io/t/electron-sos-code-13/42241/2 "2018-06-04T18:35:57Z")

</div>

@LabSpokane,

I believe it is a stack overflow. There are many ways to get this error I believe but, I often see it when an over the air update fails. I often clear this by refreshing the device using DFU mode.

Chip

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 5, 2018, 3:40am UTC](https://community.particle.io/t/electron-sos-code-13/42241/3 "2018-06-05T03:40:56Z")

</div>

Where did you find a list that ends with 12?

This is what I see

 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/2/a/2aecac6f13be894fc7a3b5a4d5c6913f60264416.jpg)

---

<div class="post-metadata">

**Author:** ![LabSpokane](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@LabSpokane](https://community.particle.io/u/LabSpokane)\
**Post date:** [June 5, 2018, 3:51am UTC](https://community.particle.io/t/electron-sos-code-13/42241/4 "2018-06-05T03:51:20Z")

</div>

Thanks for the replies. It was stack overflow.

Found the error and fixed. Turns out I cannot call the sleep function from a timer. Moving the sleep function to the main loop solved the error.

I’m guessing that executing the sleep function from the timer causes issues in FreeRTOS. For now, I will just let the main loop be the state machine. Eventually, I really would prefer to get all the code out of the main loop and run everything off individual timers asynchronously.

Any suggestions on how to do that?

=============================================================

Sorry, don’t have the link off hand for the list that only goes to 12. Pretty sure I saw it on this forum, but lost the link when my IDE crashed.

---

<div class="post-metadata">

**Author:** ![LabSpokane](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@LabSpokane](https://community.particle.io/u/LabSpokane)\
**Post date:** [June 5, 2018, 9:03pm UTC](https://community.particle.io/t/electron-sos-code-13/42241/5 "2018-06-05T21:03:43Z")

</div>

> [@Core Firmware SOS Panic Codes](https://community.particle.io/t/core-firmware-sos-panic-codes/4337):
>
> Are you getting a red flashing LED after running your code on your Spark core? You may be getting a panic code, telling you what went wrong! The panic code is a red LED blinking out SOS (… — …) followed by N flashes, followed by another SOS. Here are the meanings of the N flashes, but #8, out of heap, is the most common: #1 Hard fault #2 Non-maskable interrupt fault #3 Memory Manager fault #4 Bus fault #5 Usage fault #6 Invalid length #7 Exit #8 Out of heap memory #9 SPI over-run #10 Asserti…

This is the thread with the codes only listed to 12.

Is there an official reference list in the official Particle documentation?

Thanks!

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [June 5, 2018, 9:15pm UTC](https://community.particle.io/t/electron-sos-code-13/42241/6 "2018-06-05T21:15:37Z")

</div>

[https://docs.particle.io/guide/getting-started/modes/electron/#red-flash-sos](https://docs.particle.io/guide/getting-started/modes/electron/#red-flash-sos)

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [June 5, 2018, 9:19pm UTC](https://community.particle.io/t/electron-sos-code-13/42241/7 "2018-06-05T21:19:43Z")

</div>

I fixed my post from several years ago to include 13 in case anyone else stumbles upon it.

---

<div class="post-metadata">

**Author:** ![LabSpokane](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@LabSpokane](https://community.particle.io/u/LabSpokane)\
**Post date:** [June 5, 2018, 10:33pm UTC](https://community.particle.io/t/electron-sos-code-13/42241/8 "2018-06-05T22:33:03Z")

</div>

Excellent! Thank you both very much.
