Skip to content

Commit 4a68f78

Browse files
committed
[raspberrypi] Hook up BT controller to high-speed UART if Thunder Bluetooth stack is used (otherwise it's occupied by console)
1 parent 3548e69 commit 4a68f78

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

board/raspberrypi/post-image.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ BOARD_NAME="$(basename ${BOARD_DIR})"
77
GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
88
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
99

10+
if [ ! "x${BLUETOOTH}" = "x" ]; then
11+
if ! grep -qE '^enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
12+
echo "Adding serial console to /dev/ttyS0 to config.txt."
13+
sed -i 's/ttyAMA0/ttyS0/g' "${BINARIES_DIR}/rpi-firmware/cmdline.txt"
14+
cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
15+
# Fixes rpi3 ttyS0 serial console
16+
enable_uart=1
17+
__EOF__
18+
fi
19+
fi
20+
1021
for arg in "$@"
1122
do
1223
case "${arg}" in
@@ -157,14 +168,6 @@ __EOF__
157168
dtoverlay=pi3-miniuart-bt
158169
__EOF__
159170
fi
160-
else
161-
echo "Adding serial console to /dev/ttyS0 to config.txt."
162-
sed -i 's/ttyAMA0/ttyS0/g' "${BINARIES_DIR}/rpi-firmware/cmdline.txt"
163-
cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
164-
# Fixes rpi3 ttyS0 serial console
165-
enable_uart=1
166-
__EOF__
167-
168171
fi
169172
;;
170173
--rpi-wifi*)

package/wpe/wpeframework-plugins/wpeframework-plugins.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ WPEFRAMEWORK_PLUGINS_CONF_OPTS += -DPLUGIN_NETWORKCONTROL_INTERFACES='$(call qst
215215
endif
216216

217217
ifeq ($(BR2_PACKAGE_WPEFRAMEWORK_BLUETOOTH),y)
218+
#Prevent switching bluetooth to ttyS0
219+
export BLUETOOTH=1
218220
WPEFRAMEWORK_PLUGINS_CONF_OPTS += -DPLUGIN_BLUETOOTH=ON
219221
ifeq ($(BR2_PACKAGE_WPEFRAMEWORK_BLUETOOTH_AUTOSTART),y)
220222
WPEFRAMEWORK_PLUGINS_CONF_OPTS += -DPLUGIN_BLUETOOTH_AUTOSTART=true

0 commit comments

Comments
 (0)