This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM62X: Configure UART-5 FOR AM62x

Part Number: PROCESSOR-SDK-AM62X

Hi,

In the SK-AM62x EVM, we are able to see that the UART-5 IS configured. Now we are having a small doubt that how UART-5 is being configured.

1) Could you please share the steps to configure the UART-5 (Pin no. 8 and 10 of HDR_2X20 from the User Expansion Connector) for AM62x.

2) How to do pinmux, if possible then please provide the related document for the same.

3) If it is possible, could you please share the .dtsi file so that we can also understand the steps clearly.

Thanks & Regards

Lakshmi Jha

  • Hi Lakshmi,

    The following kernel DT patch enables UART5 on SK-AM62x:

    diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    index e586884eb077..f8cf7ea85796 100644
    --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    @@ -9,6 +9,8 @@
            aliases {
                    serial0 = &wkup_uart0;
                    serial2 = &main_uart0;
    +               serial7 = &main_uart5;
                    mmc0 = &sdhci0;
                    mmc1 = &sdhci1;
                    mmc2 = &sdhci2;
    @@ -434,6 +438,14 @@
                    >;
            };
    
    +       main_uart5_pins_default: main_uart5-pins-default {
    +               pinctrl-single,pins = <
    +                       AM62X_IOPAD(0x01dc, PIN_OUTPUT, 1) /* (E15) MCAN0_RX.uart5.tx */
    +                       AM62X_IOPAD(0x01d8, PIN_INPUT, 1) /* (C15) MCAN0_TX.uart5.rx */
    +               >;
    +       };
     };
    
     &mcu_uart0 {
    @@ -482,7 +494,9 @@
     };
    
     &main_uart5 {
    -       status = "disabled";
    +       pinctrl-names = "default";
    +       pinctrl-0 = <&main_uart5_pins_default>;
    +       status = "okay";
     };

    The details are documented at

    https://dev.ti.com/tirex/explore/node?node=A__AIGDKkj3W5pn5WQK5DA3Lg__linux_academy_am62x__XaWts8R__LATEST

  • Hi Bin Liu,

    We have added the kernel DT patch in order to enable UART5 on SK-AM62x.

    1) We did the loop-back between the Pin no. 8 and 10 of HDR_2X20 from the User Expansion Connector and after giving the below command some data should be displayed but it is not giving anything.

    console:/ # echo name > /dev/ttyS7

    130|console:/ # cat /dev/tty S7130|console:/ # cat /dev/ttyS7 &
    [1] 1796
    console:/ # ECHO [ 139.118973] AidlLazyServiceRegistrar: Trying to shut down the service. No clients in use for any service in process.
    [ 139.130703] AidlLazyServiceRegistrar: Unregistered all clients and exiting
    [ 139.143580] init: Service 'apexd' (pid 275) exited with status 0 oneshot service took 91.582001 seconds in background
    [ 139.154283] init: Sending signal 9 to service 'apexd' (pid 275) process group...
    [ 139.162233] libprocessgroup: Successfully killed process cgroup uid 0 pid 275 in 0ms
    ^C
    130|console:/ # echo hell > /de
    debug_ramdisk/ dev/
    130|console:/ # echo hell > /de v130|console:/ # echo hell > /dev/ tt
    tty ttyS0 ttyS1 ttyS2 ttyS3 ttyS4 ttyS5 ttyS6 ttyS7 ttyS8 ttyS9
    130|console:/ # echo hell > /dev/tty S7
    console:/ # hell

    hell

    hell

    hell

    hell

    Here we are observing the data is keep on going in the background continuously but we are writing it only one time.

    Could you please provide the steps to configure the UART-5.

    Kindly suggest the steps to get it done properly.

    Thanks & Regards

    Lakshmi Jha

  • Please run the following command first to disable echo:

    # stty -F /dev/ttyS7 -echo

  • Hi Bin Liu,

    Thanks for helping out to configure the UART for AM62x. The command provided by you to enable the echo has worked perfectly.


    1) Now we are trying to configure the IO Expander (EXP_PS_3V3_EN) for BM83 (Bluetooth Module):

    Could you please share the steps to set/clear the particular pins for the same, so that we can be able to enable/disable the particular pin from IO Expander at anytime.

    2) Another thing we need to know that the steps to enable the below mentioned GPIO pins:

        1. Reset Pin (GPIO1_15):

             Pin Number: A13

             Pin Name: EXP_SPI0_CS0

        2. MFB Pin (EXP_GPIO0_39):

            Pin Number: K25

            Pin Name: GPMC0_WPN


    Thanks & Regards

    Lakshmi Jha

  • Hi Lakshimi,

    One topic per e2e thread has many advantages, so please create new E2E posts whenever you have different queries in the future. But since I know the answers to your new GPIO questions, I am replying in this thread:

    1) Now we are trying to configure the IO Expander (EXP_PS_3V3_EN) for BM83 (Bluetooth Module):

    Please follow the document below:

    https://dev.ti.com/tirex/explore/node?node=A__ANR3bSoQUtte3JSAV7ex0g__linux_academy_am62x__XaWts8R__LATEST&r=XaWts8R__8.3.0.0%20v1&r=XaWts8R__8.3.0.0%20v2&r=XaWts8R__8.4.1.3%20v1

    2) Another thing we need to know that the steps to enable the below mentioned GPIO pins:

    Step 1 - set the pinmux of these two pins to GPIO mode in kernel device tree;

    Step 2 - follow the document linked above to control the GPIO pins in Linux user space.