2019-11-07 01:12 PM
Good day,
I'm using an STM32L152RE and utilize the standby mode quite often. Upon cold start, I set the RTC and I am able to enter standby mode and wakeup from standby mode based on the RTC time and alarm events.
My problem is this: I don't understand why the HAL_RTC_GetTime() and HAL_RTC_GetDate() functions return wrong values after wakeup from standby mode. Any other time I use these functions, the values returned are as expected.
Here's what I know:
The only thing that seems to work is to simply call the MX_RTC_Init() function and to NOT set the time. After doing this, the values returned are normal.
Even the values in the RTC BKUP registers are incorrect after standby mode. Only after I call MX_RTC_Init() without setting time the values are correct.