Changes to the bluetooth system

This commit is contained in:
j1nx 2021-03-30 14:29:32 +02:00
parent ebc669e78e
commit 9cd15d3e92
4 changed files with 52 additions and 3 deletions

View File

@ -0,0 +1,16 @@
Bluetooth: hci0: Frame reassembly failed (-84)
https://github.com/raspberrypi/firmware/issues/1150
Signed-off-by: Luca Giovenzana <luca@giovenzana.org>
--- btuart.orig 2020-03-25 03:05:24.491176583 +0100
+++ btuart 2020-03-25 03:05:43.603107833 +0100
@@ -19,7 +19,7 @@ if [ "$uart0" = "$serial1" ] ; then
if [ "$uart0_pins" = "16" ] ; then
$HCIATTACH /dev/serial1 bcm43xx 3000000 flow - $BDADDR
else
- $HCIATTACH /dev/serial1 bcm43xx 921600 noflow - $BDADDR
+ $HCIATTACH /dev/serial1 bcm43xx 460800 noflow - $BDADDR
fi
else
$HCIATTACH /dev/serial1 bcm43xx 460800 noflow - $BDADDR

View File

@ -1,12 +1,14 @@
[Unit]
Description=Broadcom BCM4343* bluetooth HCI
ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins
Before=bluetooth.service
Before=btspeaker.service
Requires=dev-serial1.device
After=dev-serial1.device
ConditionFileNotEmpty=/proc/device-tree/soc/gpio@7e200000/bt_pins/brcm,pins
[Service]
Type=simple
ExecStart=btattach -B /dev/ttyAMA0 -P bcm -S 921600
Type=forking
ExecStart=/usr/bin/btuart
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,8 @@
[Unit]
Description=Raspberry Pi bluetooth helper
Requires=bluetooth.service
After=bluetooth.service
[Service]
Type=simple
ExecStart=/usr/bin/bthelper %I

View File

@ -10,6 +10,16 @@ BTSPEAKER_SITE_METHOD = local
BTSPEAKER_LICENSE = Apache License 2.0
BTSPEAKER_LICENSE_FILES = LICENSE
define BTSPEAKER_BUILD_CMDS
curl -L -o $(@D)/BCM43430A1.hcd https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/e7fd166981ab4bb9a36c2d1500205a078a35714d/broadcom/BCM43430A1.hcd
curl -L -o $(@D)/BCM4345C0.hcd https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/e7fd166981ab4bb9a36c2d1500205a078a35714d/broadcom/BCM4345C0.hcd
curl -L -o $(@D)/btuart https://raw.githubusercontent.com/RPi-Distro/pi-bluetooth/6f6386e91e33966d3c4a3cfee72d61e14c6a11ef/usr/bin/btuart
curl -L -o $(@D)/bthelper https://raw.githubusercontent.com/RPi-Distro/pi-bluetooth/6f6386e91e33966d3c4a3cfee72d61e14c6a11ef/usr/bin/bthelper
curl -L -o $(@D)/90-pi-bluetooth.rules https://raw.githubusercontent.com/RPi-Distro/pi-bluetooth/6f6386e91e33966d3c4a3cfee72d61e14c6a11ef/lib/udev/rules.d/90-pi-bluetooth.rules
patch $(@D)/btuart $(@D)/0001-btuart-reduced-baud-rate-rpi3b.patch
endef
define BTSPEAKER_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 644 $(@D)/btspeaker.service \
$(TARGET_DIR)/usr/lib/systemd/system/btspeaker.service
@ -17,11 +27,24 @@ define BTSPEAKER_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 644 $(@D)/brcm_bt.service \
$(TARGET_DIR)/usr/lib/systemd/system/brcm_bt.service
$(INSTALL) -D -m 644 $(@D)/bthelper@.service \
$(TARGET_DIR)/usr/lib/systemd/system/bthelper@.service
mkdir -p $(TARGET_DIR)/etc/bluetooth
$(INSTALL) -D -m 644 $(@D)/main.conf \
$(TARGET_DIR)/etc/bluetooth/main.conf
$(INSTALL) -D -m 600 $(@D)/pin.conf \
$(TARGET_DIR)/etc/bluetooth/pin.conf
$(INSTALL) -d $(TARGET_DIR)/usr/bin
$(INSTALL) -m 0755 $(@D)/btuart $(TARGET_DIR)/usr/bin/
$(INSTALL) -m 0755 $(@D)/bthelper $(TARGET_DIR)/usr/bin/
$(INSTALL) -d $(TARGET_DIR)/lib/firmware/brcm
$(INSTALL) -m 0644 $(@D)/*.hcd $(TARGET_DIR)/lib/firmware/brcm/
$(INSTALL) -d $(TARGET_DIR)/usr/lib/udev/rules.d
$(INSTALL) -m 0644 $(@D)/90-pi-bluetooth.rules $(TARGET_DIR)/usr/lib/udev/rules.d/
endef
$(eval $(generic-package))