New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32 RTC backup registers get reset when setting the clock #1634
Comments
We made some trials and these 2 lines are only needed when the LSI is used. For the LSE, they can be removed. What we are going to do is to move these 2 lines in the LSI section only. |
Thanks for looking at this. Current Nucleo production seems to be fitted with LSE, so the fix is fine there. I guess it won't be of use to those with older models & LSI though, and somewhat ironically those are the ones who will be setting the clock most often. For those wanting to play with the backup registers under mbed, I put example code on my notebook. |
@campag is this resolved, or still relevant? |
Resolved thanks. Will close but one quick question - where should I report small issue with the STM HAL library (re ADC from temp & Vbat). Doesn't seem appropriate here? |
For the support of ADC internal channels (Vbat, Vref, Temp) you can enter an issue. We have started to doing it on mbedOS. It could be easily ported to mbedClassic. |
I started to use the RTC backup registers on Nucleo F401 with the HAL library, but notice that if I set the time with mbed, my data is also erased - mbed's set_time() in rtc_time.c calls rtc_init() before rtc_write().
However STM32F4's (& I suppose others) rtc_init() in rtc_api.c erases the backup registers. If I comment out
then my backup register data is untouched.
Is there a reason those lines are there? After all, mbed api doesn't use the backup registers, and they appear to be reset anyway on power-up with no separate coin-cell Vbat present.
The text was updated successfully, but these errors were encountered: