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

STM32F4 backup domain registers and backup domain sram #850

Merged
merged 3 commits into from Sep 25, 2023

Conversation

ag88
Copy link
Contributor

@ag88 ag88 commented Mar 10, 2021

STM32F4: update bkp.h, bkp.c add support for backup registers and backup sram.
added example in STM32F4/libraries/RTClock/examples/BkpTest

STM32F4: update bkp.h, bkp.c add support for backup registers and backup sram.
added example in STM32F4/libraries/RTClock/examples/BkpTest
@ag88
Copy link
Contributor Author

ag88 commented Mar 10, 2021

the comment about this PR :
stevstrong#44 (comment)

ag88 added 2 commits March 11, 2021 16:53
updated RTClock.begin()
skip initialization of RTC running on LSE if it is already running
so that the time maintained on VBAT would not be reset

note that the change only prevents resetting RTC on LSE as only that is assured
when running on VBAT
in begin()
change:
  if(!lse_ison && RTCSEL_LSE) {
to:
  if(!lse_ison)

that RTCSEL_LSE is redundant. it suffice to test that lse_ison
@stevstrong
Copy link
Collaborator

What is actually the status of this PR?
Is it safe to merge?

@ag88
Copy link
Contributor Author

ag88 commented Sep 23, 2023

this is done back then when I'm trying to use the backup registers on stm32f401.
The readme.md in this commit is here
https://github.com/rogerclarkmelbourne/Arduino_STM32/pull/850/files#diff-5b489eef3ad090c0a5bed41a1f684527533ee35d6300a3ec9e008013bf280689
and the test is here, it is both a test as well as an example codes
https://github.com/rogerclarkmelbourne/Arduino_STM32/pull/850/files#diff-afb267cf20737b1168f92a9d093766aab94b0aa65704e08d1a6b2633f796ddac

stm32f401 don't have backup sram but that they do have backup registers and this commit is part of works i'm using in some of my sketches to keep some data in the backup registers as these can be safe kept by VBAT (e.g. a coin cell for the RTC) even if the main VDD 3v3 is powered off.
This (the backup registers) has also been used in conjunction with RTClock. Hence, it should not affect the function of RTClock. One of the commit is actually a fix. When RTC is running on LSE and VBAT. The original code causes the RTC reset when powered up, this fix avoids clobbering a running RTC if it is running on LSE.
48817fa
I've done various tests on stm32f401 and is actually using the codes in sketches as described above.
I've tested the codes against a stm32f407 back then for backup sram and registers as well.

I think this shouldn't break anything

@stevstrong stevstrong merged commit cd1d2a0 into rogerclarkmelbourne:master Sep 25, 2023
@stevstrong
Copy link
Collaborator

OK, then I will commit this.
If somebody will encounter a problem related to this, then I will revert it.
Thank you for contributing!

@ag88
Copy link
Contributor Author

ag88 commented Sep 25, 2023

thanks ! I'd monitor issues here and in www.stm32duino.com and would respond just in case someone is after all using it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants