Skip to main content
Explorer
October 28, 2025
Solved

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

  • October 28, 2025
  • 3 replies
  • 276 views

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!

    This topic has been closed for replies.
    Best answer by TDK

    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

     

    3 replies

    Super User
    October 28, 2025

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

    No (apart from option bytes).

    Explorer
    October 29, 2025

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

    TDKAnswer
    Super User
    October 29, 2025

    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