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

tests/periph/selftest_shield: Fix UART test #21042

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 26, 2024

Contribution description

This PR fixes two issues in the UART test:

  1. Some boards (e.g. the Adafruit Metro M4 Express) have hardware conflicts between UART and other serial buses (e.g. I2C and UART for the M4 Express): The same hardware is used to provide both interface. However, we can implement time-sharing of common peripherals to provide multiple serial interfaces with the same hardware (as we already do for I2C and SPI on nRF5x, or SPI and UART on MSP430, or as cpu/sam0_common: Implement time-sharing of SERCOMs #21029 will provide for I2C, SPI and UART on SAM0). But to actually allow time-sharing, the UART needs to be powered off again after the UART test to release the shared hardware peripheral. The first commit adds this.
  2. The UART test is not enabled, when the D0/D1 UART is also the stdio UART no matter what. But if stdio_uart is not used but e.g. stdio_cdc_acm instead, we can still use it. The second commit addresses this.

Testing procedure

Done in #21029

Issues/PRs references

Split out of #21029

Calling `uart_poweroff()` when done with the UART test allows sharing
the underlying hardware e.g. to provide other peripheral interfaces.
One example of this would be the SERCOM3 on the Adafruit Metro M4
Express that is used to provide UART on D1/D0 and SPI on D11/D12/D13.
We cannot use the D0/D1 UART if it is also used for STDIO. However,
the logic did not take into account whether `stdio_uart` was used at
all. This fixes the issue.
@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation 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 labels Nov 26, 2024
@maribu maribu removed the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Nov 26, 2024
@riot-ci
Copy link

riot-ci commented Nov 26, 2024

Murdock results

✔️ PASSED

a51d4bd tests/periph/selftest_shield: fix logic to enable UART test

Success Failures Total Runtime
1 0 2 01m:16s

Artifacts

@maribu maribu added this pull request to the merge queue Nov 26, 2024
Merged via the queue into RIOT-OS:master with commit 3b238f7 Nov 26, 2024
31 checks passed
@maribu maribu deleted the tests/periph/selftest_shield/fix-uart branch November 26, 2024 20:09
@maribu
Copy link
Member Author

maribu commented Nov 26, 2024

Thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 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.

3 participants