本文主要是介绍展锐8541E配置USB ACM,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、kernel config 参考如下修改
cd bsp
source build/envsetup.sh
lunch 34
kuconfig -> Device Drivers ---> USB support ---> USB Gadget Support ---> [*] Abstract Control Model (CDC ACM)--- kernel/kernel4.14/arch/arm/configs/sprd_sharkle_defconfig (revision 226)
+++ kernel/kernel4.14/arch/arm/configs/sprd_sharkle_defconfig (working copy)
@@ -2987,6 +2996,7 @@# CONFIG_USB_GADGET_XILINX is not set# CONFIG_USB_DUMMY_HCD is not setCONFIG_USB_LIBCOMPOSITE=y
+CONFIG_USB_F_ACM=yCONFIG_USB_U_SERIAL=yCONFIG_USB_U_ETHER=yCONFIG_USB_F_SERIAL=y
@@ -3001,7 +3011,7 @@CONFIG_USB_F_VSERIAL=yCONFIG_USB_CONFIGFS=yCONFIG_USB_CONFIGFS_SERIAL=y
-# CONFIG_USB_CONFIGFS_ACM is not set
+CONFIG_USB_CONFIGFS_ACM=y# CONFIG_USB_CONFIGFS_OBEX is not set# CONFIG_USB_CONFIGFS_NCM is not set# CONFIG_USB_CONFIGFS_ECM is not set2、为了不占用基线已有的USB串口,增大USB串口支持的最大数目
--- bsp/kernel/kernel4.14/drivers/usb/gadget/function/u_serial.h (revision 226)
+++ bsp/kernel/kernel4.14/drivers/usb/gadget/function/u_serial.h (working copy)
@@ -15,7 +15,7 @@#include <linux/usb/composite.h>#include <linux/usb/cdc.h>-#define MAX_U_SERIAL_PORTS 8
+#define MAX_U_SERIAL_PORTS 10struct f_serial_opts {struct usb_function_instance func_inst;3、init.common.usb.rc 参考如下修改(完整路径以sharkle为例:device/sprd/sharkle/common/rootdir/root/init.common.usb.rc)
on init
...mkdir /config/usb_gadget/g1/functions/mass_storage.gs6 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs0 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs1 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs2 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs3 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs4 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs5 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs6 0770 shell shellmkdir /config/usb_gadget/g1/functions/gser.gs7 0770 shell shell
+ mkdir /config/usb_gadget/g1/functions/acm.gs0 0770 shell shell
+ mkdir /config/usb_gadget/g1/functions/acm.gs1 0770 shell shellsetprop sys.usb.mode normal+ # 新增
这篇关于展锐8541E配置USB ACM的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!