feat(esp_riscv_trace): Add trace snapshot to the coredump file

This commit is contained in:
Erhan Kurubas
2026-09-16 15:00:57 +02:00
parent e492079576
commit 7ed58ee6a5
18 changed files with 1165 additions and 74 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.
*