RK3288 4G模块移植简述

SoC:RK3288
4G chip:EC20
Platform:Android 5.1

厂家已经提供了相应的文档,这里也只是记录下流程.4G模块调试基本上分为三部分:
驱动、RIL、android配置文件

一 驱动配置

1.1 选择 USB Driver Configure
Device Drivers  --->
	[*] USB support  --->
	        <*> USB Serial Converter support
		          [*] USB Generic Serail Driver
		          [*] USB Driver for GSM and CMDA modems
1.2 add EC20 's Vendor ID and Product ID

add EC20 's Vendor ID and Product ID in option_ids[] of drivers/usb/serial/option.c

USB_DEVICE(0x05c6, 0x9215);
1.3 USB Driver Configure
Device Drivers  --->
      [*] USB support  --->
	        <*> USB Modem (CDC ACM) suppor
1.4 PPP Configure
Device Drivers  --->
      [*] Network device support  --->
	        <*> PPP (point-to-point protocol) support
	        <*> PPP support for async serial ports
	        <*> PPP support for sync tty ports
	        <*> PPP Deflate compression

二 RIL库

RIL库由厂家提供,将该拨号库拷贝到/system/lib/目录下,若厂家提供了ril源码,可将其拷贝到hardware/ril/reference-ril下。

注:需要使用RIL库来配置build.prop

三 配置

修改init.rc的内容,添加以下:

service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so
    class main
    socket rild stream 660 root radio 
    socket rild-debug stream 666 radio system 
    user root 
    group radio cache inet misc audio sdcard_rw log

修改hardware/ril/rild/rild.c中:

OpenLib:
    #endif
      //switchUser();这里的switchUser()是必须要注释掉的,否则无法正常拨号上网

然后重新编译android。(init.rc的修改需要在device/rockchip/rk3288/init.rc中修改,否则重新编译可能又被rockchip的配置所覆盖)。

按照文档做完上述工作后,发现4G依然不能用,通过adb shell中输入以下命令:

logcat -b radio
//出现以下错误提示
D/RIL_RK_DATA_V3.5(  169): Found a device, get id
D/use-Rlog/RLOG-RIL_RK_DATA_V3.5(  169): device path: /sys/devices/ff540000.usb/usb3/3-1/3-1.4/3-1.4:1.0/ttyUSB0/tty/ttyUSB0
D/RIL_RK_DATA_V3.5(  169): USB device path: /sys/devices/ff540000.usb/usb3/3-1/3-1.4
D/RIL_RK_DATA_V3.5(  169): TTY Device Vendor path: /sys/devices/ff540000.usb/usb3/3-1/3-1.4/idVendor
D/RIL_RK_DATA_V3.5(  169): TTY Device Product path: /sys/devices/ff540000.usb/usb3/3-1/3-1.4/idProduct
D/RIL_RK_DATA_V3.5(  169): tty Device id is: 05C6/9215
D/RIL_RK_DATA_V3.5(  169): Searching modem table...
D/use-Rlog/RLOG-RIL_RK_DATA_V3.5(  169): [matchModem]: match model count=0
E/use-Rlog/RLOG-RIL_RK_DATA_V3.5(  169): E: Not support modem!!!!

这是因为RK3288的Android 5.1 SDK提供了ril相关配置,各个厂家的不同,还需要更改其适配自己的4G模块。

例如厂家提供了rild库是libreference-ril.so,4G模块生成了/dev/ttyUSB0~4共5个串口,AT指令端口为/dev/ttyUSB0;而RK3288默认的配置为:

rild.libpath=/system/lib/libril-rk29-dataonly.so
rild.libargs=-d /dev/ttyACM0

因此将其修改为:

rild.libpath=/system/lib/libreference-ril.so
rild.libargs=-d /dev/ttyUSB0

源码中可在<android_source>/device/rockchip/rk3288/rk3288_box/system.prop中修改,以后每次编译就能正常使用了。

最后需要在init.rc中添加:

chmod 777 /dev/ttyUSB0  
chmod 777 /dev/ttyUSB1  
chmod 777 /dev/ttyUSB2  
chmod 777 /dev/ttyUSB3
chmod 777 /dev/ttyUSB4 

重新编译源码后烧录固件,亲测中国联通4G LTE能正常上网。

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Linux老A

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值