此文档基于ubuntu14.04 内核4.4.0.148

使用ADB

# Command basic format:
sudo adb push <local path> <module path>
sudo adb pull <module path> <local path>
# for example:
adb push ~/ql-ol-sdk/ql-ol-extsdk/example/helloWorld/hellolworld /usrdata
adb pull /home/test/file .

1. 安装必备软件

安装ADB和ADBD

sudo apt-get update
sudo apt-get install android-tools-adb android-tools-adbd

若安装失败,使用以下命令

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-adbd

成功后使用 adb version命令出现如下提示

2. 连接

若使用虚拟机,则将USB设备映射至虚拟机内,后使用lsusb查看usb设备,若不确定哪个是,可拔除设备后使用lsusb命令,再插入设备后使用lsusb命令查看异同,如图

  • 插入设备前

  • 插入设备后

可看出增加一个设备,且ID号为0x2c7c

则使用如下命令,将设备ID写入配置文件

echo 0x2c7c > ~/.android/adb_usb.ini

3. 列出ADB并链接

sudo adb kill-server
sudo adb devices        #列出设备
  • 若成功链接则可使用adb shell连接设备,如图
  • 若不成功,如图,设备为空,则可能是linux驱动不正确,参考4

4. 设备空

重新安装linux设备驱动,使用uname -r查看对应linux内核版本,下载对应版本linux源码

获取linux_kernel

sudo wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.148.tar.xz
sudo xz -d linux-4.4.148.tar.xz     # 解压
sudo tar -xvf linux-4.4.148.tar
cd linux-4.4.148                    #进入到目录linux-4.4.148

4.1 修改内核文件

4.1.1 Add VID and PID

打开[KERNEL]/drivers/usb/serial/option.c 文件

static const struct usb_device_id option_ids[] =
{
#if 1 //Added by Quectel{ USB_DEVICE(0x05C6, 0x9090) }, /* Quectel UC15 */{ USB_DEVICE(0x05C6, 0x9003) }, /* Quectel UC20 */{ USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC25 */{ USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */{ USB_DEVICE(0x05C6, 0x9215) }, /* Quectel EC20 */{ USB_DEVICE(0x2C7C, 0x0191) }, /* Quectel EG91 */{ USB_DEVICE(0x2C7C, 0x0195) }, /* Quectel EG95 */{ USB_DEVICE(0x2C7C, 0x0306) }, /* Quectel EG06/EP06/EM06 */{ USB_DEVICE(0x2C7C, 0x0512) }, /* Quectel EG12/EP12/EM12/EG16/EG18 */{ USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG96 */{ USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */
#endif
}

如果你的芯片是 EC20 还要删除这几个冲突的东西

// File: [KERNEL]/drivers/usb/serial/qcserial.c
{USB_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
// File: [KERNEL]/drivers/net/usb/qmi_wwan.c
{QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */

4.1.2 添加零包处理机制

File: [KERNEL]/drivers/usb/serial/usb_wwan.c 中添加如下

static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint,
int dir, void *ctx, char *buf, int len,void (*callback) (struct urb *))
{
//……usb_fill_bulk_urb(urb, serial->dev,usb_sndbulkpipe(serial->dev, endpoint) | dir,buf, len, callback, ctx);
#if 1 //Added by Quectel for zero packetif (dir == USB_DIR_OUT){struct usb_device_descriptor *desc = &serial->dev->descriptor;if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9090))urb->transfer_flags |= URB_ZERO_PACKET;if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9003))urb->transfer_flags |= URB_ZERO_PACKET;if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9215))urb->transfer_flags |= URB_ZERO_PACKET;if (desc->idVendor == cpu_to_le16(0x2C7C))urb->transfer_flags |= URB_ZERO_PACKET;}
#endifreturn urb;
}

4.1.3 睡眠重启

File: [KERNEL]/drivers/usb/serial/option.c

static struct usb_serial_driver option_1port_device =
{//……#ifdef CONFIG_PM.suspend = usb_wwan_suspend,.resume = usb_wwan_resume,
#if 1 //Added by Quectel.reset_resume = usb_wwan_resume,#endif
#endif
};

4.1.4 使用 GobiNet 拨号

还要配置这个File: [KERNEL]/drivers/usb/serial/option.c

static int option_probe(struct usb_serial *serial, const struct usb_device_id *id)
{struct usb_wwan_intf_private *data;//......
#if 1 //Added by Quectel//Quectel UC20's interface 4 can be used as USB Network deviceif (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6)&& serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)&& serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)return -ENODEV;//Quectel EC20's interface 4 can be used as USB Network deviceif (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6)&& serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)&& serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)return -ENODEV;//Quectel EC25&EC21&EC20 R2.0&EG91&EG95&EG06&EP06&EM06&BG96's interface 4 can be used as USB Network deviceif (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)&& serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)return -ENODEV;
#endif/* Store device id so we can use it during attach. */usb_set_serial_data(serial, (void *)id);return 0;
}

4.2 修改内核配置

  1. 进入内核根目录

  2. 设置环境变量,并导入defconfig。

    export ARCH=arm
    export CROSS_COMPILE=arm-none-linux-gnueabi-
    /* 进入arch/arm/configs目录查看有的配置,挑选一个 */
    make bcm_defconfig
    
  3. 编译内核,并使能CONFIG_USB_SERIAL_OPTION

    make menuconfig
    [*] Device Drivers →[*] USB Support →[*] USB Serial Converter support →[*] USB driver for GSM and CDMA modems
    

5. 构建和装载作为给PClinux内核模块的驱动

  1. 进入内核目录

  2. 构建驱动模块

    sudo make -C /lib/modules/`uname -r`/build M=`pwd`/drivers/usb/serial obj-m=option.o modules
    sudo make -C /lib/modules/`uname -r`/build M=`pwd`/drivers/usb/serial obj-m=usb_wwan.o
    modules
    sudo make -C /lib/modules/`uname -r`/build M=`pwd`/drivers/usb/serial obj-m=qcserial.o modules
    
  3. 装载驱动并重启

    sudo cp drivers/usb/serial/option.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial
    sudo cp drivers/usb/serial/usb_wwan.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial
    sudo cp drivers/usb/serial/qcserial.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial
    sudo depmod
    sudo reboot
    

以上步骤执行后从步骤2执行即可使用

安装EC20调试环境相关推荐

  1. 计算机网络环境及应用系统的安装与调试(Computer network environment and application system installation and debugging)

    计算机网络环境及应用系统的安装与调试(Computer network environment and application system installation and debugging) W ...

  2. cmake 安装_vscode不写一行配置,用cmake傻瓜式搭建C++编译调试环境

    网上看了一些用vscode+cmake搭建C++编译调试环境的帖子,基本差不多,都要写一个配置文件.其实根本不用这么麻烦.安装的工具是一样的,但是操作可以更加简单. VSCode + CMake超简单 ...

  3. vs安装 c语言编译环境,Visual Studio Code安装与C/C++开发调试环境搭建

    目录 简介 VSCode安装 VSCode语言设置 安装开发套件 构建C/C++编译环境 安装Clang 安装MinGW VSCode工程配置 launch.json tasks.json 测试 简介 ...

  4. SUSE Linux Enterprise Server 安装内核源码及部署crash调试环境,分析内核崩溃文件(基于sles 15.2)

    实验环境: yg-net-static:~ # uname -a Linux yg-net-static 5.3.18-22-default #1 SMP Wed Jun 3 12:16:43 UTC ...

  5. windows环境下 VSCode的安装和调试

    作者 @kaka VSCode的安装和调试 1. 下载安装包 去官网下载安装包直接安装,安装包下载地址 安装就是傻瓜式安装,有选项的就全选. 2. 下载配置编译器 因为VSCode只是一个功能强大的记 ...

  6. Windbg双机调试环境配置(Windows7/Windows XP+VirtualBox/VMware+WDK7600)

    简介:Windbg双机调试内核.驱动 下载软件: 下载Windbg(GRMWDK_EN_7600_1.ISO) 下载VirtualBox 5.2/VMware 12 一.安装WDK,这里要提一点的是D ...

  7. “笨方法”学习Python笔记(2)-VS Code作为文本编辑器以及配置Python调试环境

    Visual Studio Code 免费跨平台文本编辑器,插件资源丰富,我把其作为Debug的首选. 下载地址:https://code.visualstudio.com/Download 安装之后 ...

  8. Android Studio安装配置、环境搭建详细步骤及基本使用

    前言 Android Studio的安装配置及使用篇终于来啦~ 废话不多说,以下针对JDK正确安装(及其环境变量配置完毕,即Java开发环境下).Android Studio的安装,配置,以及创建工程 ...

  9. PHP开发调试环境配置(基于wampserver+Eclipse for PHP Developers )

    因为项目需求,需要开发PHP的项目,所以不得不花点时间开始学习PHP,过程非常要抓狂,还没有开始开发已经被一大堆复杂的环境搭建搞疯了 经过多方实验,决定将过程记录下来,也为了让很多跟我一样从零开始学习 ...

最新文章

  1. 怎样在Spark、Flink应用中使用Protobuf 3的包
  2. Python基础第27天
  3. MATLAB应用实战系列(五十二)-Excel数据的读取
  4. 一个Demo让你掌握Android所有控件
  5. Matlab 常用语法速记 1
  6. 【2019.09.14】2019icpc沈阳网络赛
  7. 0712 - 坚守,加强老本
  8. 转载:机器人工程师学习计划(YY硕)
  9. Avaya Aura™ 独家观察报告
  10. 0《数学之美》作者、赞誉、说明、序言、前言
  11. Qt 使用QMovie加载gif图片实现动态等待窗口
  12. 前端 Switch 开关功能
  13. 命令行基础技巧挂载并访问光盘设备
  14. ORACLE 10g 64位下载地址
  15. centos7 安装Google Chrome浏览器
  16. 编译原理学习笔记(十五)~最小化DFA
  17. 人工湖对环境温度的调节问题
  18. 俺是郭德纲先生的忠实非现场 听众+观众
  19. 光场相机重聚焦原理介绍及代码解析
  20. Docker-CE 监控

热门文章

  1. matlab方差协方差矩阵,Matlab协方差矩阵的计算原理
  2. 最新s1 ROM下载汇总
  3. 药品药店管理系统c语言设计,java毕业设计_springboot框架的药店药品货架管理系统...
  4. Navicat for Mysql数据导入时报错1366 - Incorrect string value: ‘\xE7\x90\xAD‘ for column ‘xx‘ at row xx
  5. 大数据数据仓库建设方案
  6. 两个软件,让你对主机内显卡的信息和性能有一个更深刻的认识
  7. 问答系统一些综述性质的文章
  8. go 写入yaml_golang使用yaml格式解析构建配置文件
  9. Wiegand(韦根)--26bit数据格式
  10. 小说网站用西部服务器,小说网站用什么虚拟主机