cancel
Showing results for 
Search instead for 
Did you mean: 

I am using a STM32G474 and testing it in a nucleo-64 board. When I enable the hardware window watchdog and the hardware independent watchdog my software does not run. it seems to get stuck after each startUp.

AMija.1
Associate

The hardware watchdogs is set through an option byte modification done by software and right afterwards the WWDG and IWDG init functions are called as well as the refresh API, called periodically.

If I change my code to use the SW WWDG and IWDG then the program works perfectly. And in case I do not refresh them the corresponding reset is generated.

Is there something I am missing to correctly use the Hardware watchdogs?

Thank you in advance,

AnMi

1 REPLY 1
Pierre_Paris
ST Employee

Hello AnMi @AMija.1,

As you said, the independent watchdog hardware is enabled by the device’s option bytes

Once enabled through OB, the watchdog is automatically enabled at power-on, and generates a reset unless the IWDG key register (IWDG_KR) is written by the software before the counter reaches end of count or if the downcounter is reloaded inside the window. 

Here are some investigation possibilities:

  • Have you set any prescaler (IWDG_PR) for the input clock ? (The independent watchdog is clocked by its own dedicated low-speed clock (LSI) at 32 kHz)
  • Is the Key Register (IWDG_KR) refreshed at regular intervals before the counter reaches 0 ?
  •  Can you please make sure the IWDG_RLR is automatically loaded with 0xFFF and starts to count down ?
  • What init/API functions did you call ? (and the order) 

Best Regards,

Pierre

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.