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: move board dependent RTT configs to board config #19211

Merged
merged 2 commits into from
Jan 29, 2023

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Jan 29, 2023

Contribution description

This PR fixes the problem that the RTT frequency is defined to be 40.0 kHz instead of 32.768 kHz if TEST_KCONFIG=1 is not defined.

The problem was caused by the order in which the headers were included. In cpu/gd32v/include/periph_cpu.h the RTT frequency was defined to be 32.768 kHz or 40.0 kHz, depending on the CONFIG_BOARD_HAS_LXTAL configuration of the board. If TEST_KCONFIG=1 is used, it is defined in autoconfig.h and is always known, but without TEST_KCONFIG=1 it is defined in the periph_conf.h of the board. If periph_cpu.h is included but not periph_conf.h, CONFIG_BOARD_HAS_LXTAL is not defined without TEST_KCONFIG=1 and the RTT frequency is defined to be 40.0 kHz.

The solution is to move board dependent RTT configurations to periph_common.conf.

Testing procedure

BOARD=sipeed-longan-nano make -C tests/periph_rtt flash

should still work.

Issues/PRs references

@github-actions github-actions bot added Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports labels Jan 29, 2023
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) 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 Jan 29, 2023
@riot-ci
Copy link

riot-ci commented Jan 29, 2023

Murdock results

✔️ PASSED

993a65e dist/tools/doccheck: add RTT config to generic_exclude_pattern

Success Failures Total Runtime
6796 0 6796 08m:48s

Artifacts

@github-actions github-actions bot added Area: tools Area: Supplementary tools and removed Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms labels Jan 29, 2023
@gschorcht gschorcht force-pushed the cpu/gd32v/fix_rtt_frequency branch from 5589e86 to 993a65e Compare January 29, 2023 17:52
@gschorcht
Copy link
Contributor Author

@maribu I had to add RTT defines to generic_exclude_patterns to make doccheck happy. Does the approval still apply?

@maribu
Copy link
Member

maribu commented Jan 29, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jan 29, 2023

Build succeeded:

@bors bors bot merged commit 49d549c into RIOT-OS:master Jan 29, 2023
@gschorcht
Copy link
Contributor Author

@maribu Thanks for reviewing and merging.

@gschorcht gschorcht deleted the cpu/gd32v/fix_rtt_frequency branch February 1, 2023 19:15
@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: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants