2025-02-01 02:20 AM
Hello,
I am working with STM32G030K8T6 microcontroller and I am using an independent watchdog (IWDG). The device goes into standby mode under certain conditions, but since I cannot turn off the IWDG, I am trying to reset the IWDG by waking up with RTC wake-up before the watchdog expires. The reset time of the IWDG is set to 32.8 seconds, so I am trying to set the RTC wake-up timer to 30 seconds so that the device wakes up before the IWDG expires. During normal operation I disable RTC wake-up, before going into standby I enable it and after 30 seconds I expect the RTC wake-up interrupt to run and reset the IWDG with the “HAL_RTCEx_WakeUpTimerEventCallback” function. However, after standby the system seems to reset completely and the wake-up callback function does not work, so the device resets without resetting the IWDG. My thought was that the “HAL_RTCEx_WakeUpTimerEventCallback” function will work while in standby and then it will go back to standby mode. But it doesn't work like that.
How can I control the IWDG while in standby?
Best regards.
2025-02-01 06:30 AM
The accuracy of the IWDG is not good. I wouldn't be surprised if it's resetting prior to the 30 seconds you've set up. Otherwise, what you have outlined should be working.
Work in steps. Check the timeout of IWDG, then set up RTC wake up, then put them together.