Not understanding IWDG and HAL in STM32F7
Hi,
I am trying to get working IWDG using HAL_IWDG library and I am not able to refresh the watchdog before IWDG_Reset.
I must refresh watchdog when RL < WINR
Watchdog timeout is set to 10s. wdgReset() is called from main loop, which I know is not consuming 10s.
MCU has a reset every 10s as a consequence
IWDG_HandleTypeDef t_wdg;
void wdgInit(void){
t_wdg.Instance = IWDG;
t_wdg.Init.Prescaler = IWDG_PRESCALER_256;
t_wdg.Init.Reload = 1250;
t_wdg.Init.Window = 1250;
HAL_IWDG_Init(&t_wdg);
}
void wdgReset(void){
if(t_wdg.Instance->RLR < t_wdg.Init.Window){
HAL_IWDG_Refresh(&t_wdg);
}
}What I am missing?
Kind Regards,
Rafa