The referenced file is empty and the hciuart service fails to start. I have tried removing the failing condition check and attempting to start hciuart manually.
pi@emonpi:~ $ sudo systemctl start hciuart
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.
pi@emonpi:~ $ systemctl status hciuart.service
â—Ź hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-09-21 15:48:10 BST; 21s ago
Process: 1532 ExecStart=/usr/bin/btuart (code=exited, status=1/FAILURE)
CPU: 29ms
Sep 21 15:47:40 emonpi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Sep 21 15:48:10 emonpi btuart[1539]: Initialization timed out.
Sep 21 15:48:10 emonpi btuart[1539]: bcm43xx_init
Sep 21 15:48:10 emonpi systemd[1]: hciuart.service: Control process exited, code=exited, status=1/FAILURE
Sep 21 15:48:10 emonpi systemd[1]: hciuart.service: Failed with result 'exit-code'.
Sep 21 15:48:10 emonpi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
pi@emonpi:~ $
Has anyone managed to get further with Bluetooth on the miniuart?
Thanks for moving it. I have searched quite widely for “Pi 4 mini-uart Bluetooth” but have not found a definitive answer. Not sure if it is relevant but the target system is an early revision Pi 4 (4GB):
pi@emonpi:~ $ cat /proc/cpuinfo
[...]
Hardware : BCM2835
Revision : c03111
Serial : 100000003de10cda
Model : Raspberry Pi 4 Model B Rev 1.1
pi@emonpi:~ $
Unfortunately, I am interacting with the Pi 4 remotely over SSH which makes it difficult to try a raw RPi OS image (I have a Rev 1.5 (8Gb) at home but it is rather busy running Home Assistant).
[pi4]
# Run as fast as firmware / board allows
# arm_boost=1
core_freq=250
core_freq_min=250
[all]
dtoverlay=w1-gpio
dtoverlay=disable-bt
enable_uart=1
dtoverlay=miniuart-bt
I have commented out arm_boost=1 because it isn’t relevant to Raspberry Pi 4 Model B Rev 1.1 (I suspect it would be ignored anyway).
In Raspberry Pi Documentation: Configuration I have seen that core_freq=250 (and core_freq_min=250?) is required to enable the mini UART. Although the same document states enable_uart=1 implies core_freq=250 (unless force_turbo=1).
There is a M-Bus Master Hat which is working fine on the primary UART /dev/ttyAMA0 (/dev/serial0). I am trying to use the mini UART /dev/ttyS0 (/dev/serial1) to connect the Bluetooth devices.
Went back to replacing dtoverlay=miniuart-bt with dtoverlay=miniuart-bt,krnbt=on in /boot/config.txt.
This at least seems to see hci0:
pi@emonpi:~ $ dmesg | grep hci0
[ 8.159278] Bluetooth: hci0: command 0xfc18 tx timeout
[ 16.351298] Bluetooth: hci0: BCM: failed to write update baudrate (-110)
[ 16.351334] Bluetooth: hci0: Failed to set baudrate
[ 18.367240] Bluetooth: hci0: command 0x0c03 tx timeout
[ 26.591255] Bluetooth: hci0: BCM: Reset failed (-110)
pi@emonpi:~ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
pi@emonpi:~ hciconfig -a hci0
hci0: Type: Primary Bus: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:14 acl:0 sco:0 commands:2 errors:0
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DH1 HV1
Link policy:
Link mode: SLAVE ACCEPT
pi@emonpi:~ $ sudo hciconfig -a hci0 up
Can't init device hci0: Connection timed out (110)
pi@emonpi:~ $
I have also downloaded and built bluez-5.66.tar.xz with all the "-O2" removed form configure and --enable-debug specified. I note that hciattach and several others are now deprecated (but can be included in the build by specifying --enable-deprecated).
I have tried running the newly built hciconfig -a hci0 up as root with gdb. The problem occurs when ioctl(ctl, HCIDEVUP, hdev) fails, returning ETIMEDOUT (110).
Any suggestions on how to narrow down this problem?
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
core_freq=500
core_freq_min=500
[all]
dtoverlay=w1-gpio
# dtoverlay=disable-bt
enable_uart=1
dtoverlay=miniuart-bt
something appears to be working. After rebooting the system I can do