Skip to main content
Visitor II
November 2, 2022
Question

STM32MP157D using otg as a device with micro-b connector ,and computer cannot find it.

  • November 2, 2022
  • 1 reply
  • 2198 views

I'm trying to set otg on stm32mp157d in device only mode, according to the guidance on OTG device tree configuration - stm32mpu (stmicroelectronics.cn),

&usbotg_hs {

compatible = "st,stm32mp15-hsotg", "snps,dwc2";

phys = <&usbphyc_port1 0>; /* 0: UTMI switch selects the OTG controller */

phy-names = "usb2-phy";

dr_mode = "peripheral"; /* could be "host", see USB generic bindings [6] */

usb-role-switch; /* see USB generic bindings [6] */

role-switch-default-mode = "peripheral"; /* could be "host", see USB generic bindings [6] */

status = "okay"; /* enable OTG */

};

I also enable usbphyc like this:

&usbphyc {

  status = "okay";

};

&usbphyc_port0 {

  phy-supply = <&vdd_usb>;

  st,phy-tuning = <&usb_phy_tuning>;

};

&usbphyc_port1 {

  phy-supply = <&vdd_usb>;

  st,phy-tuning = <&usb_phy_tuning>;

};

However , when I using the Uboot system ,I can use the otg port using the command ums to load it as a usb flash disk and the computer can detected it. But when I using the linux arm system, trying to set the otg port as a usb falsh disk or usb webcam with gadget, the computer cannot find anyway and device manager on computer can't even find any usb device plug in ,I wonder if there is someting important I miss to setup.

As for the hardware , I only connect the otg_dm and otg_dp to the micro-b connecter.

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    November 2, 2022

    Hi @Community member​ 

    With some previous ecosystem, the Device Tree syntax has some subtle differences between uBoot and Linux.

    Please ensure you are using latest ecosystem v4.x, otherwise, DTS definition might be different (refer to https://wiki.st.com/stm32mpu/wiki/Main_Page#STM32_MPU_archived_wikis)

    Regards.

    qqwe.3Author
    Visitor II
    November 2, 2022

    thank you for your answer, but I've check that it is the latest version, also in the old version the device tree is the same ,as for the uboot ,here is the device tree setting about otg in uboot:

    &usbotg_hs {

    u-boot,force-b-session-valid;

    hnp-srp-disable;

    /* TEMP: force peripheral for USB OTG */

    dr_mode = "peripheral";

    };

    Is there any other reasons may cause that?

    Technical Moderator
    November 2, 2022

    Hi @Community member​ 

    From my side, DT for Linux and uBoot seems OK.

    Could you share the complete console boot log (from TF-A, uBoot and Linux) ?

    Regards.