Bluetooth on Jellybean

Published on March 3, 2014

Archived Notice

This article has been archived and may contain broken links, photos and out-of-date information. If you have any questions, please Contact Us.

Bluetooth logo

We've just uploaded a new Android Jellybean image containing Bluetooth support on Nitrogen6X. Thanks to the efforts of Marc Mulcahey at Levelstar, the TiWi-BLE module is now functional. You can download the image from here:

The image is only bootable on our Nitrogen6x, Nitrogen6x-SOM, or BD-SL-i.MX6 (SABRE Lite) boards, and at the moment, only the OV5642 parallel camera is supported (more on that in coming days). As usual, you'll need to register on our site and agree to the EULA because it contains Freescale content. The image is a 4GB SD card image that can be restored using zcat and dd under Linux or Alex Page's USB Image Tool under Windows.

Source access

The sources for this release are in the boundary-imx_jb4.3_1.0.0-ga branch of our Github repository (the main development branch), and the build steps are otherwise the same as in the second beta release. You'll need to run repo sync to pull them in, and because we moved the hardware/ti/wpan/ repository from AOSP to our private git server, you may need to start with a fresh repository. In the mean-time, we'd like to get some feedback from early adopters, and hope the image file will make this easy.

Implementation details

The trick to making this work properly on Nitrogen6X turned out to be getting the userspace bits (hardware/ti/wpan/bluedroid_wilink) in sync with the kernel driver (drivers/misc/ti-st for Shared Transport). Because the bluedroid_wilink is another case of driver-in-userspace, there's some tight coupling between the two. The updates consist primarily of a set of patches back-ported from the stable kernel tree (3.13) on kernel.org, and this commit from the OMAP kernel in the AOSP. Also, as mentioned before, we also had to move the hardware/ti/wpan repository out of AOSP because of a silly restriction on TARGET_DEVICE == panda.

Other features

In addition to the big-ticket item of Bluetooth on Nitrogen6x, there are a handful of other tweaks to this image:

  • Text-to-speech support - Again, thanks to Marc Mulcahy for pointing out that we didn't have this enabled previously,
  • Power-off support - The system will now halt after Power-down is requested (more on this below), and
  • Added devregs utility - We added the devregs tool into this build.

Power-down support

Since none of our off-the-shelf boards contain support for controlling the power input to the device, what we've implemented is a partial solution to the problem of graceful shut-down. If you've ever used the Power-Down function in Android on our boards, you would have seen some power-down animation on the screen that halted after the shutdown was complete, but if you waited to actually pull power, you would also have seen the device re-start. The reason for this is that the watchdog timer would eventually time out, and restart the system. To get around this, we implemented a power_down routine to loop forever, keeping the watchdog alive. This doesn't conserve much power, but does give you the ability to shut the system down gracefully so that you can disconnect power at your leisure.