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