Article Directory
1 Add USB device information
To use the EC20 4G module, you first need to add the EC20 USB information to the Linux kernel, so that the EC20 4G module can be correctly identified after the kernel is started. Open the drivers/usb/serial/option.c file under the Linux kernel and add the following information:
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 */
The 1813th line is the USB information of the EC20 4G module.
2 Linux kernel configuration
After adding the USB information of the EC20 4G module, you need to modify the Linux kernel configuration to support the USBNET function. The specific configuration is as follows:
Device Drivers --->
[*] Network device support --->
<*> USB Network Adapters --->
<*> Multi-purpose USB Networking Framework
The configuration is shown in Figure 2.1:
Next, we also need to enable the USB serial port GSM and CDMA drivers. The configuration path is as follows:
Device Drivers --->
[*] USB support --->
<*> USB Serial Converter support --->
<*> USB driver for GSM and CDMA modems
The configuration is shown in Figure 2.2:
Then configure ppp, the configuration path is as follows:
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
The configuration is shown in Figure 2.3:
After the configuration is complete, recompile the kernel, and then use the new kernel to start the development board. If the configuration is successful, the development board will be printed as shown in Figure 2.4 after startup:
It can be seen that the EC20 4G module is successfully recognized and 5 USB devices are virtualized, namely ttyUSB0~ttyUSB4.