Page 1 of 1

Watchdog timer implementation

Posted: Fri Jun 07, 2019 1:26 am
by uCTRL
I am trying to understand the implementation of Watchdog timers in ESP32 Micropython.

Based on ESP-IDF documentation , there are two WDT.
The ESP-IDF has support for two types of watchdogs: The Interrupt Watchdog Timer and the Task Watchdog Timer (TWDT). The Interrupt Watchdog Timer and the TWDT can both be enabled using make menuconfig, however the TWDT can also be enabled during runtime. The Interrupt Watchdog is responsible for detecting instances where FreeRTOS task switching is blocked for a prolonged period of time. The TWDT is responsible for detecting instances of tasks running without yielding for a prolonged period.
https://docs.espressif.com/projects/esp ... /wdts.html

I have done some experimenting with Micropython pre-built firmware.
It appears that Micropython has some ties to FreeRTOS WDT, will reset the system if IRQ's are disabled.
However, I can not find more specific information on how ESP32 Micropython (pre-built firmware) works with underlying FreeRTOS Watchdog timers and implication on Micropython applications.

I need to build a robust system that will reset reliably in case of Micropython application or any other underlying OS lockups.

Would appreciate more information and clarification as I'm sure would others.

Best Regards

Re: Watchdog timer implementation

Posted: Fri Jun 07, 2019 8:29 pm
by uCTRL
Doesn't look like ESP32 port is taken seriously by micropython developers.

I guess you get what you pay for.

Re: Watchdog timer implementation

Posted: Sat Jun 08, 2019 2:56 am
by Mike Teachman
Is it possible to consider an external watchdog device in your design? That would deliver a more robust implementation than an internal watchdog. The TPS3823-33 device from TI works well for ESP32 designs - it has both a voltage monitor and watchdog timer.

Re: Watchdog timer implementation

Posted: Sat Jun 08, 2019 7:29 am
by pythoncoder
A "poor man's" solution is a software WDT such as this one but there is no question that external hardware offers the most robust solution.