Open main menu

DAVE Developer's Wiki β

DESK-MX6UL-L/Peripherals/UART

< DESK-MX6UL-L
Revision as of 15:12, 3 April 2023 by U0026 (talk | contribs) (Minor update for DESK MX6UL 4.0.0 rel)

History
Version Issue Date Notes

1.0.0

Apr 2021 First DESK release
2.0.0 Feb 2022 DESK 3.0.0 release
3.0.0 Apr 2023 DESK 4.0.0 release


Contents

Peripheral UARTEdit

Device tree configurationEdit

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

From the Carrier imx6ul-axelulite-cb003a.dts device tree:

&uart3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart3>;
        status = "okay";
};
...
...
&iomuxc {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_hog_gpios>;

        imx6ul-axelulite {
...
...
        uart {
                pinctrl_uart3: uart3grp {
                        fsl,pins = <
                                MX6UL_PAD_UART3_RX_DATA__UART3_DCE_RX   0x1b0b1
                                MX6UL_PAD_UART3_TX_DATA__UART3_DCE_TX   0x1b0b1
                        >;
                };
        };
...
...

Accessing the peripheralEdit

Linux messages at boot timeEdit

...
...
[    0.569198] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 30, base_baud = 5000000) is a IMX
[    1.344706] 21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 65, base_baud = 5000000) is a IMX
...
...

Usage with sttyEdit

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

UART1 <-> ttymxc0
UART2 <-> ttymxc1
UART3 <-> ttymxc2
UART4 <-> ttymxc3
UART5 <-> ttymxc4
UART6 <-> ttymxc5
UART7 <-> ttymxc6
UART8 <-> ttymxc7
...


For example, using a loopback HW connection (RX short circuited to TX on UART232 port) it is possible to test the send and receive data using the ttymxc2 device:

root@desk-mx6ul-axelulite:~# stty -F /dev/ttymxc2 115200 -echo
root@desk-mx6ul-axelulite:~# cat /dev/ttymxc2 &
[1] 267
root@desk-mx6ul-axelulite:~# echo "Test loopback" > /dev/ttymxc2
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