我的开发板配置:
开发板硬件:IMX6Q
蓝牙模块: 基于MINI PCI-E接口的 ATHEROS AR5B225 300M无线+4.0蓝牙 二合一半高网卡模块(AR3K系列)
linux内核:3.14.52(主要是我的开发板自带内核带了很多工具,如果换底版本的内核的话,会比较麻烦,所以就是用了其自带核)
编译工具:arm-linux-gcc:4.9.2
我把所有的压缩包都放在了/opt/arm/下,我下面讲述的都是针对这个目录下。大家可以针对自己的喜好来选择目录

  1. 安装交叉编译工具arm-linux-gcc
    #tar xzvf arm-linux-gcc /usr/local          # export PATH=$PATH:/usr/local/arm/4.3.2/bin
  1. 解压编译配置内核

由于我使我开发板光盘自带的内核源码,所以不需要修改源码中的Makefile。如果是从网上下载的内核源码,在编译的时候需要修改Makefile,需要把蓝牙的部分配置加上去, 如下。

    #tar xzvf linux-3.14.52   #cd linux-14.52   #make menuconfig ARCH=armLinux/arm 3.14.52 Kernel Configuration[*] Networking support <*>   Bluetooth subsystem support --- Bluetooth subsystem support <*>   RFCOMM protocol support[*]     RFCOMM TTY support<*>   BNEP protocol support[*]     Multicast filter support[*]     Protocol filter support<*>   HIDP protocol supportBluetooth device drivers  ---> <*> HCI USB driver<*> HCI SDIO driver<*> HCI UART driver[*]   UART (H4) protocol support[*]   BCSP protocol support[*]   Atheros AR300x serial support[*]   HCILL protocol support[*]   Three-wire UART (H5) protocol support< > HCI BCM203x USB driver< > HCI BPA10x USB driver<*> HCI BlueFRITZ! USB driver< > HCI VHCI (Virtual HCI device) driver< > Marvell Bluetooth driver support<*> Atheros firmware download driver

然后就开始交叉编译内核。

    #make zImage
  1. 烧写内核,启动开发板,查看内核打印信息
 rtc-isl1208 0-006f: setting system clock to 2020-01-01 13:01:50 UTC (1577883710)
ALSA device list:#0: imx-hdmi-soc
Bluetooth: Patch file not found ar3k/AthrBT_0x01020200.dfu
Bluetooth: Loading patch file failed
ath3k: probe of 1-1.5:1.0 failed with error -2
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk3p2): using internal journal

进入系统命令行:

#lsusb
Bus 001 Device 005: ID 0489:e036 Foxconn / Hon Hai
Bus 001 Device 004: ID 0bda:8179 Realtek Semiconductor Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
#lsusb -v
Bus 001 Device 005: ID 0489:e036 Foxconn / Hon Hai
Device Descriptor:bLength                18bDescriptorType         1bcdUSB               1.10bDeviceClass          224 WirelessbDeviceSubClass         1 Radio FrequencybDeviceProtocol         1 BluetoothbMaxPacketSize0        64idVendor           0x0489 Foxconn / Hon HaiidProduct          0xe036 bcdDevice            0.02iManufacturer           1 Atheros CommunicationsiProduct                2 Bluetooth USB Host ControlleriSerial                 3 Alaska Day 2006bNumConfigurations      1Configuration Descriptor:bLength                 9bDescriptorType         2wTotalLength          177bNumInterfaces          2bConfigurationValue     1iConfiguration          4 BT HCIbmAttributes         0xe0Self PoweredRemote WakeupMaxPower              100mAInterface Descriptor:bLength                 9bDescriptorType         4bInterfaceNumber        0bAlternateSetting       0bNumEndpoints           3bInterfaceClass       224 WirelessbInterfaceSubClass      1 Radio FrequencybInterfaceProtocol      1 BluetoothiInterface              0 Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x81  EP 1 INbmAttributes            3Transfer Type            InterruptSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0010  1x 16 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x82  EP 2 INbmAttributes            2Transfer Type            BulkSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0040  1x 64 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x02  EP 2 OUTbmAttributes            2Transfer Type            BulkSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0040  1x 64 bytesbInterval               1Interface Descriptor:bLength                 9bDescriptorType         4bInterfaceNumber        1bAlternateSetting       0bNumEndpoints           2bInterfaceClass       224 WirelessbInterfaceSubClass      1 Radio FrequencybInterfaceProtocol      1 BluetoothiInterface              0 Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x83  EP 3 INbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0000  1x 0 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x03  EP 3 OUTbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0000  1x 0 bytesbInterval               1Interface Descriptor:bLength                 9bDescriptorType         4bInterfaceNumber        1bAlternateSetting       1bNumEndpoints           2bInterfaceClass       224 WirelessbInterfaceSubClass      1 Radio FrequencybInterfaceProtocol      1 BluetoothiInterface              0 Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x83  EP 3 INbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0009  1x 9 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x03  EP 3 OUTbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0009  1x 9 bytesbInterval               1Interface Descriptor:bLength                 9bDescriptorType         4bInterfaceNumber        1bAlternateSetting       2bNumEndpoints           2bInterfaceClass       224 WirelessbInterfaceSubClass      1 Radio FrequencybInterfaceProtocol      1 BluetoothiInterface              0 Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x83  EP 3 INbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0011  1x 17 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x03  EP 3 OUTbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0011  1x 17 bytesbInterval               1Interface Descriptor:bLength                 9bDescriptorType         4bInterfaceNumber        1bAlternateSetting       3bNumEndpoints           2bInterfaceClass       224 WirelessbInterfaceSubClass      1 Radio FrequencybInterfaceProtocol      1 BluetoothiInterface              0 Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x83  EP 3 INbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0019  1x 25 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x03  EP 3 OUTbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0019  1x 25 bytesbInterval               1Interface Descriptor:bLength                 9bDescriptorType         4bInterfaceNumber        1bAlternateSetting       4bNumEndpoints           2bInterfaceClass       224 WirelessbInterfaceSubClass      1 Radio FrequencybInterfaceProtocol      1 BluetoothiInterface              0 Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x83  EP 3 INbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0021  1x 33 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x03  EP 3 OUTbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0021  1x 33 bytesbInterval               1Interface Descriptor:bLength                 9bDescriptorType         4bInterfaceNumber        1bAlternateSetting       5bNumEndpoints           2bInterfaceClass       224 WirelessbInterfaceSubClass      1 Radio FrequencybInterfaceProtocol      1 BluetoothiInterface              0 Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x83  EP 3 INbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0031  1x 49 bytesbInterval               1Endpoint Descriptor:bLength                 7bDescriptorType         5bEndpointAddress     0x03  EP 3 OUTbmAttributes            1Transfer Type            IsochronousSynch Type               NoneUsage Type               DatawMaxPacketSize     0x0031  1x 49 bytesbInterval               1
Device Status:     0x0003Self PoweredRemote Wakeup Enabled

根据上述信息中的
iProduct 2 Bluetooth USB Host Controller
可确定对应固件文件为如下文件:

ath3k-1.fw
ar3k/AthrBT_0x01020200.dfu
ar3k/ramps_0x01020200_40.dfu
  1. 下载并添加固件
    固件下载:git clone [git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git](git://git.kernel.org/pub/scm/linux/kernel/git/firmware

刚开始我是打算将这几个固件文件放在文件系统中,但是重启后发现还是提示通用的错误,后面再网上找了一些资料才明白,我的驱动编译在内核,此时的文件系统还没有挂在,不可能找到我的固件文件,此处可以通过先启动linux内核,然后在将蓝牙模块连接上,通过hciconfig便可检测到hci0设备,这表明蓝牙设备驱动OK,固件正确。但是我的蓝牙设备不可能拆下来等内核启动后在连接,太不方便了,于是我有两种思路:
(1)将固件文件编译进内核
(2)将驱动文件以模块方式编译,然后在文件系统中挂载
我这里只尝试了第一种方法,下面列出详细步骤:

#cp linux-firmware/ath3k-1.fw ./linux-3.14.52/firmware/
#cp linux-firmware/ar3k ./linux-3.14.52/firmware/
Linux/arm 3.14.52 Kernel ConfigurationDevice Drivers  --->Generic Driver Options  --->   (ath3k-1.fw ar3k/AthrBT_0x01020200.dfu ar3k/ramps_0x01020200_40.dfu) External firmware blobs to build into the kernel binary                  (firmware) Firmware blobs root directory

其中fireware为固件根目录,然后ath3k-1.fw ar3k/AthrBT_0x01020200.dfu ar3k/ramps_0x01020200_40.dfu这个必须在firmware目录下对应文件夹中,否则驱动还是会报错误.
4. 重新编译内核
将重新编译的内核烧写进板子,启动后发现没有上述的报错信息,说明固件文件解决了。
通过如下命令可确定蓝牙设备驱动加载OK

#cat /proc/device
Character devices:1 mem4 /dev/vc/04 tty5 /dev/tty5 /dev/console5 /dev/ptmx7 vcs10 misc13 input29 fb81 video4linux89 i2c90 mtd
108 ppp
116 alsa
128 ptm
136 pts
153 spi
166 ttyACM
180 usb
188 ttyUSB
189 usb_device
199 galcore
207 ttymxc
216 rfcomm//这便是蓝牙设备

关于蓝牙的连接及文件传输后续将补充。

IMX6Q上移植AR3K蓝牙驱动相关推荐

  1. GD32上FAL Flash分区驱动移植及Easyflash与FlashDB移植说明

    GD32上FAL Flash分区驱动移植及Easyflash与FlashDB移植说明 效果 移植前提 下载源码 移植过程 加入以下文件及文件夹到工程目录和工程 将demo目录下的接口文件做下修改 修改 ...

  2. linux内核添加usb键盘驱动,配置USB外设 - linux-2.6.32在mini2440开发板上移植_Linux编程_Linux公社-Linux系统门户网站...

    linux-2.6.32在mini2440开发板上移植 配置USB外设 [日期:2013-04-08] 来源:Linux社区 作者:ssdsafsdsd [字体:大 中 小] 编者:因为LINUX内核 ...

  3. 在Linux上安装蓝牙驱动

    本方法在 Deepin 20.04 上成功应用,驱动了一个使用 RTL8761BUV芯片 的蓝牙适配器 实际上方法的可用范围至少可以推广到整个Ubuntu系的Linux系统,根据驱动的说明书,可被驱动 ...

  4. AIR32F103(十一) 在AIR32F103上移植微雪墨水屏驱动

    目录 AIR32F103(一) 合宙AIR32F103CBT6开发板上手报告 AIR32F103(二) Linux环境和LibOpenCM3项目模板 AIR32F103(三) Linux环境基于标准外 ...

  5. imx6ul之8723BU蓝牙驱动移植

    主控芯片/架构 imx6ul/cortex-a7 平台信息+平台厂家信息 nxp WIFI模块/芯片型号 RTL8723BU 作业系统(linux/android/...) linux Kernel ...

  6. 笔记本linux蓝牙驱动怎么安装程序,笔记本蓝牙驱动怎么安装不上怎么办

    蓝牙是最近几年时间里面开始流行起来的,支持设备短距离无线通信技术,不论是台式电脑还是笔记本电脑,都是支持蓝牙使用的.不过有一些新手小白用户在使用笔记本蓝牙的时候,却出现了蓝牙驱动安装不上的问题,在这里 ...

  7. 关于在2440上移植rtl8192和rtl8188cus linux驱动遇到的问题及解决方法!!!

    很早就想在2440上移植无线网卡驱动了,在网上也看了不少相关的资料,但真正做起来才发现有不少问题. 一开始,我用从同学那里拿来的TL-WN725N(这卡便宜啊,50左右成交,TB上坑爹的2440无线网 ...

  8. ucos-ii在ARM7上移植

    随着嵌入式技术的快速发展,实时多任务操作系统作为一种软件平台已逐步成为国际嵌入式系统的主流,目前世界上已经有一大批成熟的实时嵌入式操作系统,通常,对嵌入式软件的基本要求是体积小.指令速度快.具有较好的 ...

  9. OpenWrt 之 MT7628 移植第三方SPI驱动

    1.在OpenWrt系统上移植SPI驱动前,首先要确保SPI相关引脚未被复用为其他功能,比如GPIO:以下操作已假定该条件成立,否则请修改相关dts和c文件中复用配置: 2.打开dts配置文件进行修改 ...

最新文章

  1. liunx 上get 不到url参数 java_thinkphp5.0 模板上直接获取url参数
  2. 字节跳动AI Lab 再失大将!大牛王长虎被爆已离职回归学界!
  3. make太慢了,加快编译速度的方法 make -j
  4. 30 分钟 git 命令入门
  5. c语言编写系统服务程序,C语言Windows服务程序编写-ServiceMain
  6. UA MATH523A 实分析2 测度论基础2 集族与单调类
  7. javaweb 登陆注册页面
  8. Java的setmargin,Java Sheet.setMargin方法代碼示例
  9. 2021河北省高考成绩查询步骤,河北省2021年普通高校招生考试和录取工作实施方案解读...
  10. 如何创建最简单的 ABAP 数据库表,以及编码从数据库表中读取数据 (上) 试读版
  11. Apache中限制和允许特定IP访问
  12. vue3 Vite 2.0 Vue-Router 4.0 TypeScript elementPlus admin 须弥戒后台案例小结
  13. 世界地图矢量文件shp格式获取/下载方法_江仔91_新浪博客
  14. 服务器msdtc没有安全显示项,MSDTC 问题疑难解答 - BizTalk Server | Microsoft Docs
  15. 【读书笔记】你离考研成功就差这本书
  16. Quartus II cyclone 系列fpga程序下载到flash中
  17. snapchat为什么_我的Snapchat朋友旁边的表情符号是什么意思?
  18. 基于机智云平台的厨房智能监控系统
  19. 最接地气的一套PHP面试题(总结不易,踩坑踩到挂了好多面试)
  20. linux sas hba,详谈RAID功能和SAS HBA系列产品

热门文章

  1. 一种NB-IOT微功耗无线数据采集传输终端
  2. QT调用百度地图显示,并去掉logo,可输入经纬度定位
  3. fu811电子管参数_贵族之声电子管,FU-811,FU-811J,811A,811C,发射管,胆管
  4. ChinaTest 2012中国软件测试大会
  5. linux向函数传值的例子,linux awk 内置函数详细介绍(实例)
  6. 18产品经理需要具备的文案能力
  7. 编程之类的文案_你不是专业文案,用好这些技巧也能写出1000条好文案!
  8. mysql 带参数like_关于mysql中的like语句带参数问题
  9. iframe关闭时触发事件_超详细的mysql数据库事件--定时任务介绍及日常管理
  10. 背景从上到下颜色渐变_艺术涂料里那些绝美的渐变色