I've actually managed to get this working! No guarantees that I've got it working the right way, though.
First, add this to /boot/config.txt:
Code: Select all
force_turbo=1
enable_uart=1
dtoverlay=uart0,txd0_pin=32,rxd0_pin=33,pin_func=7
Next, go into raspi-config -> Interfacing Options -> Serial and disable the login shell on serial, but enable the serial port hardware.
And reboot.
When you come back, it's a good time to checkout and compile
https://github.com/lwfinger/rtl8723bs_bt
I found that the included start_bt.sh script didn't do a good job of guessing the serial port device on my Circuit Sword. Here's a hardcoded version:
Code: Select all
#!/bin/bash
TTY="/dev/ttyAMA0"
echo "Using device $TTY for Bluetooth"
if [ ! -f /lib/firmware/rtl_bt/rtlbt_config ];
then
mkdir -p /lib/firmware/rtl_bt/
cp rtlbt_* /lib/firmware/rtl_bt/.
fi
./rtk_hciattach -n -s 115200 $TTY rtk_h5 > hciattach.txt 2>&1 &
Now run that, and check dmesg. You should see something like:
Code: Select all
...
[ 54.528820] uart-pl011 3f201000.serial: no DMA platform data
[ 55.427986] Bluetooth: Core ver 2.22
[ 55.428234] NET: Registered protocol family 31
[ 55.428242] Bluetooth: HCI device and connection manager initialized
[ 55.428291] Bluetooth: HCI socket layer initialized
[ 55.428309] Bluetooth: L2CAP socket layer initialized
[ 55.428365] Bluetooth: SCO socket layer initialized
[ 55.438117] Bluetooth: HCI UART driver ver 2.3
[ 55.438145] Bluetooth: HCI UART protocol H4 registered
Caveats so far:
- This doesn’t run at boot, so you have to start_bt.sh each time you want to use it.
- The RTL8723 module doesn’t seem to reboot at the same time as the CM3. If it can’t sync (check hciattach.txt) try power cycling the circuit sword.
- I’ve installed a few different bluetooth utilities, and I have not yet tried this set of instructions from a stock install. I might have missed something.
I’ll leave configuring bluetooth peripherals as an exercise to the reader (for now). I’ve managed to get a bluetooth keyboard paired through bluetoothctl, but I have not tried any other type of hardware.