From 7acf3f77c45000a5d18638368c7237700d3e81e1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 11 Mar 2026 11:06:15 -1000 Subject: [PATCH] Increase max backtrace depth from 8 to 16 8 frames was cutting off useful call stack information. 16 frames costs an additional 32 bytes of .noinit RAM and covers typical ESPHome call chains which can be 10-12 frames deep. --- esphome/components/esp32/crash_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/esp32/crash_handler.cpp b/esphome/components/esp32/crash_handler.cpp index 563f0cbdf49..043f64acf65 100644 --- a/esphome/components/esp32/crash_handler.cpp +++ b/esphome/components/esp32/crash_handler.cpp @@ -17,7 +17,7 @@ #endif static constexpr uint32_t CRASH_MAGIC = 0xDEADBEEF; -static constexpr size_t MAX_BACKTRACE = 8; +static constexpr size_t MAX_BACKTRACE = 16; // Check if an address looks like code (flash-mapped or IRAM). // Must be safe to call from panic context (no flash access needed).