SK-AM62P-LP: UART Com from Linux SDK

Part Number: SK-AM62P-LP

Tool/software:

Hi experts,

We are trying to use uart5 from A53 core(main domain) to run the uart communication from the Linux system.

I have done a quick check-in device tree file looks like it is not defined there.

Can you please tell me how can I access this?

Regards,
Debashis

  • Hi Debashis,

    You would have to enable UART5 in kernel devicetree to use the UART in Linux. Please refer to the instruction linked below.

    https://dev.ti.com/tirex/explore/node?node=A__AS4TOb7e5T1d6.5bfnXv2Q__AM62P-ACADEMY__fp5YxRM__LATEST&placeholder=true

  • Hi Bin Liu,

    I have checked the menuconfig first and found that it's already enabled by default.
    So, I directly changed the device tree file(k3-am62p5-sk.dts) for main_uart5 by reference to a similar file for main_uart1.

    aliases {
    		serial0 = &wkup_uart0;
    		serial2 = &main_uart0;
    		serial3 = &main_uart1;
    		serial5 = &main_uart5;
    		mmc0 = &sdhci0;
    		mmc1 = &sdhci1;
    		mmc2 = &sdhci2;
    		spi0 = &ospi0;
    		ethernet0 = &cpsw_port1;
    		ethernet1 = &cpsw_port2;
    		usb0 = &usb0;
    		usb1 = &usb1;
    	};
    main_uart5_pins_default: main-uart5-default-pins {
    		pinctrl-single,pins = <
    			AM62PX_IOPAD(0x1d8, PIN_INPUT, 1)	/* (B23) UART0_RXD */
    			AM62PX_IOPAD(0x1dc, PIN_OUTPUT, 1)	/* (F20) UART0_TXD */
    		>;
    		bootph-all;
    	};
    	
    &main_uart5 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_uart5_pins_default>;
    	/* Main UART5 is used by USER firmware */
    	status = "okay";
    	bootph-all;
    };


    After that, I built and transferred the .dtb file to the target board.

    Output:
    root@am62pxx-evm:~# cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:unknown port:00000000 irq:0
    1: uart:unknown port:00000000 irq:0
    2: uart:8250 mmio:0x02800000 irq:251 tx:20146 rx:429 RTS|DTR|DSR
    3: uart:unknown port:00000000 irq:0
    4: uart:unknown port:00000000 irq:0
    5: uart:8250 mmio:0x02850000 irq:253 tx:8016 rx:7561 DSR
    6: uart:unknown port:00000000 irq:0
    7: uart:unknown port:00000000 irq:0
    8: uart:unknown port:00000000 irq:0
    9: uart:unknown port:00000000 irq:0
    10: uart:unknown port:00000000 irq:0
    11: uart:unknown port:00000000 irq:0
    root@am62pxx-evm:~# dmesg | grep base_baud
    [    1.669955] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 251, base_baud = 3000000) is a 8250
    [    1.684830] 2850000.serial: ttyS5 at MMIO 0x2850000 (irq = 253, base_baud = 3000000) is a 8250
    


    Is it Correct whatever I did?

    When I loop back the RX and TX by running echo "hello" > /dev/ttyS5 in one terminal and cat /dev/ttyS5 in another, the data is coming through, but with some erratic behavior. There is an unusual amount of vertical blank space appearing between the data. This blank space continues until I press Control-C to stop it.

    Regards,
    Debashis

  • Hi Debashis,

    Is it Correct whatever I did?

    Yes, UART5 seems to be configured correct.

    When I loop back the RX and TX by running echo "hello" > /dev/ttyS5 in one terminal and cat /dev/ttyS5 in another, the data is coming through, but with some erratic behavior. There is an unusual amount of vertical blank space appearing between the data. This blank space continues until I press Control-C to stop it.

    I am not sure what causes the problem, but please run the following commands before doing echo/cat commands, and let me know if this resolve the issue.

    # systemctl disable serial-getty@ttyS5.service
    # stty -F /dev/ttyS5 115200 -echo