Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RK3399 4G module moving away from EC20 porting debugging

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

CPU: RK3399

System: Android 7.1

1. Get the pid and vid of the module through serial port printing or adb. By the way, you can see that 4 virtual serial ports / dev/ttyUSB* are generated.

[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: 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. Add the pid and vid of the module to the code. The original code already contains several modules that have been moved away, imitating the existing add 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. Add the so library of the module, which needs to be provided remotely. To match the systems supported by so, copy the so library to the following path.

Vendor/rockchip/common/phone/lib/libreference-ril.so

4. Open the device/rockchip/common/device.mk file and change the rild.libpath path to 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

Because rk3399 is a 64-bit CPU, the ifeq ($(strip $(TARGET_ARCH)), arm64) condition holds.

But only if the value of the BOARD_HAVE_DONGLE variable is true.

Note: I test that modifying the rild.libpath in the following two files does not work.

Device/rockchip/rk3399/system.prop

Device/rockchip/rk3399/rk3399_all/system.prop

5. Copy the so library to the directory / system/lib64/libreference-ril.so specified above at compile time

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. Set the BOARD_HAVE_DONGLE variable

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

At this time, the migration is completed, as long as there is no problem with the so library, you can access the Internet normally.

If the following information is printed in radio log:

RIL_SAP_Init not defined or exported in / system/lib64/libril-rk29-dataonly.so

Check that the path and name of the rild.libpath are correct.

No / proc/cmdline exception=java.io.FileNotFoundException: / proc/cmdline (Permission denied)

This error does not affect networking and can be ignored

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report