具体配置如下:
Device Drivers
[*] USB support --->
<*> USB Gadget Support --->
<*> USB Gadget Support --->
USB Gadget precomposed configurations --->
<M> Ethernet Gadget (with CDC Ethernet support)
[*] RNDIS support
[ ] Ethernet Emulation Model (EEM) support
编译好之后,将生成的u_ether.ko libcomposite.ko g_ether.ko usb_f_rndis.ko usb_f_ecm.ko
安装驱动顺序如下
insmod u_ether.ko
insmod libcomposite.ko
insmod usb_f_rndis.ko
insmod usb_f_ecm.ko
insmod g_ether.ko
遇到的问题:
[ 251.324871] udc-core: couldn't find an available UDC - added [g_ether] to list of pend# ing driver
该问题是:因为加载了g_serial.ko导致的,只能由一个。因此去掉g_serial.ko就可以
参考: