Watchdog module for ESP32

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
honza.klu
Posts: 3
Joined: Sun Sep 03, 2017 4:57 pm

Watchdog module for ESP32

Post by honza.klu » Sun Sep 03, 2017 5:27 pm

Hi,
I'm trying to add watchdog functionality to ESP32 port of micropython. I want to use RTOS task watchdog and I got it almost working. I started with enabling WDT for CPU1 (CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1), setting WDT action to panic (CONFIG_TASK_WDT_PANIC 1) and setting panic action to reboot (CONFIG_ESP32_PANIC_PRINT_REBOOT 1). I also added C module that allows to call esp_task_wdt_feed() function.
This solution is almost working. Interpreter is working as long as feed is called regulary and watchdog is triggered when it is not feed for long time. Unfortunately watchdog does not cause restart it only freeze interpreter. Last message on console is "Rebooting..." and few ascii characters. But I don't know if it really rebooted and freeazed just after restart or if it is hanged just before rebooting. Can you give me any advice how to debug this issue? Do you have any idea what is causing this problem?

There is example of console output:
[code]
>>> import machine
>>> wdt = machine.WDT(0)
>>> wdt.feed()
>>> Task watchdog got triggered. The following tasks did not feed the watchdog in time:
Tasks currently running:
CPU 0: IDLE
Aborting.
abort() was called at PC 0x400ff259 on core 0

Backtrace: 0x40086edf:0x3ffb05a0 0x40086f0b:0x3ffb05c0 0x400ff259:0x3ffb05e0 0x400829c5:0x3ffb0600

Rebooting...
�w�
[/code]

Post Reply