Linux 4G/5G 驱动移植、实践测试记录

本篇记录SIMCOM7600ce (LTE CAT4)、SIM8200 (5G) 模块驱动程序移植过程,备忘记录。

移植环境:
嵌入式平台NUC980 ARM9,内核版本linux-4.4 版本,内核中已经有 ppp 拨号软件,只需要在内核编译前打开设置选项就可以。采用拨号 RNDIS 方式。

1). 内核配置4G/5G 模块相关选项汇总如下

> Device Drivers 
--> USB support
-- -->  USB Serial Converter support
-- -- <*>   USB driver for GSM and CDMA modems

> 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 over IPv4 (PPTP)                                                                                                          
-- --  < >     PPP over L2TP                                                                                                                 
-- -- <*>     PPP support for async serial ports                                                                                            
-- --  <*>     PPP support for sync tty ports

注:其中关于网络部分基础选项、usb相关基础选项,根据需求自行添加。

2). 每个模块NDIS拨号脚本内容
2.1) simcom7600ce ndis 拨号脚本

echo -e "at\n\r">/dev/ttyUSB2
sleep 1
echo -e "AT+CUSBPIDSWICTH=9011,1,1\n\r">/dev/ttyUSB2
sleep 1
echo -e "at+csq?\n\r">/dev/ttyUSB2
sleep 1
# 电信卡的接入点ANP = ‘ctnet’
echo -e "at+cgdcont=6,\"ipv4v6\",\"ctnet\"\n\r">/dev/ttyUSB2
sleep 1
echo -e "at+cgact=1,1\n\r">/dev/ttyUSB2
sleep 2
echo -e "at+cgpaddr=1\n\r">/dev/ttyUSB2
sleep 3
udhcpc -i usb0 &
sleep 1

2.2) A7600C1 (LTE CAT1 模块)拨号脚本,此模块有自动识别运营商APN的功能,所以没有设置APN的内容。

echo -e "at\n\r">/dev/ttyUSB2
sleep 1
echo -e "AT+CUSBPIDSWICTH=9011,1,1\n\r">/dev/ttyUSB2
sleep 1
echo -e "at+dialmode=0\n\r">/dev/ttyUSB2
sleep 3
udhcpc -i usb0 &
sleep 3

2.3) SIM8200 5G模块的ndis拨号脚本

echo -e "at\n\r">/dev/ttyUSB2
sleep 1
# 此处配置pid = 9011 为ndis拨号方式,预防模块为其他类型拨号参数
echo -e "AT+CUSBCFG=usbid,1e0e,9011\n\r">/dev/ttyUSB2
sleep 1
echo -e "at+csq\n\r">/dev/ttyUSB2
sleep 1
# 移动卡的接入点ANP = ‘cmnet’
echo -e "at+cgdcont=1,\"ip\",\"cmnet\"\n\r">/dev/ttyUSB2
sleep 1
echo -e "at+cgact=1,1\n\r">/dev/ttyUSB2
sleep 2
echo -e "at+cgpaddr=1\n\r">/dev/ttyUSB2
sleep 1
echo -e "AT+cpsi?\n\r">/dev/ttyUSB2
sleep 3
udhcpc -i usb0 &
sleep 1

2.4) 华为ME909s 模块移动卡拨号脚本

echo -e "at\n\r">/dev/ttyUSB0
sleep 1
echo -e "at+csq?\n\r">/dev/ttyUSB0
sleep 1
echo -e "at+cgdcont=1,\"ip\",\"cmnet\"\n\r">/dev/ttyUSB0
sleep 1
echo -e "at+cgact=1,1\n\r">/dev/ttyUSB0
sleep 3
echo -e "at+cgpaddr=1\n\r">/dev/ttyUSB0
sleep 1
echo -e "at^ndisdup=1,1\n\r">/dev/ttyUSB0
sleep 1
udhcpc -i usb0 &
sleep 1

2.5)深圳有方的N720 模块电信卡拨号

echo -e "at\n\r">/dev/ttyUSB0
sleep 1
echo -e "at+csq?\n\r">/dev/ttyUSB0
sleep 1
echo -e "at+cgdcont=1,\"ip\",\"ctnet\"\n\r">/dev/ttyUSB0
sleep 1
echo -e "at+cgact=1,1\n\r">/dev/ttyUSB0
sleep 2
echo -e "at+cgpaddr=1\n\r">/dev/ttyUSB0
sleep 3
udhcpc -i usb0 &
sleep 1
  1. 测试验证信息如下:

3.1) 华为me906s 模块插入后识别usb识别信息

usb 1-2: new high-speed USB device number 2 using nuc980-ehci
usb 1-2: New USB device found, idVendor=12d1, idProduct=15c1
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: HUAWEI Mobile V7R11
usb 1-2: Manufacturer: Huawei Technologies Co., Ltd.
usb 1-2: SerialNumber: 0123456789ABCDEF
cdc_ether 1-2:2.0 usb0: register 'cdc_ether' at usb-nuc980-ehci-2, CDC Ethernet Device, 02:1e:10:1f:00:00
option 1-2:2.2: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
option 1-2:2.3: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1
option 1-2:2.4: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB2
option 1-2:2.5: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB3
option 1-2:2.6: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB4

3.2) SIMCOM8000 5G模块usb2.0打印信息

usb 1-2: new high-speed USB device number 3 using nuc980-ehci
usb 1-2: device descriptor read/64, error -71
//此处的pid为9001是 qcom 拨号方式
usb 1-2: New USB device found, idVendor=1e0e, idProduct=9001 
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: SDXPRAIRIE-MTP _SN:0987AA7D
usb 1-2: Manufacturer: QCOM
usb 1-2: SerialNumber: 0123456789ABCDEF
option 1-2:1.0: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
option 1-2:1.1: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1
option 1-2:1.2: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB2
option 1-2:1.3: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB3
option 1-2:1.4: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB4

至此,4G / 5G 模块移植完成。

猜你喜欢

转载自blog.csdn.net/weixin_38387929/article/details/112329452