AnsweredAssumed Answered

STM32F0 has error with Independent Watchdog Timer

Question asked by stm32f0_mcu on Oct 23, 2016
Latest reply on Oct 23, 2016 by Clive One
Hi everybody!
I am using STM32F030 microcontroller and I met a problem with IWDG.
1. The following code is InitIWDG()
__HAL_RCC_LSI_ENABLE();
     
     
    /*##-3- Configure the IWDG peripheral ######################################*/
  /* Set counter reload value to obtain 800ms IWDG TimeOut.
     IWDG counter clock Frequency = LsiFreq / 32
     Counter Reload Value = 800ms / IWDG counter clock period
                          = 0.8s / (32/LsiFreq)         //LsiFreq=40 KHz
                          = 1000*/
  IwdgHandle.Instance = IWDG;
  IwdgHandle.Init.Prescaler = IWDG_PRESCALER_32;
  IwdgHandle.Init.Reload    = 1000;
  IwdgHandle.Init.Window    = IWDG_WINDOW_DISABLE;
 
  if (HAL_IWDG_Init(&IwdgHandle) != HAL_OK)
  {
    return 0;
  }
     
  /*##-4- Start the IWDG #####################################################*/
  if (HAL_IWDG_Start(&IwdgHandle) != HAL_OK)
  {
    return 0;
  }

2. The following code is Refresh()
/* Refresh IWDG: reload counter */
    if (HAL_IWDG_Refresh(&IwdgHandle) != HAL_OK)
      return 0;
    else
        return 1;

3. I use InitIWDG() in main() function, but my device did not reseted.
I tried to debug and I found that IWDG Instance were configured 
Please help me. Many thanks

Outcomes