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_IO9

MCA_IO10, MCA_IO13

any

any

UART1

MCA_IO11, MCA_IO15

MCA_IO16

any

any

UART2

MCA_IO2, MCA_IO17

MCA_IO1, MCA_IO18

any

any

On the ConnectCore 8M Nano Development Kit:

  • 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

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 8M Nano 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 8M Nano Development Kit

UART controller inside the MCA

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

ConnectCore 8M Nano device tree
mca_cc8m: mca@63 {

	...

	mca_uart: uart {
		compatible = "digi,mca-cc8m-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 8M Nano Development Kit 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

MCA UART0 and MCA UART1 are low-power UARTs and, as such, are capable of waking the system from suspend and from power-off states.

Wake from suspend

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

# echo enabled > /sys/class/tty/ttyMCAx/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 an MCA UART to power on the system, run the following command:

# echo enabled > /sys/class/tty/ttyMCAx/power_extra_opts/power_on_rx

where x is the UART index, starting at 0.

The UART remains with the latest configuration of baud rate, parity, and stop bits.

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

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