Add Task Watchdog backtrace printing

This commit makes the Task Watchdog print the backtrace of both
cores when it times out.
This commit is contained in:
Darian Leung
2020-03-27 17:58:12 +08:00
committed by bot
parent 676905709a
commit 29d6823d2f
3 changed files with 33 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
#include "esp_attr.h"
#include "esp_err.h"
#include "esp_intr_alloc.h"
#include "esp_debug_helpers.h"
#include "esp32/rom/ets_sys.h"
#include "esp32/rom/uart.h"
@@ -35,6 +36,7 @@
#define REASON_YIELD BIT(0)
#define REASON_FREQ_SWITCH BIT(1)
#define REASON_PRINT_BACKTRACE BIT(2)
static portMUX_TYPE reason_spinlock = portMUX_INITIALIZER_UNLOCKED;
static volatile uint32_t reason[ portNUM_PROCESSORS ];
@@ -75,6 +77,9 @@ static void IRAM_ATTR esp_crosscore_isr(void *arg) {
* to allow DFS features without the extra latency of the ISR hook.
*/
}
if (my_reason_val & REASON_PRINT_BACKTRACE) {
esp_backtrace_print(100);
}
}
//Initialize the crosscore interrupt on this core. Call this once
@@ -116,3 +121,7 @@ void IRAM_ATTR esp_crosscore_int_send_freq_switch(int core_id)
esp_crosscore_int_send(core_id, REASON_FREQ_SWITCH);
}
void IRAM_ATTR esp_crosscore_int_send_print_backtrace(int core_id)
{
esp_crosscore_int_send(core_id, REASON_PRINT_BACKTRACE);
}