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

fe310: Use common rtt_rtc module for RTC feature #14895

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bergzand
Copy link
Member

@bergzand bergzand commented Aug 31, 2020

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 all alarm 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

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.
@bergzand bergzand added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: drivers Area: Device drivers Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms labels Aug 31, 2020
@bergzand bergzand requested a review from aabadie August 31, 2020 08:55
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 31, 2020
@@ -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
Copy link
Contributor

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
Copy link
Contributor

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 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not no

Copy link
Contributor

@aabadie aabadie Aug 31, 2020

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."

Copy link
Member Author

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

Copy link
Contributor

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

@aabadie
Copy link
Contributor

aabadie commented Aug 31, 2020

And you forgot to adapt the Kconfig files ;)

@bergzand
Copy link
Member Author

And you forgot to adapt the Kconfig files ;)

I know!

@fjmolinas
Copy link
Contributor

This one needs a rebase @bergzand

@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 22, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@PeterKietzmann
Copy link
Member

The fe310 has no dedicated RTC peripheral

The reference manual has a dedicated chapter "Real-Time Clock (RTC)". How does it relate?

@benpicco
Copy link
Contributor

benpicco commented Mar 4, 2022

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.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants