USB OTG / device

fsl-lx2160a.dtsi has the default “host” in dr_mode of both usb0 and usb1.

can we use either otg or device modes with either usb0 or usb1?

do we just change the dr_mode field to “device” or “otg” and that’s it, or is anything else needed?

if we choose otg - do we have to make sure we use a USB cable where the fifth ID pin is grounded on one end and floating on the other end?

can we try these otg/device modes with the Clearfrog CX board? it has two usb A ports - we assume each port is connected to each of the USB controllers of the lx2160

thanks!

You can only use the bottom rear port as an device port as the other ports go through USB hubs so device mode isn’t possible. Just changing the dr_mode should be enough. You should not need a special USB cable since the board only has type A connectors so there is no OTG detection possible. The configuration will need to be done manually through the Linux usb gadget interface. Basically the difference from a software perspective is that in OTG mode the controller can be switched between host and device mode via the kernel controls, if you choose device-mode then the port will only be able to run as a USB target.

1 Like

There are two USB type A connectors on the ClearFrog CX - I think the top is usb0 and the bottom is usb1 (both of which are defined in fsl-lx2160a.dtsi). Do you mean one of those ports can be used as a device port? or something else? I don’t see any other port, except the two micro ports which are the console and the stm32.

Yes only the bottom USB-A connector can be used in device mode. It will require a USB-A to USB-C cable to a USB-C port, or that same cable with a USB-C female to USB-A adapter to plug into a standard USB-A port

1 Like

Thanks! And just to be sure - that bottom USB-A connector correlates with “usb1”, the 2nd entry in fsl-lx2160a.dtsi?

The bottom port correlates to usb0, usb1 is connected to the onboard hubs on the CEX7 module.

1 Like

Thank you!