Skip to content

Commit f080c4f

Browse files
dssengkartben
authored andcommitted
snippets: add hci-uart-native-sim
Enable connecting native sim to a physical board running hci_uart without usage of Bumble or other intermediary steps, but rather using common h4 hardware driver. Most commonly used port is USB CDC-ACM, as by default for most nRF boards. Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
1 parent 639bccf commit f080c4f

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _snippet-hci-uart-native-sim:
2+
3+
Native Simulator support for hci_uart Snippet (hci-uart-native-sim)
4+
###################################################################
5+
6+
.. code-block:: console
7+
8+
west build -S hci-uart-native-sim [...]
9+
10+
Overview
11+
********
12+
13+
This snippet allows to use hci_uart connected to the host computer
14+
with the Native Simulator. It is useful for testing with a real
15+
Bluetooth controller, such as a device running Zephyr.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# zephyr,native-tty-uart has a high load order
2+
CONFIG_BT_HCI_INIT_PRIORITY=55
3+
4+
CONFIG_BT_BUF_EVT_RX_SIZE=255
5+
CONFIG_BT_BUF_ACL_RX_SIZE=255
6+
CONFIG_BT_BUF_ACL_TX_SIZE=251
7+
CONFIG_BT_BUF_CMD_TX_SIZE=255
8+
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2025 Dmitrii Sharshakov
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&bt_hci_userchan {
8+
status = "disabled";
9+
};
10+
11+
/ {
12+
chosen {
13+
zephyr,bt-hci = &bt_hci_uart;
14+
};
15+
16+
hci_uart: hci_uart {
17+
compatible = "zephyr,native-tty-uart";
18+
status = "okay";
19+
current-speed = <2000000>;
20+
serial-port = "/dev/ttyACM0";
21+
22+
bt_hci_uart: bt_hci_uart {
23+
compatible = "zephyr,bt-hci-uart";
24+
status = "okay";
25+
};
26+
};
27+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: hci-uart-native-sim
2+
append:
3+
EXTRA_CONF_FILE: hci-uart-native-sim.conf
4+
EXTRA_DTC_OVERLAY_FILE: hci-uart-native-sim.overlay

0 commit comments

Comments
 (0)