The MCA implements three UARTs in its firmware (starting from firmware version 0.13). When enabled, the serial ports are listed as /dev/ttyMCAx. The configuration options are limited to:

  • Baud rates: from 1200 up to 230400 bps. Note that for baudrates higher than 57600, flow control is recommended.

  • Parity: none, even, or odd.

  • Stop Bits: 1 or 2.

  • Hardware flow-control through CTS and RTS lines.

Manual handling of the RTS and CTS lines through standard TIOCMGET and TIOCMSET ioctls is not supported.

MCA IO pins selection

You can only use certain IO pins for the RX/TX lines of each UART:

MCA UART IOs for RX IOs for TX IOs for CTS IOs for RTS

UART0

MCA_IO6, MCA_IO9

MCA_IO5, MCA_IO10, MCA_IO13

any

any

UART1

MCA_IO11, MCA_IO15

MCA_IO16

any

any

UART2

MCA_IO2, MCA_IO8, MCA_IO17

MCA_IO1, MCA_IO7, MCA_IO18

any

any

On the ConnectCore 8X SBC Pro:

  • MCA UART2 is routed to the XBee socket with the following IO pins:

    • RX on MCA_IO2

    • TX on MCA_IO1

    • CTS on MCA_IO3

    • RTS on MCA_IO4

By default, Digi Embedded Yocto assumes the UART routed to the XBee connector is used for connecting an XBee cellular modem. The ModemManager service generates some traffic in this UART in order to detect the XBee during boot and resume operations.

If you are not using an XBee cellular modem disable this feature by commenting all the entries in the following udev rules file: /lib/udev/rules.d/78-mm-digi-xbee-cellular.rules

If you are using a different UART to connect to the XBee socket, edit the udev rules file with the appropriate path. Note that the UART node may also change depending on the number of UARTs you enable on the device tree.

This file is installed by the modemmanager recipe append.

Kernel configuration

You can manage the MCA UART driver support through the following kernel configuration option:

  • Digi ConnectCore Micro Controller Assist assist UART (CONFIG_SERIAL_MCA)

This option is enabled as built-in on the default ConnectCore 8X kernel configuration file.

Kernel driver

The MCA UART driver is located at:

File Description

drivers/tty/serial/mca-uart.c

UART driver for MCA

Device tree bindings and customization

The MCA UART device tree binding is documented at Documentation/devicetree/bindings/serial/digi,mca-uart.txt.

Example: MCA UART on the ConnectCore 8X SBC Pro

UART controller inside the MCA

The MCA UARTs are defined in the ConnectCore 8X device tree.

ConnectCore 8X device tree
mca_cc8x: mca@63 {

	...

	mca_uart: uart {
		compatible = "digi,mca-cc8x-uart";
		#address-cells = <1>;
		#size-cells = <0>;

		mca_uart0: serial@0x900 {
			reg = <0x900>;
			index = <0>;
		};

		mca_uart1: serial@0x920 {
			reg = <0x920>;
			index = <1>;
		};

		mca_uart2: serial@0x940 {
			reg = <0x940>;
			index = <2>;
		};
	};
};

MCA UART enabling

The board device tree defines the pins to be used for each of the MCA UART lines.

ConnectCore 8X SBC Pro device tree
&mca_uart {
	status = "okay";

	/* Uncomment to enable MCA UART0. Assign the IO pins (see bindings) */
//	mca_uart0: serial@0x900 {
//		iopins-names = "rx", "tx";
//		iopins = <9 10>;
//	};

	/* Uncomment to enable MCA UART1. Assign the IO pins (see bindings) */
//	mca_uart1: serial@0x920 {
//		iopins-names = "rx", "tx";
//		iopins = <11 16>;
//	};

	/* UART connected to XBee socket */
	mca_uart2: serial@0x940 {
		iopins-names = "rx", "tx", "cts", "rts";
		iopins = <2 1 3 4>;
	};
};

Power management

The MCA UART is capable of waking the system from suspend and from power-off states.

Wake from suspend

To allow the MCA UART to resume the system from suspend when a character is received (and not losing data), run the following command:

~# echo enabled > /sys/class/tty/ttyMCA_x_/power/wakeup

where x is the UART index, starting at 0.

An application must be reading from the device or the system will not wake up when a character is received.

Power on the system

To allow the MCA UART to power on the system, you can execute the following command:

~# echo enabled > /sys/class/tty/ttyMCA_x_/power_extra_opts/power_on_rx

In this case there is no need for the port to be open. The UART remains with the latest configuration of baud rate, parity, and stop bits.

This setting does not persist across reset or power cycles, so you must enable it each time.