didster
Posts: 6
Joined: Fri May 13, 2016 1:18 pm

Pi3 UART and Bluetooth

Fri May 13, 2016 1:22 pm

I have an app that needs to make use of the PL011 UART connected to a modem. It also needs to make use of Bluetooth.

I have configured the Pi to use the pi3-miniuart-bt overlay to move Bluetooth to the mini-UART. I have updated hciattach.service to use /dev/ttyS0. I have removed the attachment to the console from cmdline.txt. I have set core_freq to a fixed value in config.txt. All that works fine, and I can mostly use both Bluetooth and the hardware uart OK.

But oddly, every now and then when I boot the mini-UART doesnt respond. hciattach returns timeout when run and nothing, other than rebooting, brings it back to life. This seems to happen 1 boot in every 5 or so. Once its up it seems to stay up OK.

Has anyone else had this? Thanks

Relevant files

/boot/cmdline.txt

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
/boot/config.txt

Code: Select all

dtoverlay=pi3-miniuart-bt
enable_uart=1
core_freq=250

# I have also tried combinations of the below to lock core clock as docs seem to differ
#arm_freq=700
#arm_freq_min=700
#force_turbo=1

Code: Select all

/lib/systemd/system/hciattach.service
[Unit]
ConditionPathIsDirectory=/proc/device-tree/soc/[email protected]/bt_pins
Before=bluetooth.service
After=dev-ttyS0.device

[Service]
Type=forking
ExecStart=/usr/bin/hciattach /dev/ttyS0 bcm43xx 921600 noflow -

[Install]
WantedBy=multi-user.target

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 41 guests