cancel
Showing results for 
Search instead for 
Did you mean: 

How to Enable/Disable Watchdog During Sleep Without Reset on STM32

vijayrakesh
Associate II

Hello STM32 community,

I’m working on a project where I need to temporarily disable/enable the watchdog before entering into low-power/sleep modes, but I want to avoid resetting the MCU.

Here’s the context:

  • I’m using an STM32U385 MCU

  • I know that watchdog configuration can be changed via option bytes, but changes only take effect after a reset.

  • In my scenario, performing a reset is not acceptable because I need the MCU to resume execution seamlessly after sleep.

Problem:

  • The Independent Watchdog (IWDG) starts automatically once configured and cannot be stopped at runtime.

  • I want to enter sleep modes (like Stop or Standby) without being reset by the watchdog, but also in some scenarios watchdog needs to be run in sleep modes.

What I’ve considered:

  • Using HAL FLASH option bytes to set IWDG to software mode — works, but requires a reset.

Question for the community:

  1. Is there a hardware-supported way to enable/disable the IWDG during sleep without resetting the MCU?

Any insights, examples, or best practices would be greatly appreciated.

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

WWDG is not supported in stop/standby and it always runs in sleep mode. It cannot be stopped or paused after it has been started.

That is intentional to the design of a watchdog. It should not be able to be modified by rogue code.

STM32U3 series Arm<Sup>®</Sup>-based 32-bit MCUs - Reference manual

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Super User

> Is there a hardware-supported way to enable/disable the IWDG during sleep without resetting the MCU?

No (apart from option bytes).

If you feel a post has answered your question, please click "Accept as Solution".
vijayrakesh
Associate II

Hi @TDK, thanks for the response. Is it the same for the WWDG?

TDK
Super User

WWDG is not supported in stop/standby and it always runs in sleep mode. It cannot be stopped or paused after it has been started.

That is intentional to the design of a watchdog. It should not be able to be modified by rogue code.

STM32U3 series Arm<Sup>®</Sup>-based 32-bit MCUs - Reference manual

 

If you feel a post has answered your question, please click "Accept as Solution".