imx6q on ar3k bluetooth driver

Source: Internet
Author: User
Tags git clone

My Development Board configuration:
Development Board Hardware: IMX6Q
Bluetooth module: Based on the mini PCI-E interface Atheros ar5b225 300M wireless +4.0 Bluetooth Two-in-a half-high network card module (AR3K series)
Linux kernel: 3.14.52 (mainly my development Board with the core with a lot of tools, if the bottom version of the kernel, it will be more trouble, so it is used with its own core)
Compilation tool: arm-linux-gcc:4.9.2
I put all the compressed bags under the/opt/arm/, and I'm talking about the directory below. You can choose the directory for your liking. Install the cross-compile tool ARM-LINUX-GCC

    #tar XZVF arm-linux-gcc/usr/local          
    # export path= $PATH:/usr/local/arm/4.3.2/bin  
Unzip the compilation configuration kernel

Because I made me develop the Board CD-ROM with the kernel source code, so do not need to modify the source code in the makefile. If it is downloaded from the Internet kernel source code, in the compile time need to modify the makefile, need to be part of the Bluetooth configuration plus go, as follows.

    #tar xzvf linux-3.14.52 #cd linux-14.52 #make menuconfig arch=arm linux/arm 3.14.52 Kernel Configura tion [*] Networking support <*> Bluetooth subsystem support---bluetooth subsystem supp ORT <*> RFCOMM protocol support [*] RFCOMM TTY support <*> BNEP p Rotocol support [*] Multicast filter support [*] Protocol filter Support <*
                > HIDP protocol support Bluetooth device drivers---> <*> HCI USB Driver <*> HCI SDIO driver <*> HCI UART driver [*] UART (H4) protocol Su   Pport [*] 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 driv ER support <*> atheros firmware Download driver

Then you start to cross-compile the kernel.

    #make Zimage  
Burn the kernel, start the Development Board, and view the kernel printing information
rtc-isl1208 0-006f:setting system clock to 2020-01-01 13:01:50 UTC (1577883710)
ALSA device list:
  #0: imx-hdmi-so C
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

Enter System command line:

#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 04 
24: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 Ha          I Device descriptor:blength bdescriptortype 1 bcdusb 1.10 bdeviceclass        224 Wireless bdevicesubclass 1 Radio Frequency bdeviceprotocol 1 Bluetooth bMaxPacketSize0 Idvendor 0x0489 foxconn/hon Hai idproduct 0xe036 bcddevice 0.02 IMANUFAC                 Turer 1 Atheros Communications iproduct 2 Bluetooth USB Host Controller iserial
    3 Alaska Day 2006 Bnumconfigurations 1 Configuration descriptor:blength 9bDescriptorType 2 wtotallength 177 bnuminterfaces 2 Bconfigurationvalue 1 IC              Onfiguration 4 BT HCI bmattributes 0xe0 Self powered Remote Wakeup Maxpower         100mA Interface descriptor:blength 9 bdescriptortype 4 Binterfacenumber 0 balternatesetting 0 bnumendpoints 3 binterfaceclass 224 Wireless b 
      Interfacesubclass 1 Radio Frequency binterfaceprotocol 1 Bluetooth iinterface 0   Endpoint descriptor:blength 7 bDescriptorType 5 bendpointaddress 0x81               EP 1 in bmattributes 3 Transfer type Interrupt Synch type               None Usage Type Data wmaxpacketsize 0x0010 1x bytes Binterval 1 Endpoint DesCriptor:blength 7 bDescriptorType 5 bendpointaddress 0x82 EP 2 in
          Bmattributes 2 Transfer type Bulk Synch type None Usage Type Data wmaxpacketsize 0x0040 1x bytes Binterval 1 endpo int Descriptor:blength 7 bDescriptorType 5 bendpointaddress 0x02 EP
          2 out Bmattributes 2 Transfer type Bulk Synch type None
    Usage Type Data wmaxpacketsize 0x0040 1x bytes Binterval 1
      Interface descriptor:blength 9 bDescriptorType 4 Binterfacenumber 1 Balternatesetting 0 bnumendpoints 2 binterfaceclass 224 Wireless BINTERFACESUBC Lass 1 Radio Frequency binterfaceprotocol 1 Bluetooth iinterface 0 Endpoint descriptor:blength            7 bDescriptorType 5 bendpointaddress 0x83 EP 3 in Bmattributes               1 Transfer type isochronous Synch type None Usage type
        Data wmaxpacketsize 0x0000 1x 0 bytes binterval 1 Endpoint Descriptor: Blength 7 bDescriptorType 5 bendpointaddress 0x03 EP 3 out Bmatt Ributes 1 Transfer type isochronous Synch type None USAG E Type Data wmaxpacketsize 0x0000 1x 0 bytes binterval 1 Interface De Scriptor:blength 9 bDescriptorType 4 Binterfacenumber 1 balternate Setting 1 BNUmendpoints 2 Binterfaceclass 224 Wireless binterfacesubclass 1 Radio Frequency bIn                 Terfaceprotocol 1 Bluetooth iinterface 0 Endpoint descriptor:blength
          7 bDescriptorType 5 bendpointaddress 0x83 EP 3 in Bmattributes 1
        Transfer type isochronous Synch type None Usage type Data                 Wmaxpacketsize 0x0009 1x 9 bytes binterval 1 Endpoint descriptor:blength            7 bDescriptorType 5 bendpointaddress 0x03 EP 3 out Bmattributes               1 Transfer type isochronous Synch type None Usage type
      Data wmaxpacketsize 0x0009 1x 9 bytes binterval 1 Interface Descriptor:              Blength   9 bDescriptorType 4 Binterfacenumber 1 balternatesetting 2 bnumendpoints 2 Binterfaceclass 224 Wireless binterfacesubclass 1 Radio Frequency Binterfaceprotoc
        OL 1 Bluetooth iinterface 0 Endpoint descriptor:blength 7 bDescriptorType 5 bendpointaddress 0x83 EP 3 in Bmattributes 1 Transfer Type isochronous Synch type None Usage type Data WMAXPA                 Cketsize 0x0011 1x bytes Binterval 1 Endpoint descriptor:blength
          7 bDescriptorType 5 bendpointaddress 0x03 EP 3 out Bmattributes 1 
        Transfer type isochronous Synch type None Usage type Data Wmaxpacketsize    0x0011 1x bytes Binterval 1 Interface descriptor:blength 9
      bDescriptorType 4 Binterfacenumber 1 balternatesetting 3 bnumendpoints 2 Binterfaceclass 224 Wireless binterfacesubclass 1 Radio Frequency binterfaceprotocol 1 B Luetooth iinterface 0 Endpoint descriptor:blength 7 bdescriptor            Type 5 bendpointaddress 0x83 EP 3 in bmattributes 1 Transfer type     Isochronous Synch type None Usage type Data wmaxpacketsize
        0x0019 1x bytes Binterval 1 Endpoint descriptor:blength 7 bDescriptorType 5 bendpointaddress 0x03 EP 3 out bmattributes 1 Trans Fer Type IsocHronous Synch type None Usage type Data wmaxpacketsize 0x0019 1x bytes Binterval 1 Interface descriptor:blength 9 bdescriptor Type 4 Binterfacenumber 1 balternatesetting 4 bnumendpoints 2 Binte
      Rfaceclass 224 Wireless binterfacesubclass 1 Radio Frequency binterfaceprotocol 1 Bluetooth         IInterface 0 Endpoint descriptor:blength 7 bdescriptortype 5 bendpointaddress 0x83 EP 3 in bmattributes 1 Transfer Type ISOCHR Onous Synch type None Usage type Data wmaxpacketsize 0x0021 1 X bytes binterval 1 Endpoint descriptor:blength 7 Bdescrip
      Tortype 5  Bendpointaddress 0x03 EP 3 out bmattributes 1 Transfer Type isochronous Synch type None Usage Type Data wmaxpacketsize 0x0021 1x         S Binterval 1 Interface descriptor:blength 9 bDescriptorType       4 Binterfacenumber 1 balternatesetting 5 bnumendpoints 2 Binterfaceclass 224 Wireless binterfacesubclass 1 Radio Frequency binterfaceprotocol 1 Bluetooth iinterf
        Ace 0 Endpoint descriptor:blength 7 bdescriptortype 5
          Bendpointaddress 0x83 EP 3 in bmattributes 1 Transfer Type isochronous
        Synch type None Usage Type Data wmaxpacketsize 0x0031 1x bytes       Binterval        1 Endpoint descriptor:blength 7 bDescriptorType 5 Bendpoint Address 0x03 EP 3 out bmattributes 1 Transfer Type isochronous Sync H type None Usage Type Data wmaxpacketsize 0x0031 1x bytes B Interval 1 Device status:0x0003 Self powered Remote Wakeup Enabled

According to the above information
IProduct 2 Bluetooth USB Host Controller
You can determine that the corresponding firmware file is the following file:

ATH3K-1.FW
ar3k/athrbt_0x01020200.dfu
ar3k/ramps_0x01020200_40.dfu
Download and add firmware
Firmware download: 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

At first I was going to put these firmware files in the file system, but after the reboot found or prompted the common error, back to find some information on the Internet to understand that my driver compiled in the kernel, at this time the file system has not been hung, it is impossible to find my firmware file, here can be started by first Linux kernel, Then the Bluetooth module is connected, and the HCI0 device is detected via Hciconfig, which indicates that the Bluetooth device driver is OK and the firmware is correct. But my Bluetooth device can not be removed and so on after the kernel started in the connection, too inconvenient, so I have two ways:
(1) Compile the firmware file into the kernel
(2) Compile the driver file in a modular manner and then mount the file system
I've only tried the first method here, and here's a list of steps:

#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 Configuration
    Device Drivers  --->
        Generic Driver Options  --->   
            ( ATH3K-1.FW ar3k/athrbt_0x01020200.dfu ar3k/ramps_0x01020200_40.dfu) External firmware blobs to builds into the kernel Bina Ry                  
            (firmware) firmware BLOBs root directory                

Where Fireware is the firmware root directory, and then ATH3K-1.FW AR3K/ATHRBT_0X01020200.DFU AR3K/RAMPS_0X01020200_40.DFU This must be in the corresponding folder in the firmware directory, Otherwise the driver will still report the error.
4. Recompile the kernel
The recompilation of the kernel burned into the board, after the boot found no such error information, indicating that the firmware file resolved.
You can determine the Bluetooth device driver load OK by using the following command

#cat/proc/device
Character Devices:
  1 mem
  4/dev/vc/0
  4 tty
  5/dev/tty
  5/dev/console
  5/ DEV/PTMX
  7 vcs
 misc
 input
 fb
 bayi video4linux
 I2C
 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//This is the Bluetooth device.

Follow-up on Bluetooth connection and file transfer will be supplemented.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.