There are a total of 4 UART.
UART1 -> ttymxc0 -> Used for USB debugging
UART2 -> ttymxc1 -> Free
UART3 -> ttymxc2 -> Free
UART4 -> ttymxc3 -> Used for Bluetooth communication
Below is an example to test UART2
Testing UART #
Make a LOOPBACK by shorting Tx and Rx for UART2. Refer Carrier Board Datasheet for pinouts.
Login into device
Setting UART2 #
root@imx8mq-trux-q01:~# stty -F /dev/ttymxc1 -echo -onlcr 115200 root@imx8mq-trux-q01:~# cat /dev/ttymxc1 &
Transmit data #
To transmit data simply print a string over UART2.
root@imx8mq-trux-q01:~# echo hello > /dev/ttymxc1
Receive data #
To receive data, use minicom. Open minicom for ttymxc2 and check if the transmitted data prints on the minicom terminal.
To open minicom
root@imx8mq-trux-q01:~# minicom -s
now for setting configurations select “Serial port setup”. Now set the tty-port by pressing “A” and set it to /dev/ttymxc1. Then turn off the Hardware flow control and turn on the Software flow control by pressing “F” and “G”. Now exit the setup and check if the transmitted string is received.
hello