Browse Source

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>
pull/91974/head
Dmitrii Sharshakov 3 weeks ago committed by Benjamin Cabé
parent
commit
f080c4fb89
  1. 15
      snippets/hci-uart-native-sim/README.rst
  2. 8
      snippets/hci-uart-native-sim/hci-uart-native-sim.conf
  3. 27
      snippets/hci-uart-native-sim/hci-uart-native-sim.overlay
  4. 4
      snippets/hci-uart-native-sim/snippet.yml

15
snippets/hci-uart-native-sim/README.rst

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
.. _snippet-hci-uart-native-sim:
Native Simulator support for hci_uart Snippet (hci-uart-native-sim)
###################################################################
.. code-block:: console
west build -S hci-uart-native-sim [...]
Overview
********
This snippet allows to use hci_uart connected to the host computer
with the Native Simulator. It is useful for testing with a real
Bluetooth controller, such as a device running Zephyr.

8
snippets/hci-uart-native-sim/hci-uart-native-sim.conf

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
# zephyr,native-tty-uart has a high load order
CONFIG_BT_HCI_INIT_PRIORITY=55
CONFIG_BT_BUF_EVT_RX_SIZE=255
CONFIG_BT_BUF_ACL_RX_SIZE=255
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_CMD_TX_SIZE=255
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191

27
snippets/hci-uart-native-sim/hci-uart-native-sim.overlay

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
/*
* Copyright (c) 2025 Dmitrii Sharshakov
*
* SPDX-License-Identifier: Apache-2.0
*/
&bt_hci_userchan {
status = "disabled";
};
/ {
chosen {
zephyr,bt-hci = &bt_hci_uart;
};
hci_uart: hci_uart {
compatible = "zephyr,native-tty-uart";
status = "okay";
current-speed = <2000000>;
serial-port = "/dev/ttyACM0";
bt_hci_uart: bt_hci_uart {
compatible = "zephyr,bt-hci-uart";
status = "okay";
};
};
};

4
snippets/hci-uart-native-sim/snippet.yml

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
name: hci-uart-native-sim
append:
EXTRA_CONF_FILE: hci-uart-native-sim.conf
EXTRA_DTC_OVERLAY_FILE: hci-uart-native-sim.overlay
Loading…
Cancel
Save