1

I followed these instructions to enable a Bluetooth PAN on my Raspberry Pi Zero W. It mostly works fine, but it occupies a serial port. I need UART (mounted at /dev/ttyAMA0) for serial communications, so I switched Bluetooth to Mini UART, which has to run at a lower baud rate.

After switching Bluetooth to Mini UART by putting dtoverlay=pi3-miniuart-bt in /boot/config.txt and disabling the kernel console, hcitool dev unfortunately shows an empty list of devices and the Bluetooth PAN stops working.

/boot/cmdline.txt looks like this:

dwc_otg.lpm_enable=0 root=PARTUUID=855bb810-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

And the contents of /lib/systemd/system/hciuart.service is:

[Unit]
Description=Configure Bluetooth Modems connected by UART
ConditionFileNotEmpty=/proc/device-tree/soc/gpio@7e200000/bt_pins/brcm,pins
Requires=dev-serial1.device
After=dev-serial1.device

[Service]
Type=forking
ExecStart=/usr/bin/btuart

[Install]
WantedBy=multi-user.target

I looked inside /usr/bin/btuart, and it seems to make provision for /dev/serial1, but maybe it needs to told explicitly to use /dev/ttyS0 (or ttyS1). Do I need to tell it explicitly to use a different serial port?

How do I get Bluetooth PAN working over Mini UART?

1 Answers1

2

Adding core_freq=250 to /boot/config.txt solves the problem by downclocking the GPU core frequency. I don't understand why this affects Bluetooth yet, but PAN over MiniUART is stable now.

  • The reason for this is the mini-uart's baudrate is a fixed proportion of the core clock frequency. For more information read: https://www.raspberrypi.org/documentation/configuration/uart.md – Logan Gunthorpe Jun 28 '19 at 15:38