Skip to content

test the nrf52840 HAL using defmt-test#291

Merged
bors[bot] merged 8 commits intonrf-rs:masterfrom
japaric:self-tests
Mar 12, 2021
Merged

test the nrf52840 HAL using defmt-test#291
bors[bot] merged 8 commits intonrf-rs:masterfrom
japaric:self-tests

Conversation

@japaric
Copy link
Copy Markdown
Contributor

@japaric japaric commented Feb 10, 2021

this PR adds tests that exercise the GPIO API
3 connections are required:

  • P0.03 <-> GND
  • P0.04 <-> VDD
  • P0.28 <-> P0.29

the first two are used to test the Input API against reference voltages
the short-circuit connection is used to test the Input and Output API using the input API that was
previously tested

I tried testing the Uarte API but ran into #289. It seems to me that we can't test TX/RX loopback or overrun errors with the existing read API

this commit adds tests that exercise the GPIO API
3 connections are required:
- P0.03 <-> GND
- P0.04 <-> VDD
- P0.28 <-> P0.29
the first two are used to test the Input API against reference voltages
the short-circuit connection is used to test the Input and Output API using the input API that was
previously tested
Comment thread .cargo/config
@@ -1,8 +1,2 @@
[alias]
xtask = "run -p xtask --"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved these into examples/.cargo/config because rustflags in .cargo/config compose and w/o the move I ran into knurling-rs/probe-run#143

@jonas-schievink
Copy link
Copy Markdown
Contributor

the first two are used to test the Input API against reference voltages

Would it be possible to use the internal pull-up/down resistors to create reference voltages instead? That way it keeps the external wiring to a minimum.

@japaric
Copy link
Copy Markdown
Contributor Author

japaric commented Feb 15, 2021

Would it be possible to use the internal pull-up/down resistors to create reference voltages instead? That way it keeps the external wiring to a minimum.

that's a different test in my opinion (and it's already there in the pulldown_is_low and pullup_is_high).

if we do that and remove vdd_is_high and gnd_is_low then we would have less test coverage because we would not be testing the floating input mode independently. (we have the set_low_is_low and set_high_is_high tests but those are testing GPIO output against a GPIO input API that's known to work)

@jonas-schievink
Copy link
Copy Markdown
Contributor

bors r+

@bors
Copy link
Copy Markdown
Contributor

bors Bot commented Mar 12, 2021

Build succeeded:

@bors bors Bot merged commit 04e3fcb into nrf-rs:master Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants