This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

WDT and Error Handler

This ticket started as a mail thread so I add it here so no data are missing:

============================================================================================================================ 

Yes I based my code from this sample code so I use the exact same steps and variables (5 seconds timeout). I do not use the wdt_feed() and it still works and I assume that if we do not feed the dog it will hang after 5 seconds. But it does not do that but I can see sporadic reboot within one hour.

For the callback issue I do use a debugger and it never enter the callback.

So having a WDT driver that do not needs feed, no working callback and sporadic restarts seems to be a broken implementation in Zephyr!

How can you fix this and when?

============================================================================================================================

Regarding the watchdog - there is a nice sample presenting how to use the API:

https://github.com/zephyrproject-rtos/zephyr/blob/master/samples/drivers/watchdog/src/main.c

Have you tried to follow this one?

Basically you need to call wdt_install_timeout(), then wdt_setup(), and then feed the watchdog with wdt_feed() within the time configured when installing the timeout.

And when checking if the watchdog callback function is called, remember that this function is called two cycles of the 32 kHz clock before the reset is done, so it is a very little time to do something. In case you’d want to set a breakpoint in this function, you’ll need to use the WDT_OPT_PAUSE_HALTED_BY_DBG option.

============================================================================================================================

I have two question regarding WTD and Error-handler.

  1. I have enabled WDT in Zephyr and implemented the setup and enable of the WDT and it seems to work, but …
    I do not use the wdt_feed() api but still it works but I could get sporadic restart within an hour a so. I also note that the callback function is not called when watchdog has expired.
  2. For the Error-Handler; And there are a lot of different fault handler for different failure and exceptions. And I want to enable reset when this happens. So is there any support for reset when we end up in any error handler?
Parents Reply Children
No Data
Related