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.

AM625: use WKUP_UART0 as BT connect port

Part Number: AM625

Hi Expert

How to set WKUP_UART0 as BT connect port?

My customer set WKUP_UART0 as BT connect port, but it can not work

SDK version is 08.04.01.03

Thanks

Daniel

  • Hi Daniel,

    Does the customer use the Processor SDK Linux package? Can you please explain how "it can not work"?

  • Hi Bin

    Only one byte of data can be sent, and then it cannot be sent.

    Thanks

    Daniel

  • Daniel,

    You still didn't provide enough details for me to understand the issue. Please explain:

    - you hardware setup, do you use AM62x EVM or your custom board? how is the BT device connected to WKUP UART0 port?

    - any kernel change to support this BT device?

    - what program and how did you run the test?

    - any Linux log showing the issue?

  • Hi Bin

    - you hardware setup, do you use AM62x EVM or your custom board? how is the BT device connected to WKUP UART0 port?

    custom board.

    - any kernel change to support this BT device?

    Only the device tree has been modified.

    / {

        bt_reg_on: regulator-5 {

            compatible = "gpio-reset";

            pinctrl-names = "default";

            pinctrl-0 = <&main_bt_en_pins_default>;

            reset-gpios = <&main_gpio0 42 GPIO_ACTIVE_LOW>;

            reset-delay-us = <2000>;

            reset-post-delay-ms = <200>;

            #reset-cells = <0>;

        };

      main_bt_en_pins_default: main-bt-en-pins-default {

            pinctrl-single,pins = <

                AM62X_IOPAD(0x00ac, PIN_OUTPUT_PULLUP, 7) /* (L21) GPMC0_CSn1.GPIO0_42 */

                AM62X_IOPAD(0x0244, PIN_OUTPUT_PULLUP, 7) /* (C17) MMC1_SDWP.GPIO1_49 */

            >;

        };

    /* BT */

    &wkup_uart0 {

        /* WKUP UART0 is used by DM firmware */

        //status = "reserved";

        pinctrl-names = "default";

        pinctrl-0 = <&wkup_uart0_pins_default>;

        resets = <&bt_reg_on>;

    };

    - what program and how did you run the test?

    Loading firmware fails when using the hciattch command.

    - any Linux log showing the issue?

    root@am62xx-evm:~# hciattach -t30 /dev/ttyS1 qca 115200 flow

    qca

    frame_hci_cmd_pkt: Sending EDL_PATCH_VER_REQ_CMD

    HCI-CMD -1:     0x1     0x0     0xfc    0x1     0x19

    read_vs_hci_event: Wait for HCI-Vendor Specfic Event from SOC

    wait_for_data: Timing out on select for 3 secs.

    hci_send_vs_cmd: Failed to get HCI-VS Event from SOC

    Failed to attach the patch payload to the Controller!

    qca_soc_init: Fail to get Rome Version (0xffffff92)

    Can't initialize device: Success

    Thanks

    Daniel

  • Hi Daniel,

    I think first we need to determine the issue is in UART or the BT device. Can you please bypass the BT device and connect the TXD RXD pins directly, then run UART external loopback test. If you can send and receive UART characters, then issue is not in UART. Otherwise, we need to look at the UART configuration first.

  • Hi Bin

    Remove BT device, but UART only can send one byte data.

    So the issue maybe the UART configuration.

    Thanks

    Daniel

  • Daniel,

    Please explain how you tested the UART.

  • Hi Bin

    Connect TXD and RXD to loopback test, send at most 2 bytes and the system will hang

    Thanks

    Daniel

  • Hi Daniel,

      pinctrl-names = "default";

        pinctrl-0 = <&wkup_uart0_pins_default>;

    How is this pinmux configured in device tree?

  • Hi Bin

    &mcu_pmx0 {

        wkup_uart0_pins_default: wkup-uart0-pins-default {

            pinctrl-single,pins = <

                AM62X_MCU_IOPAD(0x002c, PIN_INPUT, 0) /* (C6) WKUP_UART0_CTSn */

                AM62X_MCU_IOPAD(0x0030, PIN_OUTPUT, 0) /* (A4) WKUP_UART0_RTSn */

                AM62X_MCU_IOPAD(0x0024, PIN_INPUT, 0) /* (B4) WKUP_UART0_RXD */

                AM62X_MCU_IOPAD(0x0028, PIN_OUTPUT, 0) /* (C5) WKUP_UART0_TXD */

            >;

        };

    Thanks

    Daniel

  • Hi Daniel,

    The pinmux looks correct.

    Have you tried to enable the wkup uart0 on AM625 SK EVM and test to see if it has the same issue?

  • Hi Bin

    Yes, it has the same issue.

    The modified device tree is as follows:

    --------------------------------------------------------------------------------------------

    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 054a41caa0c5..c9cb995d25bb 100644

    --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi

    +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi

    @@ -8,6 +8,7 @@

    / {

            aliases {

                    serial2 = &main_uart0;

    +               serial1 = &wkup_uart0;

                    mmc0 = &sdhci0;

                    mmc1 = &sdhci1;

                    mmc2 = &sdhci2;

    @@ -247,6 +248,17 @@ hdmi_connector_in: endpoint {

            };

    };

     

    +&mcu_pmx0 {

    +       wkup_uart0_pins_default: wkup-uart0-pins-default {

    +               pinctrl-single,pins = <

    +                       AM62X_MCU_IOPAD(0x002c, PIN_INPUT, 0) /* (C6) WKUP_UART0_CTSn */

    +                       AM62X_MCU_IOPAD(0x0030, PIN_OUTPUT, 0) /* (A4) WKUP_UART0_RTSn */

    +                       AM62X_MCU_IOPAD(0x0024, PIN_INPUT, 0) /* (B4) WKUP_UART0_RXD */

    +                       AM62X_MCU_IOPAD(0x0028, PIN_OUTPUT, 0) /* (C5) WKUP_UART0_TXD */

    +               >;

    +       };

    +};

    +

    &main_pmx0 {

            main_uart0_pins_default: main-uart0-pins-default {

                    pinctrl-single,pins = <

    @@ -453,7 +465,8 @@ AM62X_IOPAD(0x0084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */

     

     &wkup_uart0 {

            /* WKUP UART0 is used by DM firmware */

    -       status = "reserved";

    +       pinctrl-names = "default";

    +       pinctrl-0 = <&wkup_uart0_pins_default>;

    };

    Thanks

    Daniel

  • Hi Daniel,

    WKUP UART0 has been enabled in U-Boot for DM firwmare logging, this seems to be interfering with enabling it again kernel. After applied the following U-Boot patch to disable it in U-Boot, I can send chars properly via WKUP UART0 in Linux. Please try with this patch and let me know if it works for you.

    diff --git a/arch/arm/dts/k3-am62x-r5-sk-common.dtsi b/arch/arm/dts/k3-am62x-r5-sk-common.dtsi
    index b4a5e3cfa146..a42a08a8c2e6 100644
    --- a/arch/arm/dts/k3-am62x-r5-sk-common.dtsi
    +++ b/arch/arm/dts/k3-am62x-r5-sk-common.dtsi
    @@ -138,7 +138,7 @@
     &wkup_uart0 {
            pinctrl-names = "default";
            pinctrl-0 = <&wkup_uart0_pins_default>;
    -       status = "okay";
    +       status = "disabled";
            u-boot,dm-spl;
     };
    

  • Hi Bin

    Customer used this modification on AM625 SK EVM, but the problem still exists. Maybe he took one of the wrong steps. Can you help to provide his binaries to test?

    Thanks

    Daniel

  • Hi Daniel,

    Attached below are the uboot binaries with WKUP UART0 disabled.

    u-boot-wkup-uart.zip

  • Hi Bin

    Customer uses the binary file to test on the SK-AM625 evm, puts the three files into the first partition of the SD card, and then uses the SD card to boot, the test result WKUP_UART0 still only sends one byte

    Is the DM firmware the file ipc_echo_testb_mcu1_0_release_strip.xer5f?

    but can't find the source code

    Is DM firmware included when making u-boot?

    How do I verify this file?

    Thanks

    Daniel

  • Hi Daniel,

    Is the DM firmware the file ipc_echo_testb_mcu1_0_release_strip.xer5f?

    Yes.

    but can't find the source code

    Its source code is not provided.

    Is DM firmware included when making u-boot?

    Yes.

    How do I verify this file?

    U-Boot won't boot if the DM firmware is missing in the U-Boot binary.

  • Hi Daniel,

    I could echo string multiple times, but transmission failed in my stress test. I will look into it to understand why wkup uart fails.

    Next week is a holiday in US, so please expect my delayed update.

  • Hi Daniel,

    Sorry for the late response.

    The issue is due to both Linux UART driver and SYSFW UART driver try to control WKUP_UART0 at the same time once WKUP_UART0 is enabled in Linux. After disabled WKUP_UART0 init in SYSFW, WKUP_UART0 can work properly in Linux.

    Disabling WKUP_UART0 in SYSFW requires source code modification, which is not supported in current Processor SDK. With the next Processor SDK v8.6 release, you will be able to disable WKUP_UART0 in SYSFW source code and recompile it. SDK v8.6 is planned to release by end of February.