[esp32] Add crash handler to capture and report backtrace across reboots (#14709)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2026-03-12 14:00:20 +13:00
1 parent ddc40f44fa
commit 8daa946afa
10 files changed
+451

No files matched your search

+6
View File
@@ -1,6 +1,7 @@
#ifdef USE_ESP32
#include "esphome/core/defines.h"
#include "crash_handler.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
#include "preferences.h"
@@ -36,6 +37,11 @@ void arch_restart() {
}
void arch_init() {
#ifdef USE_ESP32_CRASH_HANDLER
// Read crash data from previous boot before anything else
esp32::crash_handler_read_and_clear();
#endif
// Enable the task watchdog only on the loop task (from which we're currently running)
esp_task_wdt_add(nullptr);