SLAU846A June 2023 – October 2023 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1
After a device reset occurs, the lowest level reset cause which occurred during reset processing is captured in hardware so that application software can interrogate the reason for the reset and take any appropriate action when starting the application. The lowest level reset cause is encoded into a 5-bit field in the reset cause register in SYSCTL. The contents of the reset cause register are always cleared upon a read, and return zero after being read if no reset has occurred after the read. The reset cause encodings are given in Table 2-13.
Reset | Device Modules Reset | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Reset Level | Cause ID | Reset Cause | NRST/SWD Disables | SHUTDN STOREx | Core Regulator | Debug Subsystem | RTC, LFXT, LFCLK State | SRAM | BCR Execution | IOMUX | EVENT, DMA, FLASHCTL | Peripherals | CPU | |
0x00 | 0 | No reset since last read | ||||||||||||
POR | 0x01 | 1 | VDD < POR- violation | R | R | R | R | R | R | R | R | R | R | R |
PMU trim parity fault | ||||||||||||||
SHUTDNSTOREx parity fault | ||||||||||||||
0x02 | 2 | NRST pin reset (>1s) | R | R | R | R | R | R | R | R | R | R | R | |
0x03 | 3 | Software-triggered POR | R | R | R | R | R | R | R | R | R | R | R | |
BOR | 0x04 | 4 | VDD < BOR- violation | R | R | R | R | R | R | R | R | R | ||
0x05 | 5 | Wake from SHUTDOWN | R | R | R | R | R | R(1) | R | R | R | |||
0x06 | 6 | Reserved | ||||||||||||
0x07 | 7 | Reserved | ||||||||||||
BOOTRST | 0x08 | 8 | Non-PMU trim parity fault | R | R | R | R | R | R | R | ||||
0x09 | 9 | Fatal clock fault | R | R | R | R | R | R | R | |||||
0x0A | 10 | Reserved | ||||||||||||
0x0B | 11 | Reserved | ||||||||||||
0x0C | 12 | NRST pin reset (<1 s) | R | R | R(2) | R | R | R | ||||||
0x0D | 13 | Software-triggered BOOTRST | R | R | R(2) | R | R | R | ||||||
0x0E | 14 | WWDT0 violation | R | R | R(2) | R | R | R | ||||||
0x0F | 15 | Reserved | ||||||||||||
SYSRST | 0x10 | 16 | BSL exit | R | R(2) | R | R | R | ||||||
0x11 | 17 | BSL entry | R | R(2) | R | R | R | |||||||
0x12 | 18 | Reserved | ||||||||||||
0x13 | 19 | WWDT1 violation | R(2) | R | R | R | ||||||||
0x14 | 20 | Uncorrectable flash ECC error | R(2) | R | R | R | ||||||||
0x15 | 21 | CPULOCK violation | R(2) | R | R | R | ||||||||
0x16 | 22 | Reserved | ||||||||||||
0x17 | 23 | Reserved | ||||||||||||
0x18 | 24 | Reserved | ||||||||||||
0x19 | 25 | Reserved | ||||||||||||
0x1A | 26 | Debug-triggered SYSRST | R(2) | R | R | R | ||||||||
0x1B | 27 | Software-triggered SYSRST | R(2) | R | R | R | ||||||||
CPURST | 0x1C | 28 | Debug-triggered CPURST | R | ||||||||||
0x1D | 29 | Software-triggered CPURST | R | |||||||||||
0x1E | 30 | Reserved | ||||||||||||
0x1F | 31 | Reserved |
If two reset causes occur simultaneously, the lowest cause reset ID value is prioritized and reported. For example, if a WWDT0 violation (cause 0x12) occurs at the same time that a VDD < BOR- violation (cause 0x04) occurs, the reported reset cause is a BOR- violation (cause 0x04), as this is a lower level reset which clears additional aspects of the device state.
The reset cause encoding enables simple software handling during application startup. The reset cause value can be read by application software and tested to be within a certain value range to determine if the following occurred:
The following example shows how the reset cause can be tested to take specific actions when starting an application after a reset:
// Read reset cause into SRAM variable
uint8_t cause = RESETCAUSE;
// Handle device re-configuration based on reset cause level
if (cause!=0)
{
if (cause<0x04)
{
// NRST/SWD disable state was lost
// SHUTDNSTOREx memory state was lost
// PMU/VCORE domain state was lost
// RTC/LFXT/LFCLK state was lost
}
if (cause<0x0B)
{
// RTC/LFXT/LFCLK state was lost
}
if (cause<0x1C)
{
// The peripherals were reset
}
}