How to enable USB OTG functionality on Hummingboard Pulse?

I am using Hummingboard Pulse evaluation board + IMX8MP SOM with Yocto Kirkstone. I want to configure USB OTG functionality to use the board’s USB port as for example UVC camera.

How do I proceed? Do I have to modify device tree? If yes, how?

After connecting usb cable(USB A ↔ USC B) from Humming board Pulse to Host PC, I currently get this error:

usb usb2-port1: config error
usb usb2-port1: Cannot enable. Maybe the USB cable is bad?

By default the device-tree configures the connector to be in Host mode only. You can change the dr_mode property to change the functionality, https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/generic.txt

Gadget mode is only supported on the first DWC controller of the SOC. After you change the device-tree standard gadget role instructions for Linux should work as expected.

Thanks, it works!

Modification of the device tree helped:

&usb_dwc3_0 {
dr_mode = “otg”;
snps,dis-u1-entry-quirk;
snps,dis-u2-entry-quirk;
status = “okay”;
};