Hello There,
I'm looking to implement watchdog functionality in my app. Came across a query in phhalWdt_Start() API. As per the Doc it is declared as:
phStatus_t phhalWdt_Start(uint16_t pWdtTimeoutVal, uint16_t pWdtIntThreshVal, pphhalWdt_Handler_t pHandler, uint8_t bResetOnTimeOut);
But the use of pWdtIntThreshVal is not documented in API Guide. Also, There are no examples of WDT in the SDK.
I would be good if I can get reference example.
Regards,
Keshav Aggarwal
Hello @KeshavAggarwal
what is the implementation of watchdog_callback? if you don't want to reset your system and then here the count should be refreshed.
phhalWdt_Start(250, 100, watchdog_callback, 0); // here (100*21.5)ms will overflow and enter interrupt
Description for the two parameters :
1. threshold is the threshold value for WDT interrupt
2. timeout is the time for system reset, when enable resetOnTimeout, the following for your reference:
Best Regards,
kelly
There is one more issue, watching is not behaving correctly-
phhalWdt_DeInit();
phhalWdt_Start(250, 100, watchdog_callback, 0); //timeout ~ 5Secs
while(1)
{
phOsal_ThreadDelay(3500);
phhalWdt_Refresh();
}
I'm testing with this code. But getting system reboot even after resetting watchdog every 3.5 seconds.
Well I tried keeping the delay lower for testing and found watchdog doesn't reboot for delay of 2.5 seconds.
Any help will be appreciated