kernel用的是linux-5.2
make menuconfig配置如下:
Device Driver ---->
USB support---->
* USB Mass Storage support
Device Driver ---->
USB support---->
USB Gadget Support--->
<M> USB Gadget functions configurable through configfs
* Generic serial bulk in/out
* Mass storage
* Function filesystem
[M] USB Gadget precomposed configurations
[M] Mass storage Gadget
设备树没改动;
make ARCH=arm licheepi_zero_defconfig
加载驱动如下:
# ls
g_mass_storage.ko libcomposite.ko usb_f_mass_storage.ko
# insmod libcomposite.ko
# insmod usb_f_mass_storage.ko
insmod: can't insert 'usb_f_mass_storage.ko': invalid module format
# insmod g_mass_storage.ko file=/dev/mmcblk0p1 stall=0 removable=1
[ 2108.120204] g_mass_storage: Unknown symbol fsg_common_set_sysfs (err -2)
[ 2108.127009] g_mass_storage: Unknown symbol fsg_common_create_luns (err -2)
[ 2108.134083] g_mass_storage: Unknown symbol fsg_common_set_cdev (err -2)
[ 2108.140753] g_mass_storage: Unknown symbol fsg_common_free_buffers (err -2)
[ 2108.147735] g_mass_storage: Unknown symbol fsg_common_remove_luns (err -2)
[ 2108.154655] g_mass_storage: Unknown symbol fsg_common_set_inquiry_string (err -2)
[ 2108.162164] g_mass_storage: Unknown symbol fsg_common_set_num_buffers (err -2)
[ 2108.169434] g_mass_storage: Unknown symbol fsg_config_from_params (err -2)
[ 2108.179749] g_mass_storage: Unknown symbol fsg_common_set_sysfs (err -2)
[ 2108.186554] g_mass_storage: Unknown symbol fsg_common_create_luns (err -2)
[ 2108.193649] g_mass_storage: Unknown symbol fsg_common_set_cdev (err -2)
[ 2108.200315] g_mass_storage: Unknown symbol fsg_common_free_buffers (err -2)
[ 2108.207296] g_mass_storage: Unknown symbol fsg_common_remove_luns (err -2)
[ 2108.214218] g_mass_storage: Unknown symbol fsg_common_set_inquiry_string (err -2)
[ 2108.221726] g_mass_storage: Unknown symbol fsg_common_set_num_buffers (err -2)
[ 2108.228974] g_mass_storage: Unknown symbol fsg_config_from_params (err -2)
insmod: can't insert 'g_mass_storage.ko': unknown symbol in module, or unknown parameter
离线