cancel
Showing results for 
Search instead for 
Did you mean: 

independant wdogtimer and multithreads

TARHAN SAMAH
Senior
Posted on July 06, 2018 at 09:17

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 

6 REPLIES 6
AvaTar
Lead
Posted on July 06, 2018 at 09:22

And what is the question ?

Posted on July 06, 2018 at 09:48

sorry the question has been deleted by mistake ,

im i right to put

HAL_IWDG_Refresh(&hiwdg); 

in every thread while(1) loop

i mean is it correct to have 3 refrech ?

Posted on July 06, 2018 at 10:13

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.

Posted on July 06, 2018 at 11:01

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 ?

Posted on July 06, 2018 at 11:15

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.

Posted on July 06, 2018 at 12:43

thanks