Merge branch 'trace_encoder_snapshot_coredump' into 'master'

Add trace snapshot to the coredump file

See merge request espressif/esp-idf!52451
This commit is contained in:
Erhan Kurubas
2026-09-17 14:41:18 +02:00
22 changed files with 1306 additions and 76 deletions
@@ -103,6 +103,11 @@ bool panic_memprot_fill_info(panic_info_t *info);
*/
void panic_disable_all_wdts(void);
/**
* @brief Stop instruction trace encoders on panic
*/
void esp_panic_handler_inst_trace_stop(void) __attribute__((weak));
#ifdef __cplusplus
}
#endif
@@ -148,6 +148,15 @@ static void panic_handler(void *frame, bool pseudo_excause)
kasan_disable_checks();
#endif
#if CONFIG_ESP_RISCV_TRACE_ENABLE
/* Stop the instruction trace as early as possible so the capture ends at the
crash rather than inside the panic handler. This only stops the encoders.
The FIFO flush and snapshot run later at coredump time. */
if (esp_panic_handler_inst_trace_stop) {
esp_panic_handler_inst_trace_stop();
}
#endif
/* If watchdogs are enabled, the panic handler runs the risk of getting aborted pre-emptively because
* an overzealous watchdog decides to reset it. Hence, we feed the WDTs here.
*