Skip to main content
TARHAN SAMAH
Senior
July 6, 2018
Question

independant wdogtimer and multithreads

  • July 6, 2018
  • 6 replies
  • 1056 views
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 

    This topic has been closed for replies.

    6 replies

    AvaTar
    Senior III
    July 6, 2018
    Posted on July 06, 2018 at 09:22

    And what is the question ?

    TARHAN SAMAH
    Senior
    July 6, 2018
    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 ?

    AvaTar
    Senior III
    July 6, 2018
    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.