/**************************************************************************
* I.MX6 Android U-blox miniPCI 4G porting
* 声明:
* 在移植U-blox的4G模块的过程中遇到了不少的问题,有不少是自己的这边疏忽
* 的问题,无论怎么说,问题解决了就行。
*
* 2016-1-11 深圳 南山平山村 曾剑锋
*************************************************************************/ 一、参考文档:
. 飞思卡尔i.MX 6Quad Android 4.0.4的3G驱动移植
http://blog.csdn.net/xnwyd/article/details/9498235
. 关于 android RIL 调试
http://blog.lytsing.org/archives/476.html 二、ublox设备miniPCI识别到的设备节点:
. 只有一个: /dev/ttyACM0.
. 原因如下:
the USB mode of MPCI-L210 module in "RNDIS" mode, so it will only create one and only one ttyACM0 node. If you need to use ttyACM0, ttyACM1 and ttyACM2. please execute following command:
// Set USB configuration to "fairly back-compatible" and disable the audio over USB.
. AT+UUSBCONF=,””,
// It need reboot the module.
. AT+CFUN=
// this command will reboot the module, or you can reboot device instead of.
. AT+UUSBCONF?
For more detail description, please check attach file(AT-CommandExample), chapter USB profile configuration. 三、重新配置ublox:
. 参考《AT Commands Examples Examples for u-blox cellular modules Application Note》;
. chapter USB profile configuration: Fairly back-compatible profile
This is the configuration (<id>=) similar to the one implemented in the u-blox LISA-U series. The interfaces available are:
. CDC-ACM for AT command and data
. CDC-ACM for GNSS tunnelling
. CDC-ACM for SIM Access profile (SAP)
. CDC-ACM for diagnostic
This configuration is identified by:
VID = 0x1546
PID = 0x1141
省略后面的命令说明...
. 使用串口工具,对ublox进行配置,我使用的是自己之前写的命令行的串口工具,参考:《I.MX6 Android Linux UART send receive with multi-thread and multi-mode demo》
root@android:/data/local # ./autorun.sh
serialString : /dev/ttyACM0.
baudRate .
workMode: send and recv.
AT+UUSBCONF=,"", OK . dmesg信息提示如下:
......
usb -1.4: new high speed USB device number using fsl-ehci
imx-ipuv3 imx-ipuv3.: IPU DMFC DP HIGH RESOLUTION: (,), 5B(~), 5F(,)
cdc_acm -1.4:1.0: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.0: ttyACM0: USB ACM device
cdc_acm -1.4:1.2: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.2: ttyACM1: USB ACM device
cdc_acm -1.4:1.4: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.4: ttyACM2: USB ACM device
cdc_acm -1.4:1.6: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.6: ttyACM3: USB ACM device
cdc_acm -1.4:1.8: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.8: ttyACM4: USB ACM device
cdc_acm -1.4:1.10: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.10: ttyACM5: USB ACM device
......
. 厂家的FAE说上面的错误可以不用关心
This device cannot do calls on its own. It is not a modem. 四、配置Android系统:
. 参考文档:《Android RIL Production delivery – Source code Application Note》
. 参考章节:Appendix - D Android 4.1/ 4.2 / 4.3 / 4.4 module configuration
To enable the USB module connection, configure Ueventd.[platform].rc, AndroidProducts.mk and init.rc files as described in sections below. Before changing the files, below are some necessary steps to follow. 五、Error:
. Error1:
. 出错信息:
init: cannot execve('/system/bin/uril-repo.sh'): No such file or directory
. 查看uril-repo.sh文件:busybox vi uril-repo.sh
#!/system/bin/sh^M
^M
URIL_REPO_DST=/data/uril/repository.txt^M
^M
rril_repo_missing=`ls $URIL_REPO_DST`true^M
^M
if (${rril_repo_missing}) ; then^M
mkdir /data/uril^M
chmod /data/uril^M
cat /etc/uril/repository.txt > $URIL_REPO_DST^M
chmod $URIL_REPO_DST^M
sync^M
/system/bin/log -t RIL-repo "created $URIL_REPO_DST"^M
else^M
/system/bin/log -t RIL-repo "$URIL_REPO_DST exists"^M
fi^M
^M
# set this property after checking that repository exists or after it's created^
# This is checked in rildmain mainloop during RIL_Init^M
/system/bin/setprop "net.uril.repository" "ready"^M
^M
# set this property to configure emergency number if required^M
#/system/bin/setprop "ril.ecclist" "111,112,113,115,117,118,119,122,125,127,911,
- uril-repo.sh / %
. 通过查看文件,发现其中的每行最后都多出了^M这个字符,貌似这个文件是在Windows上面编辑的。
. 删除这些^M。
. 但是这个字符在Ubuntu、Vim中都看不到,这貌似有点奇怪。
. 有点忧伤的地方在于U-Blox提供的etc下的配置文件都是这种文件,他们提供错了文档。
. Error2:
. adb logcat -v time -b radio > logcat_info.txt
. 错误信息:
- ::05.570 I/RIL ( ): 3G modem monitor thread is start - ::05.570 E/RILD ( ): dlopen failed: Cannot load library: load_library(linker.cpp:): library "/system/lib/libhuawei-ril.so" not found - ::05.620 I/RIL-repo( ): created /data/uril/repository.txt - ::10.100 E/RILD ( ): dlopen failed: Cannot load library: load_library(linker.cpp:): library "/system/lib/libhuawei-ril.so" not found ......
. cat hardware/ril/rild/rild.c
......
// #define REFERENCE_RIL_DEF_PATH "/system/lib/libhuawei-ril.so"
......
int main(int argc, char **argv)
{
......
switch (modem_type){
case ZTE_MODEM:
rilLibPath = REFERENCE_RIL_ZTE_PATH;
break; case HUAWEI_MODEM:
case AMAZON_MODEM:
default:
rilLibPath = REFERENCE_RIL_DEF_PATH;
break;
}
......
}
. 修改REFERENCE_RIL_DEF_PATH的值为:
"/system/lib/librapid-ril-core.so"
. 根据rild.c中代码的运行流程可知,命令行中的-l参数是无效。
. 能够获取GSM信号,但无法获取网络数据:
. 模块问题检查:
root@android:/data/local # ./autorun.sh
CMD: AT+UUSBCONF?. +UUSBCONF: ,"RNDIS",,"0x1146" OK
CMD: AT+UUSBCONF=,"",. OK
CMD: AT+CFUN=.
usb -1.4: USB disconnect, device number
usb -1.4: new high speed USB device number using fsl-ehci
usb -1.4: USB disconnect, device number
usb -1.4: new high speed USB device number using fsl-ehci
cdc_acm -1.4:1.0: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.0: ttyACM0: USB ACM device
cdc_acm -1.4:1.2: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.2: ttyACM1: USB ACM device
cdc_acm -1.4:1.4: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.4: ttyACM2: USB ACM device
cdc_acm -1.4:1.6: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.6: ttyACM3: USB ACM device
cdc_acm -1.4:1.8: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.8: ttyACM4: USB ACM device
cdc_acm -1.4:1.10: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.10: ttyACM5: USB ACM device
CMD: AT+UUSBCONF?. +UUSBCONF: ,"",,"0x1141" OK
usb -1.4: USB disconnect, device number
usb -1.4: new high speed USB device number using fsl-ehci
usb -1.4: USB disconnect, device number
usb -1.4: new high speed USB device number using fsl-ehci
cdc_acm -1.4:1.2: This device cannot do calls on its own. It is not a modem.
cdc_acm -1.4:1.2: ttyACM0: USB ACM device
CMD: AT+UUSBCONF?.
AT+UUSBCONF?
+UUSBCONF: ,"RNDIS",,"0x1146" OK ATE0V1
OK
. 从1中可以看出:
将模块设置为Fairly back-compatible模式的时候,移植的系统又会自动将模块
重置为High throughput模式,无法稳定工作在Fairly back-compatible模式。
. 原因是 "hardware/ril/ublox_ril/CORE/ND/systemmanager.cpp” 的 1729 行.
. 解决办法:
. 参考《AndroidRIL-SourceCode_AppNote.pdf》中"章节 I, Repository file configuration".
. cat build/target/product/rootdir/etc/uril/repository.txt
......
// Modem settings
Group Modem
SupportedModem UbloxModem
//NetworkInterfaceName USB // 修改为ppp
NetworkInterfaceName ppp
DisableModemReset
......
// USB Profile Configuration
Group USBUBM
// 将RNDIS模式修改为CDC-ACM模式
// USBCONF 3 // 0: CDC-ACM, 2: CDC-ECM, 3: RNDIS
USBCONF // 0: CDC-ACM, 2: CDC-ECM, 3: RNDIS
UBMCONF // 1: Router, 2: Bridge
......

I.MX6 Android U-blox miniPCI 4G porting的更多相关文章

  1. I.MX6 Android iperf3 porting failed

    /***************************************************************************** * I.MX6 Android iperf ...

  2. I.MX6 Android i2c-tools porting

    /************************************************************************** * I.MX6 Android i2c-tool ...

  3. I.MX6 Android 5.1 快速合成系统

    /**************************************************************************** * I.MX6 Android 5.1 快速 ...

  4. I.MX6 Android backlight modify by C demo

    /************************************************************************** * I.MX6 Android backligh ...

  5. I.MX6 Android netperf

    /***************************************************************************** * I.MX6 Android netpe ...

  6. I.MX6 android 设置 默认 动态桌面

    /************************************************************************ * I.MX6 android 设置 默认 动态桌面 ...

  7. I.MX6 android 获取framebuffer信息

    /******************************************************************************** * I.MX6 android 获取 ...

  8. I.MX6 Android Linux shell MMPF0100 i2c 设置数据

    #!/system/bin/busybox ash # # I.MX6 Android Linux shell MMPF0100 i2c 设置数据 # 说明: # 本文主要记录通过shell脚本来设置 ...

  9. I.MX6 Android Linux shell MMPF0100 i2c 获取数据

    #!/system/bin/busybox ash # # I.MX6 Android Linux shell MMPF0100 i2c 获取数据 # 说明: # 本文主要记录通过shell脚本来获取 ...

随机推荐

  1. POJ 3164 Command Network 最小树形图

    题目链接: 题目 Command Network Time Limit: 1000MS Memory Limit: 131072K 问题描述 After a long lasting war on w ...

  2. [转载]AFX_MANAGE_STATE关于资源切换

    应用程序进程本身及其调用的每个DLL模块都具有一个全局唯一的HINSTANCE句柄,它们代表了DLL或EXE模块在进程虚拟空间中的起始地址.进程本身的模块句柄一般为0x400000,而DLL模块的缺省 ...

  3. 如何通过css控制内容显示顺序 第二行的内容优先显示

    我们有时进行网页设计时为了想让用户感兴趣的内容优先显示在前,又不想改动代码的先后顺序,要怎么操作呢?(或者换种说法:源代码中要先看到A再看到B,而视觉上是先B再A)举个简单的例子,想让第二行的内容在不 ...

  4. hadoop+hbase

    hadoop的配置见下面这篇文章 http://www.powerxing.com/install-hadoop-2-4-1-single-node/ Hadoop安装教程_单机/伪分布式配置_Had ...

  5. Oracle调优总结(经典实践 重要)

    转载:http://langgufu.iteye.com/blog/1974211 Problem Description:1.每个表的结构及主键索引情况2.每个表的count(*)记录是多少3.对于 ...

  6. DJANGO变动库的一次真实手动经历

    在变更库时,由于对字段规划和约束性没考虑完全,需要手工操作数据库,以便可以重复执行. 有以下三点要注意. 1,先迎合错误输出,增删对应的表或字段. 2,必要时,修改migrations文件,以去除唯一 ...

  7. Java中LinkedList的remove方法真的耗时O(1)吗?

    这个问题其实来源于Leetcode的一道题目,也就是上一篇日志 LRU Cache.在使用LinkedList超时后,换成ArrayList居然AC了,而问题居然是在于List.remove(Obje ...

  8. Spring 注入static变量

    一般我们我想注入一个static的变量,如下: @Autowired    private static String str; 不过,这样最终结果为null. 1.使用配置文件的方式注入 priva ...

  9. lintcode 中等题:和大于S的最小子数组

    题目 和大于S的最小子数组 给定一个由 n 个整数组成的数组和一个正整数 s ,请找出该数组中满足其和 ≥ s 的最小长度子数组.如果无解,则返回 -1. 样例 给定数组 [2,3,1,2,4,3]  ...

  10. 欧拉工程第72题:Counting fractions

    题目链接:https://projecteuler.net/problem=72 真分数;n/d 当d ≤ 1,000,000时候的真分数有多少个 public class P72{ void run ...