RK3399 4G模組移遠EC20移植除錯
CPU : RK3399
系統: Android 7.1
1 、透過串列埠列印或者 adb 獲取模組的 pid 和 vid ,順便可以看到生成 4 個虛擬串列埠 /dev/ttyUSB*
[ 11.734379 ] usb 1 - 1.1 : new high-speed USB device number 3 using ehci-platform
[ 11.828247 ] usb 1 - 1.1 : New USB device found, idVendor=2c7c, idProduct= 0125
[ 11.828386 ] usb 1 - 1.1 : New USB device strings: Mfr= 1 , Product= 2 , SerialNumber= 0
[ 11.828413 ] usb 1 - 1.1 : Product: Android
[ 11.828436 ] usb 1 - 1.1 : Manufacturer: Android
[ 11.835480 ] option 1 - 1.1 : 1.0 : GSM modem ( 1 -port) converter detected
[ 11.841217 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB0
[ 11.844988 ] option 1 - 1.1 : 1.1 : GSM modem ( 1 -port) converter detected
[ 11.851892 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB1
[ 11.853964 ] option 1 - 1.1 : 1.2 : GSM modem ( 1 -port) converter detected
[ 11.864677 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB2
[ 11.865658 ] option 1 - 1.1 : 1.3 : GSM modem ( 1 -port) converter detected
[ 11.871387 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB3
2 、在程式碼中新增模組的 pid 和 vid ,原始程式碼中已經包含移遠的幾個模組,仿照現有的新增 EC20
diff --git a/kernel/drivers/usb/serial/option.c b/kernel/drivers/usb/serial/option.c
index 1799aa0..f6c9e5d 100644
--- a/kernel/drivers/usb/serial/option.c
+++ b/kernel/drivers/usb/serial/option.c
@@ - 241 , 6 + 241 , 7 @@ static void option_instat_callback( struct urb *urb);
#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
+ #define QUECTEL_PRODUCT_EC20 0x0125
#define QUECTEL_PRODUCT_EC21 0x0121
#define QUECTEL_PRODUCT_EC25 0x0125
#define QUECTEL_PRODUCT_BG96 0x0296
@@ - 1200 , 6 + 1201 , 8 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5),
.driver_info = (kernel_ulong_t)&yuga_clm920_nc5_blacklist },
/* Quectel products using Quectel vendor ID */
+ { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC20),
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25)
3 、新增模組的 so 庫,此庫需要移遠提供, so 支援的系統要匹配,將 so 庫複製到下面的路徑
vendor/rockchip/common/phone/lib/libreference-ril.so
4 、開啟 device/rockchip/common/device.mk 檔案,修改 rild.libpath 路徑為 rild.libpath=/system/lib64/libreference-ril.so
diff --git a/device/rockchip/common/device.mk b/device/rockchip/common/device.mk
index be2cb2c..69034a7 100755
--- a/device/rockchip/common/device.mk
+++ b/device/rockchip/common/device.mk
@@ - 699 , 7 + 699 , 7 @@ endif
ifeq ($(strip $(BOARD_HAVE_DONGLE)), true )
ifeq ($(strip $(TARGET_ARCH)), arm64)
PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/system/lib64/libril-rk29-dataonly.so
+ rild.libpath=/system/lib64/libreference-ril.so
else
PRODUCT_PROPERTY_OVERRIDES += \
rild.libpath=/system/lib/libril-rk29-dataonly.so
因為 rk3399 是 64 位 CPU ,所以 ifeq ($(strip $(TARGET_ARCH)), arm64) 條件成立。
但是前提都是 BOARD_HAVE_DONGLE 變數值為 true
注:本人測試,修改下面兩個檔案中的 rild.libpath 不起作用
device/rockchip/rk3399/system.prop
device/rockchip/rk3399/rk3399_all/system.prop
5 、編譯時將 so 庫複製到上面指定目錄 /system/lib64/libreference-ril.so
diff --git a/vendor/rockchip/common/phone/phone.mk b/vendor/rockchip/common/phone/phone.mk
index 946aacd..f8fc6e7 100755
--- a/vendor/rockchip/common/phone/phone.mk
+++ b/vendor/rockchip/common/phone/phone.mk
@@ - 8 , 7 + 8 , 8 @@ PRODUCT_COPY_FILES += \
$(CUR_PATH)/phone/etc/ppp/ip-down:system/etc/ppp/ip-down \
$(CUR_PATH)/phone/etc/ppp/ip-up:system/etc/ppp/ip-up \
$(CUR_PATH)/phone/etc/ppp/call-pppd:system/etc/ppp/call-pppd \
- $(CUR_PATH)/phone/etc/operator_table:system/etc/operator_table
+ $(CUR_PATH)/phone/etc/operator_table:system/etc/operator_table \
+ $(CUR_PATH)/phone/lib/libreference-ril.so:system/lib64/libreference-ril.so
ifeq ($(strip $(PRODUCT_MODEM)), DTS4108C)
PRODUCT_COPY_FILES += \
6 、設定 BOARD_HAVE_DONGLE 變數
diff --git a/device/rockchip/rk3399/rk3399_all.mk b/device/rockchip/rk3399/rk3399_all.mk
index 7a2d870..ce5060c 100755
--- a/device/rockchip/rk3399/rk3399_all.mk
+++ b/device/rockchip/rk3399/rk3399_all.mk
@@ - 63 , 7 + 63 , 7 @@ BOARD_NFC_SUPPORT := false
BOARD_HAS_GPS := false
# for 3G/4G modem dongle support
-BOARD_HAVE_DONGLE := false
+BOARD_HAVE_DONGLE := true
BOARD_GRAVITY_SENSOR_SUPPORT := true
此時移植完成,只要 so 庫沒問題,就可以正常上網。
如果 radio log 中列印如下資訊:
RIL_SAP_Init not defined or exported in /system/lib64/libril-rk29-dataonly.so
檢查 rild.libpath 的路徑和名稱是否正確。
No /proc/cmdline exception=java.io.FileNotFoundException: /proc/cmdline (Permission denied)
此報錯不影響聯網,可以忽略
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69948385/viewspace-2677005/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 移遠 EC20 模組(4G通訊模組)AT指令測試 TCP 通訊過程TCP
- [原創]移遠RM500U-CN模組驅動移植
- 如何使用cgdb + qemu除錯linux核心模組除錯Linux
- PHPSTROM遠端除錯PHP除錯
- Pycharm遠端除錯PyCharm除錯
- 除錯433M模組遇到的問題除錯
- AT開發FOTA遠端升級:Air780EP低功耗4G模組AI
- 【轉載】Linux核心除錯之使用模組引數Linux除錯
- Linux核心模組驅動載入與dmesg除錯Linux除錯
- 操作方法分享:4G模組中移OneNET輕鬆上雲平臺
- IDEA、ECLIPSE遠端除錯IdeaEclipse除錯
- 4G模組軟體指南 | 必讀篇之模組資訊(hmeta)
- VS - 打斷點/本地除錯/遠端除錯 問題斷點除錯
- 本地除錯遠端服務除錯
- 使用IDEA遠端debug除錯Idea除錯
- debug技巧之遠端除錯除錯
- vscode遠端除錯c++VSCode除錯C++
- Dapr 遠端除錯之 Nocalhost除錯
- pycharm 遠端除錯之二PyCharm除錯
- Xdebug+PhpStorm 遠端除錯PHPORM除錯
- 低功耗4G模組:MQTT通訊功能MQQT
- 低功耗4G模組:LCD應用示例
- 低功耗4G模組Air780E快速入門:韌體的遠端升級AI
- Profinet遠端IO模組:模擬量模組_軟體組態說明
- 移動端網頁除錯網頁除錯
- 使用IDEA進行遠端除錯Idea除錯
- 使用Xdebug進行遠端除錯除錯
- WebStorm遠端除錯Node.jsWebORM除錯Node.js
- Homestead+PhpStorm+Xdebug 遠端除錯PHPORM除錯
- vs搭建遠端除錯環境除錯
- phpstorm 遠端除錯 homstead 程式碼PHPORM除錯
- 使用 Tag Assistant 除錯 SAP 電商雲 Spartacus UI 的 TMS 模組除錯UI
- PLC遠端程式設計除錯(包括工藝組態)如何快速實現?程式設計除錯
- 前端開發移動端除錯前端除錯
- 移動端除錯方法彙總除錯
- 移動端除錯方法補充除錯
- 如何挑選海外4G模組?這裡有秘籍!
- 4G模組軟體的ADC示例 | 智慧演繹