/* ==================================================================== */
// i.MX RT1060 Processor Reference Manual, 21.8.3 SRC Reset Status Register
void resetCause(uint32_t resetStatusReg) {
bool info = false;
if (resetStatusReg & SRC_SRSR_TEMPSENSE_RST_B) {
Serial.println("Temperature Sensor Software Reset");
info = true;
}
if (resetStatusReg & SRC_SRSR_WDOG3_RST_B) {
Serial.println("IC Watchdog3 Timeout Reset");
info = true;
}
if (resetStatusReg & SRC_SRSR_JTAG_SW_RST) {
Serial.println("JTAG Software Reset");
info = true;
}
if (resetStatusReg & SRC_SRSR_JTAG_RST_B) {
Serial.println("High-Z JTAG Reset");
info = true;
}
if (resetStatusReg & SRC_SRSR_WDOG_RST_B) {
Serial.println("IC Watchdog Timeout Reset");
info = true;
}
if (resetStatusReg & SRC_SRSR_IPP_USER_RESET_B) {
Serial.println("Power-up Sequence (Cold Reset Event)");
info = true;
}
if (resetStatusReg & SRC_SRSR_CSU_RESET_B) {
Serial.println("Central Security Unit Reset");
info = true;
}
if (resetStatusReg & SRC_SRSR_LOCKUP_SYSRESETREQ) {
Serial.println("CPU Lockup or Software Reset");
info = true;
/* Per datasheet: "SW needs to write a value to SRC_GPR5
* before writing the SYSRESETREQ bit and use the SRC_GPR5
* value to distinguish if the reset is caused by SYSRESETREQ
* or CPU lockup."
*/
}
if (resetStatusReg & SRC_SRSR_IPP_RESET_B) {
Serial.println("Power-up Sequence");
info = true;
}
if (!info) {
Serial.println("No status bits set in SRC Reset Status Register");
}
}