Repository navigation
Conversation
Flashes small programs that exercise the default serial port and checks their output over the board's serial port.
|
I ran these tests on more boards.
The The Nano needed the second commit in this PR, which sets the baud rate to 115200 so that boards with a different default baud rate work. The RX buffer size differs by board, 32 bytes on the Nano, 128 on the R4 UART and 512 on the USB CDC boards. The burst test does not depend on the size. |
The runner uses 115200 but the programs used the default of each board. AVR defaults to 9600.
davecheney
left a comment
There was a problem hiding this comment.
LGTM. I love the idea
|
I'm building a larger test suite with the serial tests as one part. Currently stalled on that because of a reproducible hang on pico2 when trying to run the new tests. Let's hold off on merging this one until I'm happy with the newer tests or decide they're not worth it. |
I wrote these tests while checking the Arduino Uno R4 UART driver in #6015. They only use the default serial port, so they seemed useful for other boards too.
tools/uart-testhas a host runner and a few small TinyGo programs. The runner flashes each program withtinygo flash, then checks the output over the board's serial port. It builds with the standard Go compiler and usesgo.bug.st/serial.Tests:
I ran all of them on an Arduino Uno R4 WiFi and they pass. The programs also compile for the pico, feather-m4, arduino-nano33 and stm32f4disco, but I have only run them on the R4.
Does
toolsmake sense for this? I'm happy to move it somewhere else in this repo, or to another repo such astinygo-org/drivers, if that fits better. I'm also fine with dropping it if it isn't wanted.