USB OTG Dual role testing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB OTG Dual role testing

6,027 Views
yashavanthashet
Contributor V

Hi,

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
root@imx8mqevk:~#

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

Thanks in advance,

Regards,
Yashavantha

8 Replies

4,610 Views
sandeep_yenugul
Contributor III

Hi yashvanatha,

Did you got any solution. As I am also having same issue.

0 Kudos
Reply

4,610 Views
yashavanthashet
Contributor V

Hi Sandeep,

USB OTG dual mode is not supported in present i.MX8 BSPs.

4,610 Views
传策薛
Contributor V

The current ax8mq Android9_2.3.0 bsp adb function is invalid. The previous bsp function of Android9_1.0.0 is normal. What is the reason?

0 Kudos
Reply

4,610 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi yashavantha

    USB OTG means the USB can work on Host or device mode,  these 2 modes can't work at the same time. User can only select one mode simultaneously.

Have a nice day!

NXP TIC weidong sun

4,610 Views
yashavanthashet
Contributor V

hi,

Yes, I meant the same.

I know that by default USB host mode will be enabled, only after inserting modules as mentioned above device mode gets enabled.

The problem for me is if I keep in OTG mode dts and 'CONFIG_USB_DWC3_DUAL_ROLE=y', for me neither host nor device is working.

Regards,

Yashavantha

4,610 Views
yashavanthashet
Contributor V

hi,

According to i.MX8M reference manual, section 11.1.1.2

11.1.1.2 Modes of Operation
The USB 3.0 module operates in following modes.
• Host Mode: SS/HS/FS/LS
• Device Mode: SS/HS/FS
• OTG: HS/FS/LS

so according to above i.MX8M supports 2.0 OTG mode and as per our understanding  OTG mode supports both host and device capability. We can check host capability by connecting usb storage device (pendrive) and can check device capability by connecting usb otg cable(by insmod).

Kindly let me know OTG mode is tested in i.MX8M evk? Both host and device works without changing binary?

Thanks and Regrads,

Yashavantha

0 Kudos
Reply

4,610 Views
yashavanthashet
Contributor V

Hi,

Waiting for your reply.

Regards,

Yashavnatha

0 Kudos
Reply

4,610 Views
yashavanthashet
Contributor V

Hi,

 

Waiting for your answer.

 

Regards,

Yashavnatha

0 Kudos
Reply