AnsweredAssumed Answered

How can reset micro controller when watchdog occur ?

Question asked by patil.kalpesh on Apr 6, 2017
Latest reply on May 3, 2017 by Nesrine M

Hello everyone , I am using stm32f0 with keil MDK 5 and St cube mx to generate the code. In my project I want to add  watchdog reset(WWDG) function. I can add WWDG but i want to reset the system when WWDG occurs. i didn't understand how to reset the system when WWDG occurs.

 

my setting for WWDG  :-

 

hwwdg.Init.Prescaler = WWDG_PRESCALER_8;

hwwdg.Init.Window = 80;

hwwdg.Init.Counter = 127;

 

Refresh WWDG: update counter value to 127, the refresh window is:
between 32.1ms (~683 * (127-80)) and 43.7ms (~683 * 64) 

 

 

code :-

while (1) {

HAL_Delay(44);

HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);

HAL_WWDG_Refresh(&hwwdg,127);

}

/************/

 

 

 

 

In above code when i changed delay is lower than 44msec . it working fine. but when i am changing the delay to 50 or more then it stop working of micro controller. I want to reset the micro controller when WWDC occurs. I didn't want to stop the system it will take automatically system reset. 

 

please help me 

 

sorry for poor English

 

thank you 

Outcomes