-
Notifications
You must be signed in to change notification settings - Fork 3k
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 No Longer Enabled by Reading the Time #9176
Comments
OK |
I'm not sure, initially I just wanted to see if others agree it is a problem. I quite like the optimisation and was wondering if How about something like:
But now it's not so simple. :-( |
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-351 |
I don't particularly like the "optimisation" - it's costing code space, and runtime for the sensible case. If any application thinks they might be making a "null adjustment", and want to avoid doing it in case it disrupts the tick phase, they should be doing their own check, as this behaviour isn't specified by the HAL API or The HAL API requires that (Oops, @mattbrown015 already said that...) |
I think I've started leaning towards just reverting.
In our app we would only set the time in response to a command from an operator and handling these commands is not part of main control flow (if you see what I mean). |
But presumably someone must set the time at some time, so the And once it is set and running, that |
We get the time using With no further intervention the device will just run and all the reported times will be circa 1970. If the operator wants to send a command to make the time more reasonable they can. The RTC remains enabled during a warm boot so in our case the RTC will only go back to 0 if the battery is removed. So |
Description
I think this #8777 causes a problem! :-(
@jeromecoutant tried to sneak in a cheeky optimisation that, AFAICT, isn't important for the PR i.e. STM32 RTC : skip rtc_write if possible.
This change means the RTC doesn't get enabled when previously it did.
time
inmbed_rtc_time.cpp
does this:But, if the RTC isn't enabled its value is probably 0 and
set_time(0)
will just return early without doing anything!Issue request type
The text was updated successfully, but these errors were encountered: