# Core Firmware SOS Panic Codes

**URL:** https://community.particle.io/t/core-firmware-sos-panic-codes/4337
**Category:** Troubleshooting
**Created:** [May 13, 2014, 2:49pm UTC](https://community.particle.io/t/core-firmware-sos-panic-codes/4337 "2014-05-13T14:49:51Z")
**Posts on this page:** 5
**Page:** 1

<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: [May 13, 2014, 2:49pm UTC](https://community.particle.io/t/core-firmware-sos-panic-codes/4337/1 "2014-05-13T14:49:51Z")

</div>

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:

```auto
#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 Assertion failure
#11 Invalid case
#12 Pure virtual call
#13 Stack Overflow

```

---

<div class="post-metadata">

### Author: ![akrusen](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/akrusen/32/2905_2.png) [@akrusen](https://community.particle.io/u/akrusen)
#### Post date: [June 14, 2014, 12:04pm UTC](https://community.particle.io/t/core-firmware-sos-panic-codes/4337/2 "2014-06-14T12:04:05Z")

</div>

Very helpful! I find myself coming to this page quite often. The overview is nice.

Not being a computer scientist, it would be cool to know what a _hard fault_ is, or an _assertion failure_ Probably they are fixable, but it is unclear from the short list. Who feels like extending it with more detailed explanations / next steps for individual codes?

---

<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 14, 2014, 11:09pm UTC](https://community.particle.io/t/core-firmware-sos-panic-codes/4337/3 "2014-06-14T23:09:27Z")

</div>

This in the doc troubleshooting section now. I would check there.

---

<div class="post-metadata">

### Author: ![ryotsuke](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ryotsuke/32/1902_2.png) [@ryotsuke](https://community.particle.io/u/ryotsuke)
#### Post date: [July 3, 2014, 4:53pm UTC](https://community.particle.io/t/core-firmware-sos-panic-codes/4337/4 "2014-07-03T16:53:52Z")

</div>

What does “hard fault” means and how to deal with it?

---

<div class="post-metadata">

### Author: ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)
#### Post date: [October 21, 2016, 12:45pm UTC](https://community.particle.io/t/core-firmware-sos-panic-codes/4337/5 "2016-10-21T12:45:58Z")

</div>

Hi,

I do some external logging for my electron devices. In 0.6.0-rc2 you can use System.resetReason() and System.resetReasonData() for panic codes. While I found the values for resetReasons quite easy in the git-repository, I didn’t find the resetReasonCodes.

If you’re looking for the translation of the resetCodes and Panic-Codes - here they are:

**System.resetReason():**

```
RESET_REASON_NONE = 0,
RESET_REASON_UNKNOWN = 10, // Unspecified reason
// Hardware
RESET_REASON_PIN_RESET = 20, // Reset from the NRST pin
RESET_REASON_POWER_MANAGEMENT = 30, // Low-power management reset
RESET_REASON_POWER_DOWN = 40, // Power-down reset
RESET_REASON_POWER_BROWNOUT = 50, // Brownout reset
RESET_REASON_WATCHDOG = 60, // Watchdog reset
// Software
RESET_REASON_UPDATE = 70, // Successful firmware update
RESET_REASON_UPDATE_ERROR = 80, // Generic update error
RESET_REASON_UPDATE_TIMEOUT = 90, // Update timeout
RESET_REASON_FACTORY_RESET = 100, // Factory reset requested
RESET_REASON_SAFE_MODE = 110, // Safe mode requested
RESET_REASON_DFU_MODE = 120, // DFU mode requested
RESET_REASON_PANIC = 130, // System panic (additional data may contain panic code)
RESET_REASON_USER = 140 // User-requested reset

```

**System.resetReasonData:**

```
HardFault: 1
MemManage: 3
BusFault: 4
UsageFault: 5
OutOfHeap: 8
AssertionFailure: 10
StackOverflow: 13
```
