Home
dphys edited this page 5 years ago
  1. Update the uImage and sun8i-r16-clockworkpi-cpi3.dtb under the boot partition in the SD card and reboot GS.
  2. Copy the Bluetooth chip firmware bcm43438a0.hcd to /lib/firmware/brcm/
  3. Copy the firmware burning program brcm_patchram_plus to /usr/bin/ and “chmod +x /usr/bin/brcm_patchram_plus”.
  4. sudo apt-get install bluez
  5. Load the Bluetooth driver with the following command:
sudo rfkill block 0
sudo rfkill unblock 0
sudo brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a0.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no2bytes --tosleep 5000 /dev/ttyS1 &

»–bd_addr B0:F1:EC:2D:07:5B» is to set the Bluetooth MAC address, recommended to read the WiFi MAC address and change the last bit as the Bluetooth MAC address.

If the driver loads successfully, you can see «Done setting line discpline», currently it takes about 20 seconds (this is an issue).

After loading, you can see the Bluetooth device with hciconfig:

cpi@clockworkpi:~$ hciconfig
hci0:   Type: Primary  Bus: UART

    BD Address: aa:22:33:44:55:66  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING PSCAN 
    RX bytes:1193 acl:1 sco:0 events:64 errors:0
    TX bytes:2339 acl:2 sco:0 commands:54 errors:0

Now you can use the command bluetoothctl to connecting a Bluetooth device:

cpi@clockworkpi:~$ bluetoothctl
[NEW] Controller B0:F1:EC:2D:07:5B clockworkpi [default]

[bluetooth]# scan on Discovery started [CHG] Device 34:88:5D:3B:CB:6F LegacyPairing: yes [CHG] Device 34:88:5D:3B:CB:6F RSSI: -72 [CHG] Device 34:88:5D:3B:CB:6F Class: 0x002540 [CHG] Device 34:88:5D:3B:CB:6F Icon: input-keyboard

[bluetooth]# connect 34:88:5D:3B:CB:6F Attempting to connect to 34:88:5D:3B:CB:6F [CHG] Device 34:88:5D:3B:CB:6F Connected: yes Connection successful [Keyboard K480]# [12027.524551] hid-generic 0005:046D:B33C.0003: unknown main item tag 0x0 [12027.535022] input: Keyboard K480 as /devices/platform/soc@01c00000/1c28400.serial/tty/ttyS1/hci0/hci0:120005:046D:B33C.0003/input/input3 [12027.548045] hid-generic 0005:046D:B33C.0003: input: BLUETOOTH HID v28.02 Keyboard [Keyboard K480] on b0:f1:ec:2d:07:5b [CHG] Device 34:88:5D:3B:CB:6F ServicesResolved: yes

Pair 34:88:5D:3B:CB:6F is required for pairing before the first connection.