make linux-menuconfig配置如下:
启用U盘shell指令如下:
dd if=/dev/zero of=udisk.img bs=1M count=5
insmod ./lib/modules/5.4.66/kernel/drivers/usb/gadget/libcomposite.ko
insmod ./lib/modules/5.4.66/kernel/drivers/usb/gadget/function/usb_f_mass_storage.ko
insmod ./lib/modules/5.4.66/kernel/drivers/usb/gadget/legacy/gadgetfs.ko
insmod ./lib/modules/5.4.66/kernel/drivers/usb/gadget/legacy/g_mass_storage.ko file=/udisk.img removable=1
遇到的问题:增加图4的配置即可
udc-core: couldn't find an available UDC - added [g_mass_storage] to list of pending drivers
成功连到电脑:
离线