I'm using a ESP32-WROOM-32D together with a Microchip PIC-MCU. ESP32 should work as a SPI-Slave and must wait until the PIC is ready for SPI communication. Therefor I configure the CS-line as a GPIO-Input and wait till the PIC is pulling down this line:
Code: Select all
//code before main loop in "main.c"
while(gpio_get_level(GPIO_CS) == 1)
{
}
//main loop
while(1)
{
}
This seems clear, because the wdt is claered in the main loop (I guess). So, I was looking for a solution to reset the wdt and found the function:E (5307) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (5307) task_wdt: - IDLE (CPU 0)
E (5307) task_wdt: Tasks currently running:
E (5307) task_wdt: CPU 0: main
E (5307) task_wdt: CPU 1: IDLE
E (5307) task_wdt: Print CPU 0 (current core) backtrace
"rtc_wdt_feed()"
I add it into the wait_loop:
Code: Select all
while(gpio_get_level(GPIO_CS) == 1)
{
// just for test
if (!gpio_get_level(GPIO_CS))
{
ESP_LOGI(SPIS_Msg, "PIC is ready");
}
rtc_wdt_feed();
}
What is to do to reset the wdt in this situation?
Thank you for your support
Henry