boards: nrf52_bsim: Add support for using UART as HCI

Add support for using an UART instead of the native controller. This is
accomplished with a custom DTS overlay for the tests that require it.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
This commit is contained in:
Johan Hedberg 2024-05-08 11:30:15 +03:00 committed by Anas Nashif
commit db753c1474
4 changed files with 15 additions and 4 deletions

View file

@ -38,8 +38,6 @@
zephyr,flash = &flash0;
/* UART used by the BT controller UART HCI driver by default: */
zephyr,bt-c2h-uart = &uart1;
/* UART used by the BT host UART HCI driver by default: */
zephyr,bt-uart = &uart1;
};
soc {
@ -117,4 +115,9 @@
pinctrl-1 = <&uart1_sleep>;
pinctrl-names = "default", "sleep";
hw-flow-control;
bt_hci_uart: bt_hci_uart {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};

View file

@ -1 +1,3 @@
/* Purposely empty. To avoid using the one provided by the application */
&bt_hci_uart {
status = "disabled";
};

View file

@ -10,7 +10,8 @@ set -ue
source ${ZEPHYR_BASE}/tests/bsim/compile.source
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_hci_uart.conf compile
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_hci_uart.conf \
cmake_extra_args=-DEXTRA_DTC_OVERLAY_FILE=hci-uart.overlay compile
app=samples/bluetooth/hci_uart compile
app=samples/bluetooth/hci_uart_async compile

View file

@ -0,0 +1,5 @@
/ {
chosen {
zephyr,bt-hci = &bt_hci_uart;
};
};