The speed of the serial link in bits per second. The Linux kernel on a modern PC supports a serial console speeds of 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200 bits per second. The kernel supports a much wider range of serial bit rates when the serial interface is not being used as a serial console.
This repo contains code that is intended to help resolve the issue raised here: https://github.com/ARMmbed/mbed-os/issues/4722. The code is written as an mbed Greentea test. The test uses a serial port wired in loop-back and runs it at increasing baud rates, checking that there is no character loss and that the expected throughput is achieved.
As of 7th July 2017, this repo should be used with the following fork of mbed-os:
...plus the additional commit here:
...rather than
mbed-os
master, since changing the serial baud rate and flow control (which is really needed for high data rate throughput tests) are only exposed through the UARTSerial()
class in this fork.
Note: you may experience a compilation error at line 194 of
UARTSerial.cpp
, if so just edit rx_buf
to be _rxbuf
.
This test requires an mbed board with a spare serial port on which the
Tx
output has been looped back to the Rx
input and the RTS
output has been looped back to the CTS
input. The pins used are assumed to be these pins on the board's Arduino header:
Rx
:D0
Tx
:D1
CTS
:D2
RTS
:D3
If other pins are to be used, the pin allocation may be modified in
mbed_app.json
; please see the mbed_app.json
in this repo for further information.
In addition to chosing different serial port pins, there are four other things that can be configured in
mbed_app.json
:
TEST_SPEED_TOLERANCE
: the permissible percentage difference between the baud rate and the achieved throughput, default 20%.TEST_MAX_BAUD_RATE
: the maximum baud rate for which the above tolerance should apply, default 460800.TEST_USE_FLOW_CONTROL
:true
if flow control is to be used, defaults totrue
(HIGHLY recommended if the tests are to have any chance of success at high baud rates).TEST_DURATION_SECONDS
: duration of each iteration of the test, default 10 seconds.
-
Clone this repo, fetch your chosen version of
mbed-os
into it (default if you runmbed deploy
is kjbracey's branch as indicated above) and set your chosen mbed target/toolchain as defaults. -
Perform the target hardware setup steps above and consider any items you may wish to change in
mbed_app.json
. -
Connect your target hardware and then compile/run the test with:
mbed test -v -n tests-unit_tests-default
-
When the test is running, you will see diagnostic prints of the following form:
-
If there is character loss, or the expected throughput is not achieved, you will see something like:
:301::FAIL: Expression Evaluated To FALSE
...and, usually, the reason for failure will be obvious from the diagnostic print that precedes that line. If not, please check the line number in the fileTESTSunit_testsdefaultmain.cpp
to determine the error cause.
If you wish to run the test under a debugger, then first do a clean compilation as follows to get debug information into your
.elf
file:
mbed test -n tests-unit_tests-default --profile mbed-os/tools/profiles/debug.json --compile -c
Drag and drop the built binary (
BUILDtests<target><toolchain>TESTSunit_testsdefaultdefault.bin
) onto your target.
Run
mbedls
to determine the COM
port that your mbed board is connected to. Supposing it is COM1
, you would then start the target under your debugger (providing it with the .elf
file BUILDtests<target><toolchain>TESTSunit_testsdefaultdefault.elf
) and, on the PC side, enter the following to begin the test:
mbedhtrun --skip-flashing --skip-reset -p COM1:115200
Time | Speed | Provider | Size | User | ConnectID | TestID |
---|---|---|---|---|---|---|
10/18/18 8:10:19 pm | 6.08 Mbps760 kB/s | 6.4 MB | 790620550692 | 97A7BAc1- | ||
8/8/16 8:51:59 am | 331 kbps41 kB/s | 256 kB | 844955782087 | pmAL2GsTl | ||
8/8/16 8:51:46 am | 599 kbps75 kB/s | 1.3 MB | 844955782087 | HOLYhIxoe | ||
11/22/15 1:13:19 pm | 10.84 Mbps1.35 MB/s | 6.2 MB | 194114393 | Hulw3xZh6 | ||
11/22/15 1:13:02 pm | 5.21 Mbps652 kB/s | 6.2 MB | 194114393 | S4FXVjoYW | ||
11/20/12 6:40:46 pm | 581 kbps73 kB/s | 256 kB | 19553018241 | xjcRZpk | ||
11/20/12 6:40:11 pm | 4.95 Mbps619 kB/s | 2.8 MB | 19553018241 | dFaTgpu | ||
11/20/12 5:20:57 pm | 309 kbps39 kB/s | 256 kB | 19553018241 | 02v1EIN | ||
11/20/12 5:20:42 pm | 1.79 Mbps223 kB/s | 4.4 MB | 19553018241 | lEJL10P | ||
11/20/12 4:50:26 pm | 432 kbps54 kB/s | 256 kB | 19553018241 | OBo49cH | ||
11/20/12 4:50:14 pm | 5.42 Mbps677 kB/s | 4.4 MB | 19553018241 | u9tCpc3 | ||
11/20/12 4:20:15 pm | 340 kbps43 kB/s | 256 kB | 19553018241 | bl9kd7G | ||
11/20/12 4:19:59 pm | 3.65 Mbps457 kB/s | 4.7 MB | 19553018241 | lEPwLhy | ||
11/20/12 3:49:55 pm | 456 kbps57 kB/s | 256 kB | 19553018241 | bVutNkT | ||
11/20/12 3:49:43 pm | 3.48 Mbps435 kB/s | 4.9 MB | 19553018241 | yg65MPa | ||
11/20/12 3:19:30 pm | 385 kbps48 kB/s | 320 kB | 19553018241 | OI3psBY | ||
11/20/12 3:19:16 pm | 4.7 Mbps587 kB/s | 5.1 MB | 19553018241 | EgWZezY | ||
11/20/12 2:49:11 pm | 521 kbps65 kB/s | 320 kB | 19553018241 | US20MNY | ||
11/20/12 2:48:59 pm | 5.49 Mbps687 kB/s | 4.8 MB | 19553018241 | CdywWx1 | ||
11/20/12 2:18:56 pm | 491 kbps61 kB/s | 256 kB | 19553018241 | l31syTX | ||
11/20/12 2:18:45 pm | 5.31 Mbps664 kB/s | 4.6 MB | 19553018241 | 2uGcSwb | ||
11/20/12 1:48:43 pm | 471 kbps59 kB/s | 256 kB | 19553018241 | kYfqrLi | ||
11/20/12 1:48:30 pm | 5.3 Mbps662 kB/s | 4.5 MB | 19553018241 | bwAjLeZ | ||
11/20/12 1:18:26 pm | 582 kbps73 kB/s | 256 kB | 19553018241 | qIzoR7U | ||
11/20/12 1:18:15 pm | 4.98 Mbps623 kB/s | 4.4 MB | 19553018241 | j297pvU |