balena-raspberrypi
balena-raspberrypi copied to clipboard
Overrun errors on serial interface
This originates from a customer support request https://www.flowdock.com/app/rulemotion/public-s-premium/threads/cs0W8ikizb2UkFFjLxj4ZenuCTc
Converging on test setups, the error can be reproduced using the linux-serial-test app [1] with the following setup:
RPI4 ----- USB TTL cable ------ PC
First of all let's free the serial port with:
systemctl stop getty@tty1
systemctl stop serial-getty@serial0
Then run a test with the PC transmitting and the RPI4 receiving:
On the RPI4:
./linux-serial-test -s -e -p /dev/ttyS0 -t -b 115200
...
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4003654, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=1833403, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4072899, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=1902635, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4142125, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=1971872, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4211363, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2041115, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4280601, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2110359, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4349846, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2179605, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4419103, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2248849, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4488336, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2318095, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4557581, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2387341, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4626828, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2456585, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4696072, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2525828, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4765315, tx=2777513, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
Error, count: 2532286, expected be, got 00
Error, count: 2532287, expected 01, got be
Error, count: 2532294, expected c5, got 03
Error, count: 2532295, expected 04, got 00
Error, count: 2532296, expected 01, got 04
Error, count: 2532303, expected 0b, got 38
/dev/ttyS0: count for this session: rx=2594963, tx=0, rx err=6
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4834448, tx=2777513, frame = 0, overrun = 2, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=2664204, tx=0, rx err=6
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=4903688, tx=2777513, frame = 0, overrun = 2, parity = 0, brk = 0, buf_overrun = 0
On the PC:
./linux-serial-test -s -e -p /dev/ttyUSB0 -r -b 115200
Linux serial test app
/dev/ttyUSB0: count for this session: rx=0, tx=69120, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=138240, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=207360, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=276480, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=345600, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=414720, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=483840, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=552960, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=622080, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=691200, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=760320, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=829440, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=898560, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=967680, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1036800, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1105920, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1175040, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1244160, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1313280, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1382400, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1451520, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1520640, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1589760, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1658880, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1728000, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1797120, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1866240, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=1935360, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2004480, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2073600, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2142720, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2211840, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2280960, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2350080, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2423808, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2492928, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=2562048, rx err=0
After some time the test above reports overrun errors.
The other direction, with the RPI4 sending and the PC receiving also reports errors: On the PC:
./linux-serial-test -s -e -p /dev/ttyUSB0 -t -b 115200
Linux serial test app
/dev/ttyUSB0: count for this session: rx=38656, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=106752, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=174848, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=242944, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=311040, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=379136, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=447232, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=515328, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=583424, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=651520, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=719616, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=787712, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=855808, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=923904, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=992000, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1060096, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1128192, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1196288, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1264128, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1332224, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1400320, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1468416, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1536512, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1604608, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1672704, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1740800, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1808896, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1876992, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=1945088, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=2013184, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=2081280, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=2149376, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=2217472, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=2285568, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=2353664, tx=0, rx err=0
Error, count: 2406792, expected 88, got 5b
/dev/ttyUSB0: count for this session: rx=2406656, tx=0, rx err=1
On the RPI4:
./linux-serial-test -s -e -p /dev/ttyS0 -r -b 115200
Linux serial test app
Error setting RS-232 mode: Inappropriate ioctl for device
/dev/ttyS0: count for this session: rx=0, tx=65543, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=70058, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=130823, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=135338, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=199943, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=204458, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=269063, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=273578, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=334343, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=338858, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=403463, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=407978, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=472583, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=477098, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=541703, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=546218, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=606983, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=611498, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=676103, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=680618, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=745223, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=749738, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=814343, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=818858, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=879623, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=884138, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=948743, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=953258, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1017863, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1022378, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1083143, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1087658, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1152263, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1156778, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1221383, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1225898, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1290503, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1295018, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1355783, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1360298, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1424903, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1429418, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1494023, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1498538, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1563143, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1567658, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1628423, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1632938, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1697543, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1702058, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1766663, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1771178, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1835783, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1840298, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1901063, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1905578, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=1970183, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=1974698, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2039303, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2043818, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2104583, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2109098, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2173703, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2178218, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2242823, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2247338, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2311943, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2316458, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2377223, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2381738, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2446343, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2450858, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2515463, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2519978, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2584583, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2589098, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2649863, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2654378, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=2718983, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=2239486, tx=2723498, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
Loopback tests (connecting pins 8 and 10 on the expansion header) run fine.
The next step would be:
-
reproduce the tests on a Raspberry Pi 3 (64bits), and then on Raspberry Pi 3 (32 bits) to isolate the issue to the 64bits OSes.
-
Reproduce using raspbian
[1] https://github.com/cbrake/linux-serial-test
This issue has attached support thread https://jel.ly.fish/cb89caab-63e3-4946-bfb6-6a374e0a5ba0
On Raspbian Buster Lite on the RPI4:
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
On Preferences > "Raspberry Pi configuration";
- Enable SSH
- Enable serial
- Disable console
Clone and natively compile the linux-serial-test application.
The same transmission at 115200 bps as above works fine: PC transmitting and the RPI4 receiving (no errors):
On the RPI4:
./linux-serial-test -s -e -p /dev/ttyS0 -t -b 115200
Linux serial test app
Error setting RS-232 mode: Inappropriate ioctl for device
/dev/ttyS0: count for this session: rx=50408, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14198484, tx=14067520, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=119639, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14267715, tx=14067520, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=188869, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14336944, tx=14067520, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=258096, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14406172, tx=14067520, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=327334, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14475410, tx=14067520, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=396565, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14544641, tx=14067520, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=465795, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14613874, tx=14067520, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
On the PC:
./linux-serial-test -s -e -p /dev/ttyUSB0 -r -b 115200
Linux serial test app
/dev/ttyUSB0: count for this session: rx=0, tx=64512, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=133632, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=202752, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=271872, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=340992, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=410112, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=479232, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=548352, rx err=0
/dev/ttyUSB0: count for this session: rx=0, tx=617472, rx err=0
Note: The ioclt error is caused by the application trying to disable RS485 mode which the RPI driver does not support - it is harmless and can be ignored.
RPI4 sending and the PC receiving (no errors):
On the PC:
./linux-serial-test -s -e -p /dev/ttyUSB0 -t -b 115200
/dev/ttyUSB0: count for this session: rx=36608, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=104448, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=172544, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=240640, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=308736, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=376832, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=444928, tx=0, rx err=0
/dev/ttyUSB0: count for this session: rx=513024, tx=0, rx err=0
On the RPI4:
./linux-serial-test -s -e -p /dev/ttyS0 -r -b 115200
Linux serial test app
Error setting RS-232 mode: Inappropriate ioctl for device
/dev/ttyS0: count for this session: rx=0, tx=69383, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14132808, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=138503, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14201928, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=203783, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14267208, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=272903, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14336328, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=342023, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14405448, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=411143, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14474568, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=476423, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14539848, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=545543, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14608968, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=614663, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14678088, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
While software flow control does not to work:
PC transmitting and the RPI4 receiving (no transmission):
On the RPI4:
./linux-serial-test -c -s -e -p /dev/ttyS0 -t -b 3000000
/dev/ttyS0: count for this session: rx=0, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14903800, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
No data received for 7.0s.
No data received for 8.0s.
No data received for 9.0s.
No data received for 10.0s.
No data received for 11.0s.
No data received for 12.0s.
/dev/ttyS0: count for this session: rx=0, tx=0, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=14903800, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
On the PC:
./linux-serial-test -c -s -e -p /dev/ttyUSB0 -r -b 3000000
Linux serial test app
No data transmitted for 2.0s.
No data transmitted for 3.0s.
No data transmitted for 4.0s.
No data transmitted for 5.0s.
No data transmitted for 6.0s.
/dev/ttyUSB0: count for this session: rx=0, tx=4608, rx err=0
No data transmitted for 7.0s.
No data transmitted for 8.0s.
No data transmitted for 9.0s.
No data transmitted for 10.0s.
No data transmitted for 11.0s.
No data transmitted for 12.0s.
/dev/ttyUSB0: count for this session: rx=0, tx=4608, rx err=0
RPI4 sending and the PC receiving (errors):
On the PC:
./linux-serial-test -c -s -e -p /dev/ttyUSB0 -t -b 3000000
Error, count: 454823, expected 29, got bc [1865/1865]
Error, count: 454824, expected bd, got ae
Error, count: 454825, expected af, got 34
Error, count: 454826, expected 35, got 2b
Error, count: 454827, expected 2c, got 25
Error, count: 454828, expected 26, got ab
Error, count: 454829, expected ac, got 29
Error, count: 454830, expected 2a, got d2
Error, count: 454831, expected d3, got 5b
Error, count: 454832, expected 5c, got 2c
Error, count: 454833, expected 2d, got 31
Error, count: 454834, expected 32, got cb
Error, count: 454835, expected cc, got 3d
Error, count: 454836, expected 3e, got 7b
Error, count: 454837, expected 7c, got b0
Error, count: 454838, expected b1, got a4
Error, count: 454839, expected a5, got 4c
Error, count: 454840, expected 4d, got a2
On the RPI4:
./linux-serial-test -c -s -e -p /dev/ttyS0 -r -b 3000000
Linux serial test app
Error setting RS-232 mode: Inappropriate ioctl for device
/dev/ttyS0: count for this session: rx=0, tx=1585878, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=16485615, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0
/dev/ttyS0: count for this session: rx=0, tx=3213974, rx err=0
/dev/ttyS0: TIOCGICOUNT: ret=0, rx=14653677, tx=18113703, frame = 0, overrun = 0, parity = 0, brk = 0, buf_overrun = 0