DESK-MX9-L/Peripherals/UART

From DAVE Developer's Wiki
< DESK-MX9-L
Revision as of 09:20, 1 February 2024 by U0007 (talk | contribs) (U0007 moved page DESK-MX9-L/Pheripherals/UART to DESK-MX9-L/Peripherals/UART without leaving a redirect)
Jump to: navigation, search
History
2024/01/30 DESK-MX9-L-5.0.0 release


Peripheral UART[edit | edit source]

Device tree configuration[edit | edit source]

AURA SOM[edit | edit source]

Here below 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 in AURA SOM[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 (RS232) <-> ttyLP00
LPUART2 (Multiprotocol) <-> ttyLP1
LPUART3 (UART) <-> ttyLP2
LPUART4 (UART) <-> 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