AnsweredAssumed Answered

USB OTG Dual role testing

Question asked by yashavantha shetty on Nov 12, 2018
Latest reply on Nov 25, 2019 by 传策 薛



We are using i.MX8M custom board with linux4.9.5_ga release.


We are facing with issue with usb otg dual mode operation. If we force otg to host mode it is working, also forcing it to device (peripheral) mode also working, but not able to get it worked with "otg" mode(both host and device at same time).

Please see the below table.


menuconfigdts file dr_modeOTG as deviceOTG as host
CONFIG_USB_DWC3_DUAL_ROLE=ydr_mode = "peripheral"PASSFAIL
                       "dr_mode = "host"FAILPASS
                       "dr_mode = "otg"FAILFAIL


the below is the dts file implementation,

&usb_dwc3_0 {
        status = "okay";
        dr_mode = "otg";


Kindly let me know how to test both otg as hos and device in single binary?  I am using 'insmod' to install otg as device modules.

In OTG mode if i connect a usb pendrive no any print appears and when install module for device below error appears.



root@imx8mqevk:~# insmod configfs.ko
root@imx8mqevk:~# insmod libcomposite.ko
root@imx8mqevk:~# insmod usb_f_mass_storage.ko
root@imx8mqevk:~# insmod g_mass_storage.ko file=/dev/mmcblk1p1 removable=1
[   57.085718] udc-core: couldn't find an available UDC - added [g_mass_storage] to list of pending drivers



Thanks in advance,