文章目录
1 添加USB设备信息
要使用EC20 4G模块首先需要在Linux内核中添加EC20的USB信息,这样内核启动后,才能正确识别EC20 4G模块。打开Linux内核下的drivers/usb/serial/option.c 文件,添加如下信息:
1809 /* add support EC220 4G Module */
1810 {
USB_DEVICE(0x05C6, 0x9090) }, /* Quectel UC15 */
1811 {
USB_DEVICE(0x05C6, 0x9003) }, /* Quectel UC20 */
1812 {
USB_DEVICE(0x05C6, 0x9215) }, /* Quectel EC20 */
1813 {
USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC25/EC20 R2.0 */
1814 {
USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */
1815 /* end add */
其中第1813行是EC20 4G模块的USB信息。
2 Linux内核配置
添加完EC20 4G模块的USB信息后,需要修改Linux 内核配置来支持USBNET功能。具体配置如下:
Device Drivers --->
[*] Network device support --->
<*> USB Network Adapters --->
<*> Multi-purpose USB Networking Framework
配置如图 2.1所示:
接下来我们还需要使能 USB 串口 GSM、CDMA 驱动,配置路径如下:
Device Drivers --->
[*] USB support --->
<*> USB Serial Converter support --->
<*> USB driver for GSM and CDMA modems
配置如图 2.2所示:
然后配置ppp,配置路径如下:
Device Drivers --->
[*] Network device support --->
<*> PPP (point-to-point protocol) support
<*> PPP BSD-Compress compression
<*> PPP Deflate compression
[*] PPP filtering
<*> PPP MPPE compression (encryption)
[*] PPP multilink support
<*> PPP over Ethernet
<*> PPP support for async serial ports
<*> PPP support for sync tty ports
配置如图 2.3所示:
配置完成后,重新编译内核,然后使用新的内核启动开发板。如果配置成功开发板启动后会有如图 2.4信息打印:
可以看出EC20 4G模块识别成功,并且虚拟出5个USB设备,分别为ttyUSB0~ttyUSB4。