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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gen3] hal: fixes early wakeup by RTC from STOP sleep mode #1803

Merged
merged 1 commit into from May 31, 2019

Conversation

@avtolstoy
Copy link
Member

commented May 31, 2019

Problem

See #1789.

For some reason when we are configuring the RTC before going into STOP sleep mode, the prescaler writes don't take effect. This can only happen if the RTC is not stopped, but it should have been stopped by that point.

Solution

This PR adds an ugly hack of looping and checking that the prescaler setting did take effect. We are also adding a similar hack to OpenThread alarm code just in case.

If anybody has better ideas on how to resolve this, I'll be more than willing to change this. I've tried various barriers (DMB, DSB and ISB) at multiple places but wasn't completely able to mitigate the issue. Perhaps a dummy prescaler read is what actually helps? 馃し鈥嶁檪

Steps to Test / Example App

See a test from #1789

References


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • N/A Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

  • [bugfix] [gen3] hal: fixes early wakeup by RTC from STOP sleep mode #1803

@avtolstoy avtolstoy added the bug label May 31, 2019

@avtolstoy avtolstoy added this to the 1.3.0-alpha.1 milestone May 31, 2019

@avtolstoy avtolstoy requested a review from technobly May 31, 2019

@technobly technobly merged commit fe982d5 into develop May 31, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@technobly technobly deleted the fix/gen3-sleep-rtc branch May 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.