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

cpu/gd32v: add periph_rtc_mem support #19254

Merged
merged 2 commits into from
Feb 7, 2023

Conversation

gschorcht
Copy link
Contributor

Contribution description

This PR provides the periph_rtc_mem support for GD32VF103.

A modified version of this driver could also be used for STM32F1.

Testing procedure

tests/periph_rtt should work on any GD32V board, for example:

BOARD=sipeed-longan-nano make -C tests/periph_rtt flash
Help: Press s to start test, r to print it is ready
START
main(): This is RIOT! (Version: 2023.04-devel-319-gebc86-cpu/gd32v/periph_rtc_mem)

RIOT RTT low-level driver test
RTT configuration:
RTT_MAX_VALUE: 0xffffffff
RTT_FREQUENCY: 32768

Testing the tick conversion
Trying to convert 1 to seconds and back
Trying to convert 256 to seconds and back
Trying to convert 65536 to seconds and back
Trying to convert 16777216 to seconds and back
Trying to convert 2147483648 to seconds and back
All ok

Initializing the RTT driver
RTC mem OK
This test will now display 'Hello' every 5 seconds

RTT now: 1
Setting initial alarm to now + 5 s (163841)
rtt_get_alarm() PASSED
RTC mem OK

Issues/PRs references

@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework labels Feb 6, 2023
@gschorcht gschorcht requested a review from benpicco February 6, 2023 21:26
@gschorcht gschorcht added Type: new feature The issue requests / The PR implemements a new feature for RIOT 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 labels Feb 6, 2023
@riot-ci
Copy link

riot-ci commented Feb 6, 2023

Murdock results

✔️ PASSED

dc5a1e9 cpu/gd32v: add periph_rtc_mem support

Success Failures Total Runtime
6849 0 6851 10m:22s

Artifacts

@benpicco
Copy link
Contributor

benpicco commented Feb 7, 2023

bors merge

@gschorcht
Copy link
Contributor Author

With this PR the GD32V support is almost complete. Still missing are only periph_dma, periph_can and periph_usbdev. For the latter, the usbdev_synopsys_dwc2 driver is already modified, but does not work properly yet.

bors bot added a commit that referenced this pull request Feb 7, 2023
17045: sys/coding: add XOR based coding module r=benpicco a=benpicco



19251: tests/driver_dac_dds: fix output of sine and saw functions r=benpicco a=benpicco



19254: cpu/gd32v: add periph_rtc_mem support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_rtc_mem` support for GD32VF103.

A modified version of this driver could also be used for STM32F1.

### Testing procedure

`tests/periph_rtt` should work on any GD32V board, for example:
```
BOARD=sipeed-longan-nano make -C tests/periph_rtt flash
```
```
Help: Press s to start test, r to print it is ready
START
main(): This is RIOT! (Version: 2023.04-devel-319-gebc86-cpu/gd32v/periph_rtc_mem)

RIOT RTT low-level driver test
RTT configuration:
RTT_MAX_VALUE: 0xffffffff
RTT_FREQUENCY: 32768

Testing the tick conversion
Trying to convert 1 to seconds and back
Trying to convert 256 to seconds and back
Trying to convert 65536 to seconds and back
Trying to convert 16777216 to seconds and back
Trying to convert 2147483648 to seconds and back
All ok

Initializing the RTT driver
RTC mem OK
This test will now display 'Hello' every 5 seconds

RTT now: 1
Setting initial alarm to now + 5 s (163841)
rtt_get_alarm() PASSED
RTC mem OK
```

### Issues/PRs references

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
@bors
Copy link
Contributor

bors bot commented Feb 7, 2023

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented Feb 7, 2023

Build succeeded:

@bors bors bot merged commit af39387 into RIOT-OS:master Feb 7, 2023
@gschorcht
Copy link
Contributor Author

Thanks for reviewing.

@gschorcht gschorcht deleted the cpu/gd32v/periph_rtc_mem branch February 7, 2023 13:52
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework 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: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants