Skip to content
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

[Enhancement] Add date retention support to stm32f1xx boards #1187

Closed
wants to merge 1 commit into from

Conversation

josh-gaby
Copy link

Add date retention through power cycles on stm32f1xx based boards

On these chips, the date details are only stored in SRAM while running, because of this, dates are not being retained after a power off even with VBAT connected.

This is fixed by using backup registers DR2 and DR3 to store the date data each time it is updated by HAL_RTC_SetDate and whenever RTC_DateUpdate is called. Doing this means that the date can then extracted when the RTC is next initialized.

Add date retention for the stm32f1xx
@fpistm
Copy link
Member

fpistm commented Sep 23, 2020

Hi @josh-gaby
Thnks forthis PR.
Anyway modifying the HAL is not correct. The best way to integrate this is to add it to the https://github.com/stm32duino/STM32RTC
Please could you integrate this PR in the rtc.c?
Thanks in advance

@fpistm fpistm added abandoned No more work on this enhancement New feature or request labels Sep 23, 2020
@fpistm
Copy link
Member

fpistm commented Sep 23, 2020

Replaced by stm32duino/STM32RTC#41

@fpistm fpistm closed this Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned No more work on this enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants