23 char *buf = buffer.data();
24 const size_t size = RESET_REASON_BUFFER_SIZE;
27 auto ret = hwinfo_get_reset_cause(&cause);
29 ESP_LOGE(TAG,
"Unable to get reset cause: %d", ret);
36 pos = append_reset_reason(buf,
size,
pos,
true,
"None");
38 pos = append_reset_reason(buf,
size,
pos, cause & RESET_PIN,
"External pin");
39 pos = append_reset_reason(buf,
size,
pos, cause & RESET_SOFTWARE,
"Software reset");
40 pos = append_reset_reason(buf,
size,
pos, cause & RESET_BROWNOUT,
"Brownout (drop in voltage)");
41 pos = append_reset_reason(buf,
size,
pos, cause & RESET_POR,
"Power-on reset (POR)");
42 pos = append_reset_reason(buf,
size,
pos, cause & RESET_WATCHDOG,
"Watchdog timer expiration");
43 pos = append_reset_reason(buf,
size,
pos, cause & RESET_DEBUG,
"Debug event");
44 pos = append_reset_reason(buf,
size,
pos, cause & RESET_SECURITY,
"Security violation");
45 pos = append_reset_reason(buf,
size,
pos, cause & RESET_LOW_POWER_WAKE,
"Waking up from low power mode");
46 pos = append_reset_reason(buf,
size,
pos, cause & RESET_CPU_LOCKUP,
"CPU lock-up detected");
47 pos = append_reset_reason(buf,
size,
pos, cause & RESET_PARITY,
"Parity error");
48 pos = append_reset_reason(buf,
size,
pos, cause & RESET_PLL,
"PLL error");
49 pos = append_reset_reason(buf,
size,
pos, cause & RESET_CLOCK,
"Clock error");
50 pos = append_reset_reason(buf,
size,
pos, cause & RESET_HARDWARE,
"Hardware reset");
51 pos = append_reset_reason(buf,
size,
pos, cause & RESET_USER,
"User reset");
52 pos = append_reset_reason(buf,
size,
pos, cause & RESET_TEMPERATURE,
"Temperature reset");