I.MX6 Android U-blox miniPCI 4G porting

/**************************************************************************
 *                I.MX6 Android U-blox miniPCI 4G porting
 * 声明:
 *     在移植U-blox的4G模块的过程中遇到了不少的问题,有不少是自己的这边疏忽
 * 的问题,无论怎么说,问题解决了就行。
 *
 *                                       2015-1-11 深圳 南山平山村 曾剑锋
 *************************************************************************/

一、参考文档:
    1. 飞思卡尔i.MX 6Quad Android 4.0.4的3G驱动移植
        http://blog.csdn.net/xnwyd/article/details/9498235
    2. 关于 android RIL 调试
        http://blog.lytsing.org/archives/476.html

二、ublox设备miniPCI识别到的设备节点:
    1. 只有一个: /dev/ttyACM0.
    2. 原因如下:
        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.
            1. AT+UUSBCONF=0,””,0
            // It need reboot the module.
            2. AT+CFUN=16
            // this command will reboot the module, or you can reboot device instead of.
            3. AT+UUSBCONF?
        For more detail description, please check attach file(AT-CommandExample), chapter 22 USB profile configuration. 

三、重新配置ublox:
    1. 参考《AT Commands Examples Examples for u-blox cellular modules Application Note》;
    2. chapter 22 USB profile configuration: Fairly back-compatible profile
        This is the configuration (<id>=0) similar to the one implemented in the u-blox LISA-U series. The interfaces available are:
            1. 3 CDC-ACM for AT command and data
            2. 1 CDC-ACM for GNSS tunnelling
            3. 1 CDC-ACM for SIM Access profile (SAP)
            4. 1 CDC-ACM for diagnostic
        This configuration is identified by:
            VID = 0x1546
            PID = 0x1141
        省略后面的命令说明...
    3. 使用串口工具,对ublox进行配置,我使用的是自己之前写的命令行的串口工具,参考:《I.MX6 Android Linux UART send receive with multi-thread and multi-mode demo》
        [email protected]:/data/local # ./autorun.sh
        serialString : /dev/ttyACM0.
        baudRate 9600.
        workMode: send and recv.
        AT+UUSBCONF=0,"",0

        OK

    4. dmesg信息提示如下:
        ......
        usb 2-1.4: new high speed USB device number 3 using fsl-ehci
        imx-ipuv3 imx-ipuv3.0: IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)
        cdc_acm 2-1.4:1.0: This device cannot do calls on its own. It is not a modem.
        cdc_acm 2-1.4:1.0: ttyACM0: USB ACM device
        cdc_acm 2-1.4:1.2: This device cannot do calls on its own. It is not a modem.
        cdc_acm 2-1.4:1.2: ttyACM1: USB ACM device
        cdc_acm 2-1.4:1.4: This device cannot do calls on its own. It is not a modem.
        cdc_acm 2-1.4:1.4: ttyACM2: USB ACM device
        cdc_acm 2-1.4:1.6: This device cannot do calls on its own. It is not a modem.
        cdc_acm 2-1.4:1.6: ttyACM3: USB ACM device
        cdc_acm 2-1.4:1.8: This device cannot do calls on its own. It is not a modem.
        cdc_acm 2-1.4:1.8: ttyACM4: USB ACM device
        cdc_acm 2-1.4:1.10: This device cannot do calls on its own. It is not a modem.
        cdc_acm 2-1.4:1.10: ttyACM5: USB ACM device
        ......
    5. 厂家的FAE说上面的错误可以不用关心
        This device cannot do calls on its own. It is not a modem.

四、配置Android系统:
    1. 参考文档:《Android RIL Production delivery – Source code Application Note》
    2. 参考章节: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:
    1. Error1:
        1. 出错信息:
            init: cannot execve(‘/system/bin/uril-repo.sh‘): No such file or directory
        2. 查看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 0770 /data/uril^M
                    cat /etc/uril/repository.txt > $URIL_REPO_DST^M
                    chmod 0660 $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 1/25 4%
        3. 通过查看文件,发现其中的每行最后都多出了^M这个字符,貌似这个文件是在Windows上面编辑的。
        4. 删除这些^M。
        5. 但是这个字符在Ubuntu、Vim中都看不到,这貌似有点奇怪。
        6. 有点忧伤的地方在于U-Blox提供的etc下的配置文件都是这种文件,他们提供错了文档。
    2. Error2:
        1. adb logcat -v time -b radio > logcat_info.txt
        2. 错误信息:
            01-01 00:00:05.570 I/RIL     ( 2286): 3G modem monitor thread is start

            01-01 00:00:05.570 E/RILD    ( 2286): dlopen failed: Cannot load library: load_library(linker.cpp:745): library "/system/lib/libhuawei-ril.so" not found

            01-01 00:00:05.620 I/RIL-repo( 2348): created /data/uril/repository.txt 

            01-01 00:00:10.100 E/RILD    ( 2604): dlopen failed: Cannot load library: load_library(linker.cpp:745): library "/system/lib/libhuawei-ril.so" not found

            ......
        3. 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;
                }
                ......
            }
        4. 修改REFERENCE_RIL_DEF_PATH的值为:
            "/system/lib/librapid-ril-core.so"
        5. 根据rild.c中代码的运行流程可知,命令行中的-l参数是无效。
    3. 能够获取GSM信号,但获取网络数据:
        1. 模块问题检查:
            [email protected]:/data/local # ./autorun.sh
            CMD: AT+UUSBCONF?.

            +UUSBCONF: 3,"RNDIS",,"0x1146"

            OK
            CMD: AT+UUSBCONF=0,"",0.

            OK
            CMD: AT+CFUN=16.
            usb 2-1.4: USB disconnect, device number 32
            usb 2-1.4: new high speed USB device number 33 using fsl-ehci
            usb 2-1.4: USB disconnect, device number 33
            usb 2-1.4: new high speed USB device number 34 using fsl-ehci
            cdc_acm 2-1.4:1.0: This device cannot do calls on its own. It is not a modem.
            cdc_acm 2-1.4:1.0: ttyACM0: USB ACM device
            cdc_acm 2-1.4:1.2: This device cannot do calls on its own. It is not a modem.
            cdc_acm 2-1.4:1.2: ttyACM1: USB ACM device
            cdc_acm 2-1.4:1.4: This device cannot do calls on its own. It is not a modem.
            cdc_acm 2-1.4:1.4: ttyACM2: USB ACM device
            cdc_acm 2-1.4:1.6: This device cannot do calls on its own. It is not a modem.
            cdc_acm 2-1.4:1.6: ttyACM3: USB ACM device
            cdc_acm 2-1.4:1.8: This device cannot do calls on its own. It is not a modem.
            cdc_acm 2-1.4:1.8: ttyACM4: USB ACM device
            cdc_acm 2-1.4:1.10: This device cannot do calls on its own. It is not a modem.
            cdc_acm 2-1.4:1.10: ttyACM5: USB ACM device
            CMD: AT+UUSBCONF?.

            +UUSBCONF: 0,"",,"0x1141"

            OK
            usb 2-1.4: USB disconnect, device number 34
            usb 2-1.4: new high speed USB device number 35 using fsl-ehci
            usb 2-1.4: USB disconnect, device number 35
            usb 2-1.4: new high speed USB device number 36 using fsl-ehci
            cdc_acm 2-1.4:1.2: This device cannot do calls on its own. It is not a modem.
            cdc_acm 2-1.4:1.2: ttyACM0: USB ACM device
            CMD: AT+UUSBCONF?.
            AT+UUSBCONF?
            +UUSBCONF: 3,"RNDIS",,"0x1146"

            OK

            ATE0V1
            OK
        2. 从1中可以看出:
            将模块设置为Fairly back-compatible模式的时候,移植的系统又会自动将模块
            重置为High throughput模式,无法稳定工作在Fairly back-compatible模式。
        3. 原因是 "hardware/ril/ublox_ril/CORE/ND/systemmanager.cpp” 的 1729 行.
        4. 解决办法:
            1. 参考《AndroidRIL-SourceCode_AppNote.pdf》中"章节 I, Repository file configuration".
            2. cat build/target/product/rootdir/etc/uril/repository.txt
                ......
                // Modem settings
                Group Modem
                    SupportedModem              UbloxModem
                    //NetworkInterfaceName        USB     // 修改为ppp
                    NetworkInterfaceName        ppp
                    DisableModemReset           0
                ......
                // USB Profile Configuration
                Group USBUBM
                    // 将RNDIS模式修改为CDC-ACM模式
                    // USBCONF                     3    // 0: CDC-ACM, 2: CDC-ECM, 3: RNDIS
                    USBCONF                     0    // 0: CDC-ACM, 2: CDC-ECM, 3: RNDIS
                    UBMCONF            1    // 1: Router,  2: Bridge
                ......
时间: 2024-10-12 16:17:44

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

I.MX6 android BatteryService jni hacking

/**************************************************************************** * I.MX6 android BatteryService jni hacking * 声明: * 本文主要是为了知道Android的获取的电源管理的数据的jni是从Linux系统的 * 什么位置获取的,获取的机制是什么. * * 2016-2-22 深圳 南山平山村 曾剑锋 ********************************

I.MX6 android 4.2 源码下载

/************************************************************************* * I.MX6 android 4.2 源码下载 * 说明: * NXP官网已经不提供4.2版本的源码下载了,目前这个地方还能下载. * * 2016-8-24 深圳 南山平山村 曾剑锋 ************************************************************************/ 一.参考文档:

I.MX6 Android CAN 命令行测试

/********************************************************************* * I.MX6 Android CAN 命令行测试 * 说明: * 这里使用can-utils测试一下CAN驱动. * * 2016-8-9 深圳 南山平山村 曾剑锋 ********************************************************************/ 一.shell 命令流程: 1. netcfg c

I.MX6 Android shutdown shell command

/******************************************************************************* * I.MX6 Android shutdown shell command * 说明: * 想在I.MX6上执行shell关机命令,不过效果貌似不是很好,开关键多按两下又亮了. * * 2016-7-25 深圳 南山平山村 曾剑锋 ****************************************************

I.MX6 Android netperf

/***************************************************************************** * I.MX6 Android netperf * 说明: * 之前移植iperf3网络测试工具不成功,本来想再移植一个iperf2来试一下,但是 * 在检查Android源码系统的时候不小心看到netperf文件夹,查了点资料,貌似可以实 * 现iperf的功能,于是又省了点事. * * 2016-4-18 深圳 南山平山村 曾剑锋 **

I.MX6 Android can-utils 移植

/******************************************************************* * I.MX6 Android can-utils 移植 * 说明: * 由于最近要用到CAN,于是先移植一下can-tuils来看一下情况. * * 2016-8-1 深圳 南山平山村 曾剑锋 ******************************************************************/ 一.获取源码: https:/

I.MX6 Android 设备节点权限

/********************************************************************************** * I.MX6 Android 设备节点权限 * 说明: * Android 是使用ueventd来创建设备节点的,会解析ueventd.rc和ueventd.xxx.rc两个 * 文件中对设备节点权限设定来设定权限. * * 2017-4-30 深圳 龙华民治樟坑村 曾剑锋 ***************************

I.MX6 Android busybox 从哪里生成的

/**************************************************************************** * I.MX6 Android busybox 从哪里生成的 * 说明: * 一直在Android中找busybox的源代码在哪里,在external文件夹下有一份busybox * 源代码,但是没有Android.mk,以为应该是将Android.mk文件放在了别的地方,结果 * 找出来是别的地方放了一份编译好的busybox可执行文件.

I.MX6 Android 5.1.1 下载、编译

/************************************************************************* * I.MX6 Android 5.1.1 下载.编译 * 说明: * 这里要提到的就是4.2版本,编译中断了,你接着编好像是没事的,但是这个 * 5.1.1版本貌似就得从头再编,这个有点郁闷. * * 2016-9-9 深圳 南山平山村 曾剑锋 ***************************************************