2018-07-06 12:17 AM
hello , i have a software with three threads (frtos ;multi threads);
i need to add independant watchdogtimer incase my software bugs to keep it running ;
for that :ill add
HAL_IWDG_Refresh(&hiwdg);//put counter to zero to not reach timout
at the beginning of each while loop
2018-07-06 12:22 AM
And what is the question ?
2018-07-06 02:48 AM
sorry the question has been deleted by mistake ,
im i right to put
HAL_IWDG_Refresh(&hiwdg);
in every thread while(1) loopi mean is it correct to have 3 refrech ?
2018-07-06 03:13 AM
Depends on the type of watchdog, but good style is it not.
Windowed watchdogs will cause a reset if you trigger them randomly.
First, a watchdog should not be used as a regular measure in your firmware, like covering up bugs. Rather it is a last line of defence, especially for hardware-induced problems.
I don't know your RTOS environmet, but best is to trigger the watchdog from a task that is called regularly.
I'm using OSEK in an application, and the watchdog is triggered in a 10ms realtime task.
2018-07-06 04:01 AM
thanks for answering : im using independants watchdogtimer and freertos,
i solves all the bugs almostly but very very rarely it bugs this is not good for my device that ill produce and sell on market i need to keep it working,
so unfortenetly i need this wtdogtimer ,
i have three threads ,,, one thread send frames by uart , one process frames received by uart (interrupt), one is for all my lcd msg
so what do you suggest me to do ?
2018-07-06 04:15 AM
I don't know your application and it's structure, so I can't give detailed advice.
But a call rate of about 1/10 of the WD timeout would be a good starting point.
2018-07-06 05:43 AM
thanks