CM3 gadget / device mode

I am using a custom PCB which is very similar to the CM3 IO PCB. The OTG is wired in the same way.

I can’t seem to find the correct device to echo to the UDC libcomposite/configfs gadget setup.

I have setup an overlay to force the OTG to be a peripheral :

  fragment@0 {
    target = <&usbdrd_dwc3>;
    __overlay__ {
      dr_mode = "peripheral";
      status = "okay";
    };
  };

I can see the setting on the dwc3@fcc00000 node :

# cat /sys/firmware/devicetree/base/usbdrd/dwc3@fcc00000/dr_mode 
peripheral

What should I echo to UDC when trying to enable the phy ? Where can I find available UDCs ?

If I run modprobe g_ether it prints the following to console :

[ 491.902443] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers

Not sure if this is relevant but I found this info in the device tree :

[    1.109031] phy phy-fe8a0000.usb2-phy.0: Looking up phy-supply from device tree
[    1.109066] rockchip-usb2phy fe8a0000.usb2-phy: failed to create phy

This same problem is happening with the rock3a - in this post.

The rock3a problem is solved by loading in some modules, however this doesn’t work for the cm3. I have the io board running with a cm3 on it :

modprobe dwc3-of-simple
modprobe dwc3-rockchip-inno
# ls /sys/class/udc/

Unfortunately no udc devices show up - which would be expected.

Eh @jack I really need help with this.

Set dr_mode to “otg” instead of “peripheral”.

And you would see udc device in /sys/class/udc/.

Great - thanks !
I also updated linux to the latest version : https://github.com/flatmax/buildroot.rockchip/commit/d46a0c5c3489b68aff78bed9dd811eb907b2cdbc

Tested working !

1 Like