cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 has error with Independent Watchdog Timer

robotden
Associate
Posted on October 23, 2016 at 19:03

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 #stm32f0-iwdg-watchdog
1 REPLY 1
Posted on October 23, 2016 at 19:46

Are you perhaps actively driving NRST high in your design?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..