You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RTC should contain an assertion checking if the prescaler values are configured or not. Or check if configured and if not, call the function to compute the values.
In case only a soft reset is performed, the RTC remains initialized, the above mentioned code is not executed and prescaler values are not calculated. Therefore they remain set to -1. Then when setting and RTC alarm with subseconds enabled, the following issue occurs:
these variables remain set to the initial default value
This leads to reserved bits in the register being written to 1 and generally incorrect behaviour. This is not easy to debug and just a note in the readme that the function setPrediv() must be called before begin() can easly be missed.
The examples also don't call this function, which makes the issue even more hidden. Maybe some boards ensure that invalid values are not written to registers and this issue is not observed on them.
The text was updated successfully, but these errors were encountered:
RTC should contain an assertion checking if the prescaler values are configured or not. Or check if configured and if not, call the function to compute the values.
This portion of code
STM32RTC/src/rtc.c
Lines 382 to 398 in 95b7514
STM32RTC/src/rtc.c
Line 391 in 95b7514
In case only a soft reset is performed, the RTC remains initialized, the above mentioned code is not executed and prescaler values are not calculated. Therefore they remain set to -1. Then when setting and RTC alarm with subseconds enabled, the following issue occurs:
STM32RTC/src/rtc.c
Lines 69 to 71 in 95b7514
STM32RTC/src/rtc.c
Lines 611 to 612 in 95b7514
STM32RTC/src/rtc.c
Line 654 in 95b7514
This leads to reserved bits in the register being written to 1 and generally incorrect behaviour. This is not easy to debug and just a note in the readme that the function setPrediv() must be called before begin() can easly be missed.
The examples also don't call this function, which makes the issue even more hidden. Maybe some boards ensure that invalid values are not written to registers and this issue is not observed on them.
The text was updated successfully, but these errors were encountered: