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

Refactor tests periph uart #20281

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

keestux
Copy link
Contributor

@keestux keestux commented Jan 21, 2024

Contribution description

The first change is to improve the visibility of incoming CRs (carriage return). They will now be shown as \r. Also, the LF (that usually comes after a CR) is now shown inside [..], not after the closing ].

The second change is a re-implementation of PR20128. I hope that @benpicco is not offended by it. I had this change lying around for more than a year, sorry about that. I want to include the change in the current PR because I consider the code in PR20128 too "hackish".

Testing procedure

I've tested the change on a sodaq-sara-sff board which has a Ublox SARA N310. For that a few extra steps are needed because the Ublox needs two pins to be ON, plus one pin needs to be toggled low for roughly one second. Otherwise the Ublox remains off.
After that:

  • init 1 38400
  • eol_cr
  • send 1 AT

Here is an example what you can expect.

> init 1 38400
2024-01-21 17:16:51,910 # init 1 38400
2024-01-21 17:16:51,910 # Success: Initialized UART_DEV(1) at BAUD 38400
2024-01-21 17:16:52,161 # UARD_DEV(1): test uart_poweron() and uart_poweroff()  ->  [OK]
> eol_cr
2024-01-21 17:16:56,461 # eol_cr
> send 1 AT
2024-01-21 17:17:02,141 # send 1 AT
2024-01-21 17:17:02,142 # UART_DEV(1) TX: AT
> 2024-01-21 17:17:02,167 # Success: UART_DEV(1) RX: [AT\r\r\n]
2024-01-21 17:17:02,168 # Success: UART_DEV(1) RX: [OK\r\n]

Issues/PRs references

None

Also the LF is display inside the [...].
Now it is more obvious what characters came in on the RX port of the UART.
Here is an example:

2024-01-20 20:57:41,368 # send 1 ati
2024-01-20 20:57:41,368 # UART_DEV(1) TX: ati
> 2024-01-20 20:57:41,393 # Success: UART_DEV(1) RX: [ati\r\r\n]
2024-01-20 20:57:41,398 # Success: UART_DEV(1) RX: [SARA-N310-00X-00\r\n]
2024-01-20 20:57:41,399 # Success: UART_DEV(1) RX: [\r\n]
2024-01-20 20:57:41,399 # Success: UART_DEV(1) RX: [OK\r\n]
@keestux keestux requested review from benpicco and removed request for aabadie, leandrolanzieri and MichelRottleuthner January 21, 2024 16:18
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Jan 21, 2024
@Teufelchen1 Teufelchen1 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 18, 2024
@riot-ci
Copy link

riot-ci commented Mar 18, 2024

Murdock results

✔️ PASSED

790bd98 tests/periph/uart: redo implementation of changing eol

Success Failures Total Runtime
44 0 44 24s

Artifacts

@Teufelchen1 Teufelchen1 added this pull request to the merge queue Mar 18, 2024
Merged via the queue into RIOT-OS:master with commit 5f0dc59 Mar 18, 2024
31 checks passed
@keestux keestux deleted the fix/refactor-tests-periph-uart branch March 25, 2024 19:50
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants