How to enable BT on board imx6q_sabresd RevC.

Document created by waterzhou Employee on Mar 11, 2013Last modified by waterzhou Employee on Aug 2, 2013
Version 15Show Document
  • View in full screen mode

      

Overview

The purpose of this document is to describe how to enable Bluetooth on i.MX 6Dual/Quad SabreSD board (RevC) for Android software.


Hardware Changes

i.MX 6Dual/Quad SabreSD board doesn't enable Bluetooth connection by default. To support bluetooth, the hardware rework is required.

BT-1.bmp

The above diagram shows the reserved connections for Bluetooth in SabreSD RevC board (All connections are marked as "DNP"). This Bluetooth cable connector is designed specifically for the WiFi/BT combo card SX-SDCAN-2830BT which is developed and sold by Silex Technology. Note that pin 1 (BT_DISABLE) of the cable connector on i.MX 6Dual/Quad SabreSD RevC is opposite Pin 20 of the WiFi/BT module. Note: when connecting Silex module and J13, the connection is reverted (For example, PIN 1 in J13 connects to PIN 20 in Silex module). To use the J13 connector, the following reworks are required:

  •   R209-R211, R214-R215 need to be populated.

          Where is them, you can refer to the below chart.

R.PNG

 

  • SPI nor flash U14 need to be depopulated.

U14.PNG

  • No other AUX boards should be connected..
  • Exchange UART5_RXD and UART5_TXD.

Orange PAD connects to Orange PAD.

Green PAD connects to Green PAD.

 

BT-3.bmp

   After hardware rework, the Bluetooth connection will like the following:

 

Pin on Silex ModuleSabresd BoardMux Pad
Pin-2  BT_UART_RTS  (output)UART5.RTS   (input)MX6Q_PAD_KEY_COL4__UART5_RTS
Pin-3  BT_UART_TXD   (output)UART5.RXD   (input)MX6Q_PAD_KEY_ROW1__UART5_RXD
Pin-4  BT_UART_CTS   (input)UART5.CTS   (output)MX6Q_PAD_KEY_ROW4__UART5_CTS
Pin-5  BT_UART_RXD   (input)UART5.TXD   (output)MX6Q_PAD_KEY_COL1__UART5_TXD
Pin-14  BT_PWD_L       (input)GPIO_2         (output)MX6Q_PAD_GPIO_2__GPIO_1_2

 


Software Information

For earlier android version before Jelly Bean4.2

Take ICS as an example, for we didn't do this work when our last ICS version R13.4.1 released. So our formal release had no support on BT. Here will give out patches based on R13.4.1.

Enable Bluetooth with the following setting (e.g. device/fsl/imx6/sabresd/init.rc)

     # No bluetooth hardware present

-    setprop hw.bluetooth 0

+    setprop hw.bluetooth 1

Ensure BOARD_HAVE_BLUETOOTH := true in device/fsl/imx6/sabresd/SabreSDBoardConfigComm.mk.

Add BT feature support in device/fsl/imx6/sabresd/required_hardware.xml:

<permissions>

     <feature name="android.hardware.camera" />

+    <feature name="android.hardware.bluetooth" />

 

Add UART5 support in kernel:

In this step you can refer to the attached (kernel patch for UART5 based on ICS.zip) to change PinMux PAD configuration for UART5.

 

Add AR3002 BT firmware support:

Update external/linux-firmware with the attached patch(0001-ENGR00270791-BT-add-AR3002-firmware-support.patch) to add AR3002 BT firmware support for Silex's BT is AR3002.

 

Then you can manually run the command “hciattach -n -s 115200 /dev/ttymxc4 ath3k 115200 flow nosleep” in console to see whether bluetooth can attach HCI successfully.

 

At last, you need add rfkill for BT reset in kernel, here also give a patch for reference:

0001-ENGR00270791-BT-add-rfkill-for-bt-reset.patch

 

BT is not enable in kernel default. You can control whether to enable it in bootargs like the following  in device/fsl/sabresd_6dq/BoardConfig.mk.

BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale  bluetooth


For android version since Jelly Bean4.2


From Jelly Bean4.2, Bluez is no longer used.Android provides a default Bluetooth stack, BlueDroid, that is divided into two layers: The Bluetooth Embedded System (BTE), which implements the core Bluetooth functionality and the Bluetooth Application Layer (BTA), which communicates with Android framework applications. A Bluetooth system service communicates with the Bluetooth stack through JNI and with applications through Binder IPC. The system service provides developers access to various Bluetooth profiles. The following diagram shows the general structure of the Bluetooth stack:

For bluedroid, we have supported it in our formal release including Android4.3. You can get it from our website. Or just get HAL code from attached(libbt-ath3k.zip).


Known issue

For  KEY_COL4 is both used by uart5 and pcie,  if you enable BT, 3G  mobile will not work. For its power disable pin is conflict with uart5's UART_RTS. This is

also why we didn't enable BT in formal release.


Supported and tested profile

workable profilenot tested profile
HidHandset & Handfree(not support for hardware restrict)
A2DP
Pbap
Opp
Pan


3 people found this helpful

Outcomes