![]() Make sure they can talk to each other.Įven an external communication test can miss something. Cable your board to another system and run a test (e.g. So, you should also run some tests with external hardware. voltage levels) that cannot be detected locally. The device may still have some flaw (e.g. It only proves the device can talk to itself. However, a loopback test is not exhaustive. use direct register I/O), and make sure to accommodate for any start/stop bit overhead (see comments below). To get an accurate number, you will need to bypass any buffering in the OS serial port driver (e.g. Transmit X amount of bytes at a certain baud rate and verify they arrived in the expected amount of time. This will prove the clock driving the UART is running at the right frequency, and being divided properly. Therefore, it is a good idea to run a data loopback at the slowest baud rate, the fastest baud rate, and 1-2 in the middle.Īnother thing you should do is a baud rate accuracy test. It is also possible for there to be a bad signal connection on the board that is masked by inductance and capacitance at higher baud rates. It is possible for there to be a signal integrity issue in the design that only shows up at higher bauds rates. Note that you should run a TX->RX data loopback at multiple baud rates. ![]() Make sure you exercise every pin of the serial port. For the control pins, toggle them and make sure the other side of the connection saw the transition. If TX and RX are connected, you can send a byte and verify that it was echoed back. If you do not have matching input pins for every output pin, you will need to do a three-way connection.Īfter you create the loopback, you will need to write software that exercises the pins. Create a test fixture that connects output pins of the port to the input pins (TX->RX, RTS->CTS, etc). Delay is specified in bit times.The most common type of serial port test is probably a loopback test. Usage: linux-serial-test -h, -help -b, -baud Baud rate, 115200, etc (115200 is default) -p, -port Port (/dev/ttyS0, etc) (must be specified) -d, -divisor UART Baud rate divisor (can be used to set custom baud rates) -R, -rx_dump Dump Rx data (ascii, raw) -T, -detailed_tx Detailed Tx data -s, -stats Dump serial port stats every 5s -S, -stop-on-err Stop program if we encounter an error -y, -single-byte Send specified byte to the serial port -z, -second-byte Send another specified byte to the serial port -c, -rts-cts Enable RTS/CTS flow control -B, -2-stop-bit Use two stop bits per character -P, -parity Use parity bit (odd, even, mark, space) -k, -loopback Use internal hardware loop back -K, -write-follow Write follows the read count (can be used for multi-serial loopback) -e, -dump-err Display errors -r, -no-rx Don't receive data (can be used to test flow control) when serial driver buffer is full -t, -no-tx Don't transmit data -l, -rx-delay Delay between reading data (ms) (can be used to test flow control) -a, -tx-delay Delay between writing data (ms) -w, -tx-bytes Number of bytes for each write (default is to repeatedly write 1024 bytes until no more are accepted) -q, -rs485 Enable RS485 direction control on port, and set delay from when TX is finished and RS485 driver enable is de-asserted. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |