Skip to content

Safely initialize RTC on kinetis devices #4453

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

Merged
merged 1 commit into from
Jun 7, 2017
Merged

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Jun 5, 2017

When initializing the RTC on Kinetis devices, handle the case where the time overflow interrupt is pending and the case where the time alarm flag is pending. These flags persist across reset and if not handled will cause a crash when powering up the low power ticker.

This problem manifested as a lp_ticker test failure on the K22F and K64F on CI only when running a nightly. This problem has been present but was made obvious by PR #4094 which configures all tickers to interrupt at least every MBED_TICKER_INTERRUPT_TIMESTAMP_MAX_DELTA (~31 minutes). This caused the RTC alarm to fire 31 minutes after the lp_ticker or lp_timeout test and caused the next run of the lp_ticker test to crash on boot.

@c1728p9
Copy link
Contributor Author

c1728p9 commented Jun 5, 2017

This failure can be reproduced by running one of these programs, and then running the lp_ticker test immediately after:
https://developer.mbed.org/users/c1728p9/code/k64f-lp_ticker-failure-1/
https://developer.mbed.org/users/c1728p9/code/k64f-lp_ticker-failure-2/

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one ! Thanks Russ

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 6, 2017

cc @mmahadevan108

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 6, 2017

/morph test-nightly

1 similar comment
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 6, 2017

/morph test-nightly

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 6, 2017

/morph echo

1 similar comment
@bridadan
Copy link
Contributor

bridadan commented Jun 6, 2017

/morph echo

@mbed-bot
Copy link

mbed-bot commented Jun 6, 2017

I recieved your comment! Here's what you wrote!

/morph echo

@adbridge
Copy link
Contributor

adbridge commented Jun 6, 2017

/morph test-nightly

When initializing the RTC on Kinetis devices, handle the case where
the time overflow interrupt is pending and the case where the time
alarm flag is pending. These flags persist across reset and if not
handled will cause a crash when powering up the low power ticker.

This problem manifested as a lp_ticker test failure on the K22F and
K64F on CI only when running a nightly. This problem has been present
but was made obvious by PR ARMmbed#4094 which configures all tickers to
interrupt at least every MBED_TICKER_INTERRUPT_TIMESTAMP_MAX_DELTA
(~31 minutes). This caused the RTC alarm to fire 31 minutes after the lp_ticker
or lp_timeout test and caused the next run of the lp_ticker test to
crash on boot.
@c1728p9
Copy link
Contributor Author

c1728p9 commented Jun 6, 2017

PR rebased

@c1728p9
Copy link
Contributor Author

c1728p9 commented Jun 6, 2017

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 6, 2017

morph test

should not be nightly as this was discovered there?

@c1728p9
Copy link
Contributor Author

c1728p9 commented Jun 6, 2017

Nightlies are broken and will fail until the mktime problem is fixed. Last nightly run did pass the lp_ticker test though.

@mbed-bot
Copy link

mbed-bot commented Jun 7, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 464

All builds and test passed!

@sg- sg- merged commit 01e4520 into ARMmbed:master Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants