DESK-MX9-L/Peripherals/UART

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2024/01/30 DESK-MX9-L-5.x.x release



Peripheral UART[edit | edit source]

Device tree configuration[edit | edit source]

Here below is an example of device tree modifications to standard DAVE's kit for the AURA SOM:

From imx93-aura-cb2001.dts:

...
...
&lpuart4 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart4>;
	status = "okay";
};
...
&iomuxc {
...
	pinctrl_uart4: uart4grp{
		fsl,pins = <
			MX93_PAD_GPIO_IO14__LPUART4_TX			0x31e
			MX93_PAD_GPIO_IO15__LPUART4_RX			0x31e
		>;
	};
...

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

...
[    0.847346] 44380000.serial: ttyLP0 at MMIO 0x44380010 (irq = 18, base_baud = 1500000) is a FSL_LPUART
[    0.856702] printk: console [ttyLP0] enabled
[    0.875438] 44390000.serial: ttyLP1 at MMIO 0x44390010 (irq = 19, base_baud = 1500000) is a FSL_LPUART
[    0.885307] 42580000.serial: ttyLP3 at MMIO 0x42580010 (irq = 20, base_baud = 1500000) is a FSL_LPUART
[    0.895137] 42690000.serial: ttyLP2 at MMIO 0x42690010 (irq = 21, base_baud = 1500000) is a FSL_LPUART
...

Usage with stty[edit | edit source]

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

LPUART1 <-> ttyLP0
LPUART2 <-> ttyLP1
LPUART3 <-> ttyLP2
LPUART4 <-> ttyLP3
...
root@desk-mx93:~# stty -F /dev/ttyLP1 115200 -echo -raw
root@desk-mx93:~# cat /dev/ttyLP1 > test_ttyLP1.log &
[1] 716
root@desk-mx93:~# echo "Test loopback" > /dev/ttyLP1
root@desk-mx93:~# cat test_ttyLP1.log
Test loopback

root@desk-mx93:~#

Additional information[edit | edit source]

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