2026-02-12 6:25 AM
I am using software Independent watchdog at STM32H735IGK and i want to freeze it when entering standby mode.
I set option byte FW_IWDG_SDBY unchecked but unfortunately it is not working and my program keeps getting out from standby mode.
My code:
At init:
MX_IWDG1_Init();
While the program is running:
__HAL_IWDG_RELOAD_COUNTER(hiwdg);
When entering standby:
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
HAL_PWREx_ClearWakeupFlag (PWR_WAKEUP_FLAG_ALL);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
__HAL_PWR_CLEAR_WAKEUPFLAG(PWR_FLAG_WKUP1); // E1
__HAL_PWR_CLEAR_WAKEUPFLAG(PWR_FLAG_WKUP4); // INT
//Configuring wakeup pins
PWREx_WakeupPinTypeDef sWakeupPin1;
sWakeupPin1.WakeUpPin = PWR_WAKEUP_PIN1;
sWakeupPin1.PinPolarity = PWR_PIN_POLARITY_LOW; // Flanco de bajada
sWakeupPin1.PinPull = PWR_PIN_PULL_UP;
HAL_PWREx_EnableWakeUpPin(&sWakeupPin1);
PWREx_WakeupPinTypeDef sWakeupPin4;
sWakeupPin4.WakeUpPin = PWR_WAKEUP_PIN4;
sWakeupPin4.PinPolarity = PWR_PIN_POLARITY_LOW; // Flanco de bajada
sWakeupPin4.PinPull = PWR_PIN_PULL_UP;
HAL_PWREx_EnableWakeUpPin(&sWakeupPin4);
__DSB();
__ISB();
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0xFFFF,RTC_WAKEUPCLOCK_RTCCLK_DIV16);
HAL_PWR_EnterSTANDBYMode();
Option bytes seen at Cube Programmer:
Thanks by advance!
2026-02-13 3:17 AM
Hello @amartin
To prevent the IWDG from resetting the MCU while it is in Standby, you need to enable (check) the FZ_IWDG_SDBY option byte. The IWDG will be frozen both in STOP (already done via FZ_IWDG_STOP) and in STANDBY, so the device will only exit Standby due to the RTC wakeup timer or the configured wakeup pins, not because of the watchdog.
2026-02-13 3:23 AM
Hi, @Saket_Om
At CubeProgrammer it says: "Unchecked: independet watchdog is freezed in STANDBY mode. Checked: Independent watchdog is running in STANDBY mode".
I want the independent watchdog to be freezed at standby mode.
I have checked corresponding reg and it is set to 0 which acoording to RefManual:
"Bit 18 IWDG_FZ_SDBY: IWDG Standby mode freeze option status bit
When set the independent watchdog IWDG1 is frozen in system Standby mode.
0: Independent watchdog frozen in Standby mode
1: Independent watchdog keep running in Standby mode."
Thanks for your answer
2026-02-13 4:46 AM
Hello @amartin
Could you also try suspending the SysTick before entering Standby mode?
For example:
HAL_SuspendTick();
HAL_PWR_EnterSTANDBYMode();
2026-02-13 4:58 AM
Sure, i have just added the line but it is still not working. The behavior is the same as before. The software keeps restarting by watchdog.
I have added it just before HAL_PWR_EnterSTANDBYMode();
HAL_SuspendTick();
HAL_PWR_EnterSTANDBYMode();
2026-02-15 10:04 PM
> I set option byte FW_IWDG_SDBY unchecked but unfortunately it is not working and my program keeps getting out from standby mode.
What do you mean by "my program keeps getting out from standby mode"? How are you observing that exactly?
2026-02-16 12:39 AM
After executing
HAL_PWR_EnterSTANDBYMode();
When the watchdog time ends (in my case ~8sec), the program resets and i observe at RCC->RSR that the flag RCC_FLAG_WWDG1RST is set.
2026-02-16 6:15 AM
> When the watchdog time ends (in my case ~8sec), the program resets and i observe at RCC->RSR that the flag RCC_FLAG_WWDG1RST is set.
That is so much clearer, thank you.
WWDG1 is independent from the IWDG1. If WWDG1 is resetting the chip, this has nothing to do with the IWDG1 configuration.
But I suspect that's a typo, in which case:
If you can produce and upload a minimal working example that does this, I will try to duplicate here. What you are trying to do should be possible.
2026-02-17 8:38 AM
Sorry, as you suspected that was a typo.
I have discovered that if i use
HAL_DBGMCU_DisableDBGStandbyMode();
my watchdog does not get my system out from standby.
But when this happens i have a problem while getting out of standby mode (when DBGMCU_CR -> DBGSLEEP_D1 is disabled) which might be a diferent problem but doesnt allow me to use this.
I am using a custom pcb and configuring power mode SMPS + LDO.
When my sistem enters Standby mode and i see Vcap = 0V (while VLDO remains ~2.4V).
At standby mode, after 842us of activating the wakeup pin i have configured (blue signal), Vcap starts raising to 1V (the voltage raise to 1V time is 86us), but it seems that the core domain gets lost at this point (no program starts and even not any hardware reset can get the mcu out of this state, just powering down and up the hardware gets the mcu out of that state).
Some interesting context for the issue:
I am using a custom hardware:
I am configuring:
HAL_PWREx_ConfigSupply(PWR_SMPS_2V5_SUPPLIES_LDO);
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
520MHz SYSCLK.
I have no problem switching from power off but i do when getting out from standby mode.
Thanks for your help!