diff options
-rw-r--r-- | chip/stm32/clock-stm32f0.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/chip/stm32/clock-stm32f0.c b/chip/stm32/clock-stm32f0.c index fe474fe326..3586b64a5c 100644 --- a/chip/stm32/clock-stm32f0.c +++ b/chip/stm32/clock-stm32f0.c @@ -131,7 +131,13 @@ static inline void rtc_read(uint32_t *rtc, uint32_t *rtcss) /* Read current time synchronously */ do { *rtc = STM32_RTC_TR; - *rtcss = STM32_RTC_SSR; + /* + * RTC_SSR must be read twice with identical values because + * glitches may occur for reads close to the RTCCLK edge. + */ + do { + *rtcss = STM32_RTC_SSR; + } while (*rtcss != STM32_RTC_SSR); } while (*rtc != STM32_RTC_TR); } |