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 invalid calls to timer_init() + GPIO IRQ tests #21006

Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 18, 2024

Contribution description

Regarding Invalid Calls to timer_init()

Calling timer_init() with unsupported frequencies on some MCUs just selects the closest possible frequency. But e.g. on SAM0, using an unsupported frequency will cause timer_init() to fail; which probably is the better option.

However, a failing calling to timer_init() results in a test failure. This is now worked around by using timer_query_freq() to select a suitable timer frequency that is supported.

Regarding GPIO IRQ Tests

The GPIO IRQ tests had a side-effect that IRQs remained configured after the test case was complete. This caused stray IRQs to trigger on SAM0 MCUs and they consequently (and incorrectly) failed the test.

Testing procedure

On e.g. wemos-zero or arduino-zero the test should now run to completion and - with the exception of the ADC tests - pass.

In master GPIO IRQ tests will fail and the test will abort after a failing call to timer_init().

Issues/PRs references

None

@maribu maribu added 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 18, 2024
@maribu maribu force-pushed the tests/periph/selftest_shield/fix-timer_init branch from 6483bc2 to c60f128 Compare November 18, 2024 20:52
@maribu maribu changed the title tests/periph/selfteest_shield: fix invalid calls to timer_init() tests/periph/selftest_shield: fix invalid calls to timer_init() Nov 18, 2024
@riot-ci
Copy link

riot-ci commented Nov 19, 2024

Murdock results

✔️ PASSED

fd30434 tests/periph/selftest_shield: fix GPIO IRQ testing

Success Failures Total Runtime
2 0 2 01m:39s

Artifacts

@maribu maribu changed the title tests/periph/selftest_shield: fix invalid calls to timer_init() tests/periph/selftest_shield: fix invalid calls to timer_init() + GPIO IRQ tests Nov 19, 2024
@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) and removed Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Nov 19, 2024
@maribu
Copy link
Member Author

maribu commented Nov 19, 2024

Ah, when testing on the WeMos Zero, #21004 is also needed for the tests to pass.

Update: #21004 has been merged and I rebased this one on top of master, so this will just work now.

Calling `timer_init()` with unsupported frequencies on some MCUs just
selects the closest possible frequency. But e.g. on SAM0, using an
unsupported frequency will cause `timer_init()` to fail; which probably
is the better option.

However, a failing calling to `timer_init()` results in a test failure.
This is now worked around by using timer_query_freq() to select a
suitable timer frequency that is supported.
The GPIO IRQ tests had a side-effect that IRQs remained configured after
the test case was complete. This caused stray IRQs to trigger on
SAM0 MCUs and they consequently (and incorrectly) failed the test.
@maribu maribu force-pushed the tests/periph/selftest_shield/fix-timer_init branch from 9f21639 to fd30434 Compare November 19, 2024 21:25
@maribu maribu requested a review from benpicco November 20, 2024 21:04
@benpicco benpicco added this pull request to the merge queue Nov 20, 2024
@maribu maribu removed this pull request from the merge queue due to a manual request Nov 21, 2024
@maribu maribu added this pull request to the merge queue Nov 21, 2024
Merged via the queue into RIOT-OS:master with commit d7d6a36 Nov 21, 2024
26 checks passed
@maribu maribu deleted the tests/periph/selftest_shield/fix-timer_init branch November 21, 2024 08:07
@maribu
Copy link
Member Author

maribu commented Nov 21, 2024

Thx :)

@MrKevinWeiss MrKevinWeiss added this to the Release 2025.01 milestone Jan 20, 2025
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.

4 participants