🛠 Réveiller le Bluetooth de l'AP6212 : hci_uart et firmware BCM
Objectives
On the BPI-M2 Zero, the Bluetooth of the AP6212 combo is not a USB controller: it is a serial HCI interface on UART1 (node brcm,bcm43438-bt in the device tree, 1,500,000 baud, RTS/CTS on PG11-PG13). Depending on the kernel version, loading the firmware and attaching the hci_uart discipline do not happen automatically — user feedback documents a "no BT controller found" error requiring manual loading of hci_uart and attaching the serial port by hand. You will bring the controller up to bluetoothctl and perform a BLE scan.
Hardware
- BPI-M2 Zero running Armbian (kernel 6.x) with console access
- BCM43xxx firmware package present (linux-firmware non-free/brcm depending on the image)
- A smartphone or BLE sensor to detect
- U.FL antenna screwed in (BT shares the module's antenna)
Complete code
sudo apt update && sudo apt install -y bluez
# 1) Le noyau a-t-il déjà créé le contrôleur ?
bluetoothctl list
dmesg | grep -i -e bluetooth -e hci -e 4343
# 2) Sinon, apport manuel : firmware + discipline hci_uart + attach UART1
sudo apt install -y psmisc
sudo rfkill unblock bluetooth 2>/dev/null
sudo modprobe hci_uart
# Attacher le port série de l'UART1 au discipline HCI (BCM)
sudo sh -c 'echo "bcm43xxx 0" > /sys/bus/serial/device_add' 2>/dev/null || \
sudo btattach -n -B -s 1500000 /dev/ttyS1
sleep 3
hciconfig -a # hci0 doit être apparu
# 3) Scanner
bluetoothctl
# power on
# agent on
# scan on # les périphériques BLE défilent
# quit
# 4) Rendre le réveil permanent si nécessaire
echo hci_uart | sudo tee /etc/modules-load.d/bt.conf
Expected verification
After attachment, hciconfig -a displays hci0 with a MAC address; bluetoothctl scan on scrolls through devices (watches, phones, sensors) within a few meters; the link remains stable after power on/off. Wi-Fi and BT coexist on the same antenna.
Common errors
- Targeting ttyS0: this is the console (UART0); the AP6212's BT is on UART1 (ttyS1, pinout PG11-PG13).
- Running btattach at 9600 or 115200: the module expects 1,500,000 baud, otherwise the first firmware exchange times out.
- Forgetting the RTS/CTS lines: without hardware flow control at 1.5 Mbaud, firmware loading fails due to overflow.
- Missing brcm/ firmware in the minimal image: hci_uart loads but the controller never responds — install the appropriate firmware package.
- Blaming the hardware when a kernel regression is the cause: the Armbian forum documents versions where the BT of this family no longer initializes automatically — hence the manual procedure.
Other tutorials for this board
- Flasher Armbian et premier boot du BPI-M2 Zero
- LED et bouton avec libgpiod sur le port 40 broches
- Wi-Fi AP6212 : le piège de l'antenne U.FL non fournie
- Console série sur USB-OTG : dépanner sans réseau ni câble UART
- Activer le bus SPI0 et piloter un petit écran TFT
- Survivre avec 512 Mo : zram, swap compressé et services légers
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash