Open main menu

DAVE Developer's Wiki β

DESK-MX6-L/Pheripherals/UART

< DESK-MX6-L
Revision as of 14:22, 16 July 2021 by U0009 (talk | contribs) (U0009 moved page AXEL Lite SOM/DESK-MX6-L/Pheripherals/UART to DESK-MX6-L/Pheripherals/UART: modifica gestione DESK come prodotto a se stante)

History
Version Issue Date Notes
1.0.0 Oct 2020 First DESK release


Contents

Peripheral UARTEdit

Device tree configurationEdit

Here below an example of device tree configuration used on standard DAVE's kit for the AXELLite SOM:

From imx6qdl-sbcx-revb-common.dtsi:

&uart2 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_uart2_1>;
    fsl,uart-has-rtscts;
    status = "okay";
};

From imx6qdl-axelcommon.dtsi:

    uart2 {
        pinctrl_uart2_1: uart2_grp-1 {
            fsl,pins = <
                MX6QDL_PAD_SD3_DAT4__UART2_RX_DATA 0x1b0b1
                MX6QDL_PAD_SD3_DAT5__UART2_TX_DATA 0x1b0b1
                MX6QDL_PAD_SD3_CMD__UART2_CTS_B 0x1b0b1
                MX6QDL_PAD_SD3_CLK__UART2_RTS_B 0x1b0b1
            >;
        };

Accessing the peripheralEdit

Linux messages at boot timeEdit

...
...
[    0.327639] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 67, base_baud = 5000000) is a IMX
[    0.328239] 21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 68, base_baud = 5000000) is a IMX
[    1.217209] console [ttymxc2] enabled
[    1.221552] 21f0000.serial: ttymxc3 at MMIO 0x21f0000 (irq = 69, base_baud = 5000000) is a IMX
[    1.230860] 21f4000.serial: ttymxc4 at MMIO 0x21f4000 (irq = 70, base_baud = 5000000) is a IMX
...
...
root@imx6qxelk:~#

Usage with sttyEdit

N.B. UART mapping respect to ttymxcX is the following one:

UART1 <-> ttymxc0
UART2 <-> ttymxc1
UART3 <-> ttymxc2
UART4 <-> ttymxc3
...
root@desk-mx6:~# stty -F /dev/ttymxc1 115200 -echo
root@desk-mx6:~# cat /dev/ttymxc1 &
[2] 555
root@desk-mx6:~# echo "Test loopback" > /dev/ttymxc1
root@desk-mx6:~# Test loopback

Additional informationEdit

Serial ports can be used through the standard serial programming API.

For detailed information, please refer to the Serial Programming HOWTO at Serial-Programming-HOWTO