24 October 2015

Enabling BCM43142 Bluetooth on Linux Mint 17.2 and Ubuntu 14.04 LTS (Trusty Tahr)

Recently, I acquired a Thinkpad Edge E545, with the Broadcom hybrid WiFi/Bluetooth mini PCIe card (WiFi reads as wlan0: Broadcom BCM4365 802.11 Hybrid Wireless Controller 6.30.223.248 (r487574), bluetooth reads as usb 4-1: Product: BCM43142A0, USB ID is 105b:e065). The wifi worked fine as soon as I enabled the proprietary drivers in the driver manager, but the bluetooth was having none of it. Cue much frustration.

Based on the instructions and patch at this blog post for getting it working on Debian Jessie, I started to have a go, but I couldn't seem to download the kernel source - the apt-get source commands were pointing at nonexistent releases. Unfortunately, that was down to me failing to add the deb-src lines to apt-get. Once I did that, and actually followed the instructions properly, it sort of worked. But then it still kept downloading newer kernels, which wasn't overly helpful when I just wanted to recompile a module to add to my existing system.

I manually cloned the script, and adapted it to work with the Ubuntu sources from git, with the exact kernel I'm using. I've uploaded a copy of the script plus the patchfile that I modified and set up to automatically clone the Ubuntu kernel version that Mint is using from the LTS repo. Feel free to download it and modify as necessary for kernel versions, I just did a quick and dirty job. It downloads quite a bit of code, as it grabs the whole repo, and it's likely reasonably easy to do it more efficiently, but it did work. As described on the previous blogpost, you'll need hex2hcd compiled, base-devel and git installed, and the hex binary file from a Windows install, e.g. BCM43142A0_001.001.011.0311.0312.hex, which I used.

But, as I'm a kind soul, I've precompiled them, and they're working on my E545. I'm not 100% sure on the legality with the Broadcom binary files, but as they distribute the blobs for Linux anyway, I doubt they'll mind so much. This also builds on the work on the aforementioned blog post, with the script adapted from theirs. This may not work for other USB IDs - you'd need to modify the above script / patch patch appropriately. I hope this saves other people the hassle I went through figuring it out! If you've an aversion to running precompiled binaries from some random site, you're welcome to download the above script, inspect it, and run it to build your own copy - the hashes should match, in theory, with default compile flags.

The binary download for the patched btusb.ko and the firmware (for 14.04 based distros) are here. Run the shell script to install it. Can't guarantee it'll work with your exact configuration, but the script above might it this doesn't. Kernel version was a 3.16 version from memory.

Hope this saves people some hassle, please do drop a comment on the blog if it sorts you out. Good to know if it's saved people some pain. It's the exact binary that made the E545 hardware work.