Hi
I am try to create configfs-gadget with USB dwc3.
I create gadget usb_f_fs driver and create gadget structure. it's successfully registered.
but UDC dwc3 not started its fail every time.
below showing error
root@imx8mp:/run/usb/config/usb_gadget/g1# echo 38100000.dwc3 > UDC
[ 320.941377] configfs-gadget 38100000.dwc3: failed to start g1: -19
below My gadget config steps
read_model
modprobe libcomposite
mkdir -p /run/usb/config
mount none /run/usb/config -t configfs
cd /run/usb/config/usb_gadget/
mkdir g1
cd g1
echo 0x1600 >idVendor
echo 0x0030 >idProduct
mkdir strings/0x409
echo "0000000000" >strings/0x409/serialnumber
echo "XYZ" >strings/0x409/manufacturer
echo "product1" >strings/0x409/product
mkdir configs/c.1
mkdir configs/c.1/strings/0x409
echo "Config1" >configs/c.1/strings/0x409/configuration
mkdir functions/ffs.usb0
ln -s functions/ffs.usb0 configs/c.1
cd ../../../
mkdir -p ffs
mount usb0 ffs -t functionfs -o gid=1000,uid=1000
echo 38100000.dwc3 > UDC
it's UDC not success fully bind with gadget attach code snap
dev_dbg(&udc->dev, "registering UDC driver [%s]\n",
driver->function);
udc->driver = driver;
udc->dev.driver = &driver->driver;
udc->gadget->dev.driver = &driver->driver;
usb_gadget_udc_set_speed(udc, driver->max_speed);
ret = driver->bind(udc->gadget, driver);
if (ret)
{
goto err1;
}
已解决! 转到解答。