preview:
- Working with ESP-WROOM-32 DEVKIT
- ARDUINO IDE with 1.0.6 ESP32 boad manager
Problem:
In setup statement I create a new task pinned to core 0 and I add this task to TWDT supervision.
In the task loop function I reset the TWDT only if a button on GPIO14 is unpressed, else ESP32 waits for TWDT reboot; however the TWDT is trigger by the IDLE0 task (that I don't now what it is) and the backtrace in serial is the following:
Code: Select all
E (30162) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (30162) task_wdt: - IDLE0 (CPU 0)
E (30162) task_wdt: Tasks currently running:
E (30162) task_wdt: CPU 0: TASK0_T
E (30162) task_wdt: CPU 1: IDLE1
E (30162) task_wdt: Aborting.
abort() was called at PC 0x400e0fd3 on core 0
ELF file SHA256: 0000000000000000
Backtrace: 0x40084e9c:0x3ffbe4e0 0x40085111:0x3ffbe500 0x400e0fd3:0x3ffbe520 0x4008382d:0x3ffbe540 0x400d1c61:0x3ffb4650 0x400d0db5:0x3ffb4670 0x400d0f9e:0x3ffb4690 0x400d0fc5:0x3ffb46b0 0x400d0bf1:0x3ffb46d0 0x40086121:0x3ffb46f0
Rebooting...
Code: Select all
#include <soc/rtc_wdt.h>
#include <esp_int_wdt.h>
#include <esp_task_wdt.h>
TaskHandle_t task0_t;
void task0Loop(void *pvParameters) {
while (1) {
Serial.println("Resetting task0 WDT...");
esp_task_wdt_reset();
while (!digitalRead(14)) {
delay(10);
}
}
}
void taskInit(){
xTaskCreatePinnedToCore(
task0Loop, /* Task function. */
"TASK0_T", /* name of task. */
10000, /* Stack size of task */
NULL, /* parameter of the task */
3, /* priority of the task */
&task0_t, /* Task handle to keep track of created task */
0);
}
//WDT
void initWDT() {
//Intrrupt WTD
esp_int_wdt_init();
//TWDT
esp_task_wdt_init(10, true);
esp_task_wdt_add(task0_t);
}
void setup() {
Serial.begin(115200);
delay(5000);
taskInit();
initWDT();
pinMode(14, INPUT_PULLUP);
pinMode(13, INPUT_PULLUP);
}
void loop() {
}
Alan Masutti