The NXP {cpu-family} has eight UART interfaces that can be used for serial communication with devices either directly or through level adapters. You can also use the RTS and CTS hardware flow-control lines.
On the ConnectCore 6UL:
-
UART1 is connected to the Bluetooth chip (on modules with Bluetooth).
-
The remaining UARTs are available for peripheral use.
The MCA in the ConnectCore 6UL system-on-module also supports one or more UARTs depending on the firmware version. See MCA UART serial port for additional information on MCA UARTs. |
On the ConnectCore 6UL SBC Express:
-
UART4 is available on the expansion connector (2-wires, TTL level).
-
UART5 is routed to the console connector.
On the ConnectCore 6UL SBC Pro:
-
UART2 is available on the UART connector (4-wires, TTL level) with RTS/CTS lines multiplexed with CAN2 port. This port is shared with the XBee interface.
-
UART3 is available on the UART connector (4-wires, RS-232) with RTS/CTS lines multiplexed with CAN1 port.
-
UART5 is routed to the console connector.
Kernel configuration
You can manage the UART support through the kernel configuration options:
-
IMX serial port support (
CONFIG_SERIAL_IMX
) -
Console on IMX serial port (
CONFIG_SERIAL_IMX_CONSOLE
)
Kernel driver
File | Description |
---|---|
IMX UART driver |
Device tree bindings and customization
The {cpu-family} UART interface device tree binding is documented at Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
RS-485 support
RS-485 is a standard defining the electrical characteristics of drivers and receivers in balanced digital multipoint systems. RS-485 only specifies electrical characteristics of the generator and the receiver; it does not specify or recommend a communications protocol.
The {cpu-family} serial driver includes support for the RS-485 standard.
No specific kernel configuration is necessary to support RS-485 over the serial interface.
The device tree bindings are documented at Documentation/devicetree/bindings/serial/rs485.txt
.
RS-485 half-duplex needs the RX and TX lines for data communication and the CTS line to control the RS-485 transceiver to either drive output or receive input from outside the chip.
In {cpu-family} CPUs, the CTS line is an output of the CPU that requests the transmitter to send data (effectively RTS). The RTS line is an input of the CPU that receives requests from receivers for stopping/resuming transmission (effectively CTS). |
To enable RS-485 mode on a UART port, apply the following changes to the device tree node:
-
Add property
linux,rs485-enabled-at-boot-time
. -
Optionally add property
rs485-rts-active-high
to define CTS line polarity as ACTIVE HIGH. Default polarity is ACTIVE LOW. -
Optionally add property
rs485-rx-during-tx
to allow receiving data while sending data. -
Optionally add property
rs485-rts-delay = <a b>
to define:-
a: Delay in milliseconds between CTS line assertion and start of transmission.
-
b: Delay in milliseconds between end of transmission and CTS line de-assertion.
-
Example: Configure RS-485 port on ConnectCore 6UL SBC Pro
By default, none of the UART ports on the ConnectCore 6UL SBC Pro device tree are configured in RS-485 mode.
/* UART2 */
&uart2 {
/* RTS/CTS lines multiplexed with CAN2 */
pinctrl-0 = <&pinctrl_uart2_4wires>;
uart-has-rtscts;
linux,rs485-enabled-at-boot-time;
rs485-rts-active-high;
rs485-rx-during-tx;
rs485-rts-delay = <1 1>;
status = "okay";
};
UART user space usage
The {cpu-family} UART bus driver exposes device data through the sysfs at /sys/class/tty/ttymxcN/
, where N is the port index, starting at zero.
UART device interface
You can access {cpu-family} UART devices from user space through the device node /dev/ttymxcN
, where N is the port index, starting at zero.
The MCA in the ConnectCore 6UL system-on-module also supports one or more UARTs depending on the firmware version. See MCA UART serial port for additional information on MCA UARTs.
For information about using the serial port from user space, see the Serial Programming Guide for POSIX Operating Systems.