-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fe310: Use common rtt_rtc module for RTC feature #14895
base: master
Are you sure you want to change the base?
Conversation
This removes the fe310 RTC peripheral driver in favor of the common rtt_rtc module. The fe310 has no dedicated RTC peripheral, the RTC driver provided with the fe310 CPU emulated it on top of the RTT peripheral.
@@ -4,7 +4,6 @@ CPU_MODEL = fe310_g000 | |||
# Put defined MCU peripherals here (in alphabetical order) | |||
#FEATURES_PROVIDED += periph_pwm | |||
FEATURES_PROVIDED += periph_rtc | |||
FEATURES_PROVIDED += periph_rtt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that you removed the wrong line here.
@@ -7,3 +7,7 @@ FEATURES_PROVIDED += periph_gpio periph_gpio_irq | |||
FEATURES_PROVIDED += periph_pm | |||
FEATURES_PROVIDED += periph_wdt | |||
FEATURES_PROVIDED += ssp | |||
|
|||
ifneq (,$(filter periph_rtt,$(FEATURES_PROVIDED))) | |||
FEATURES_PROVIDED += periph_rtc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can both features be used at the same time ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not no
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I think one should also add a FEATURES_CONFLICT statement in this file:
FEATURES_CONFLICT += periph_rtc:periph_rtt
FEATURES_CONFLICT_MSG += "On FE310, the RTC and RTT use to the same hardware timer."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FEATURES_CONFLICT += periph_rtt:periph_rtc
Should do the trick. Any good idea for adding the periph_rtc feature to fe310 boards offering the rtt feature?
I can also just add both to the fe310 cpu, I don't think it is practically possible to use the fe310 without 32.768 kHz crystal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But rtt_rtc
depends on periph_rtt
And you forgot to adapt the Kconfig files ;) |
I know! |
This one needs a rebase @bergzand |
The reference manual has a dedicated chapter "Real-Time Clock (RTC)". How does it relate? |
It implements a Real-Time Counter, it does not provide date / calendar functionality in hardware. |
Contribution description
This removes the fe310 RTC peripheral driver in favor of the common
rtt_rtc module. The fe310 has no dedicated RTC peripheral, the RTC
driver provided with the fe310 CPU emulated it on top of the RTT
peripheral.
Testing procedure
On master
tests/periph_rtc
fails by printing allalarm
lines at the same time. With this PR they are slightly more correct, I get 2 of them after 2 seconds, one after 6 seconds and multiple in rapid succession after 8 seconds. So technically the test now succeeds, but the peripheral is still a bit broken.Issues/PRs references
None