Wednesday, June 13, 2018

Loop Back Testing for UART


For fundamental UART related tutorial, please refer - http://www.circuitbasics.com/basics-uart-communication/

Scope of Article - UART loop back test from device driver side on OMAP platform.

https://github.com/nsekhar/serialcheck

About serialcheck/serialstatus : These are open-source userspace linux utility which are developed by TI for validating the serial ports on OMAP platform. This comes under - GNU GENERAL PUBLIC LICENSE 

What is a LOOP Back test?


A loopback test can be used to test/debug UART serial communications. It can show problems in the serial port, the cable, or the software. In this test normally the RX/TX and RTS/CTS pins are shorted on the same UART.  

A loopback test on OMAP platform with Internal Loop back via programming the registers and using the Hardware flow control didn't work properly in our Board. We found that data overflow using the serial check when such kind of test was performed. 

However We tried another approach where we will SHORT the RX/TX tiles and also the flow control line (RTS/CTS) and run serialcheck.

What is RTS / CTS Hardware Flow Control? RTS / CTS Flow Control is another flow control mechanism that is part of the RS232 standard.

It makes use of two further pins on the RS232 connector, RTS (Request to Send) and CTS (Clear to Send). These two lines allow the receiver and the transmitter to alert each other to their state. A transmitter raises its RTS line, which causes an interrupt on the receiver, i.e - hey can I send some data?. If the receiver is in a position to receive the data it will assert its CTS line, i.e - yes you can start sending. The raising and lowering of these lines allows device drivers which implement hardware flow control code to maintain a reliable data connection between transmitter and receiver. The advantage to this approach is that damaging data in transit does not effect the flow control mechanism (as in XOn / XOff).




No comments:

Post a Comment