ESP32 任务看门狗(TaskWDT)组件与用户任务监控 看门狗机制用于监控嵌入式系统运行并在发生不可知的软硬件故障时将系统复位。系统正常运行时,看门狗定时器溢出之前会被重置计数值,也就是“喂狗”。定时器溢出意味着无法“喂狗”,系统异常。 0:BUG 前一阵在没事开着ESP32测试运行的时候,较长时间后会有很小的概率出...
这时用户要把需要被TWDT监控的任务添加到TWDT链表内,其接口是:esp_task_wdt_add 与此同时,用户要在自己的任务处理函数中进行喂狗操作,其接口时esp_task_wdt_feed 这里截取一部分esp_task_wdt_feed代码: 很显然,用户任务调用esp_task_wdt_feed喂狗时,esp_task_wdt_feed会找到当前运行的任务,也就是执行喂狗操...
.idle_core_mask=0,#ifCONFIG_ESP_TASK_WDT_PANIC.trigger_panic=true,#endif};#ifCONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0twdt_config.idle_core_mask|= (1<<0);#endif#ifCONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1twdt_config.idle_core_mask|= (1<<1);#endifESP_ERROR_CHECK(esp_task_wdt_...
E (10299) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time: E (10299) task_wdt: - reset task (CPU 0/1) E (10299) task_wdt: Tasks currently running: E (10299) task_wdt: CPU 0: IDLE0 E (10299) task_wdt: CPU 1: IDLE1 E (10299...
Re: 在主任务里面使用readdir导致task_wdt: Task watchdog got triggered!!! Quote by iincity » Wed Mar 29, 2023 12:25 am ESP_Junru wrote: ↑ Tue Mar 28, 2023 7:24 am 可能是 readdir 长时间运行导致看门狗未及时置位。 1. 将看门狗的触发时间调长 2. 将看门狗关闭 3. 将 readdir 任务...
E (32652) task_wdt: Tasks currently running: E (32652) task_wdt: CPU 0: loopTask E (32652) task_wdt: Aborting. abort() was called at PC 0x4013a8a4 on core 0 最终在对应产生问题的代码部分加入以下代码即可解决 vTaskDelay(1);
task_wdt: CPU 1: loopTask task_wdt: Aborting. abort() was called at PC 0x4010bbfc on core 0 Backtrace:0x40083bc5:0x3ffbecfc |<-CORRUPTED ELF file SHA256: 0000000000000000 Rebooting... This appears to show that there is a problem in the loop, where it is getting stuck somewhere. ...
})staticTaskHandle_t task_handles[portNUM_PROCESSORS];//Callback for user tasks created in app_main()voidreset_task(void*arg){//Subscribe this task to TWDT, then check if it is subscribedCHECK_ERROR_CODE(esp_task_wdt_add(NULL),ESP_OK);CHECK_ERROR_CODE(esp_task_wdt_status(NULL),ESP...
用户可以注释掉esp_task_wdt_reset()或esp_task_wdt_reset_user()调用以测试触发TWDT, //CHECK_ERROR_CODE(esp_task_wdt_reset(), ESP_OK); 这将导致以下输出: 看门狗被触发。 因为TWDT超时时间为3秒: #define TWDT_TIMEOUT_S 3 // TWDT超时时间 延时为10秒: vTaskDelay(pdMS_TO_TICKS(10000));...
/* If a task watchdog timer is running, we have to stop it. */ timerret = esp_task_wdt_stop(); #endif // CONFIG_ESP_TASK_WDT_USE_ESP_TIMER s_config.ccount_ticks_record = esp_cpu_get_cycle_count(); static portMUX_TYPE light_sleep_lock = portMUX_INITIALIZER_UNLOCKED; portENTER...