Skip to main content
feixiao
Associate II
June 23, 2026
Solved

will IWDG stop after system reset before next time initialization if option byte IWDG_SW equal TRUE?

  • June 23, 2026
  • 3 replies
  • 95 views

hi

for stm32G4 series, 

if MCU option byte IWDG_SW equal TRUE, and the software start the IWDG by calling HAL_IWDG_Init(),

when a system reset happen( for example, call HAL_NVIC_SystemReset() or IWDG reset), will IWDG stop counting before  next time initialization?

 

 

Best answer by mƎALLEm

From the reference manual:

So if the IWDG is enabled in the option byte the counter is running automatically after reset until you write the key to the IWDG_KR register to reset the counter. Otherwise if it reaches 0 that resets the MCU.

Hope it’s clear.

3 replies

mƎALLEm
ST Technical Moderator
June 23, 2026

Hello,

When the IWDG_SW option byte is enabled, the IWDG can be started by software. If the option bits are configured to enable automatic IWDG activation, the IWDG is automatically enabled at power-on and after any reset (including software reset via HAL_NVIC_SystemReset() or a reset caused by the IWDG itself). In this configuration, the IWDG will continue running after a reset and will not stop counting unless the device is powered down or the option bytes are reconfigured. The software must reload the IWDG counter before it reaches zero to avoid another reset.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
feixiao
feixiaoAuthor
Associate II
June 23, 2026

Thanks for responding.

Can I undertand like this: in conclusion, when option byte IWDG_SW value is 1, it is a software iwdg, and it will NOT enabled automatically after system reset?

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
June 23, 2026

From the reference manual:

So if the IWDG is enabled in the option byte the counter is running automatically after reset until you write the key to the IWDG_KR register to reset the counter. Otherwise if it reaches 0 that resets the MCU.

Hope it’s clear.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.