Skip to content

Commit d7ca015

Browse files
jori-nordiccarlescufi
authored andcommitted
samples: Bluetooth: add more documentation for hci_uart
Try to explain how to use the hci_uart sample with another board running the zephyr host. Signed-off-by: Jonathan Rico <[email protected]>
1 parent b07f474 commit d7ca015

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

samples/bluetooth/hci_uart/README.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,45 @@ Using a USB CDC ACM UART
148148
========================
149149

150150
The sample can be configured to use a USB UART instead. See :zephyr_file:`samples/bluetooth/hci_uart/nrf52840dongle_nrf52840.conf` and :zephyr_file:`samples/bluetooth/hci_uart/nrf52840dongle_nrf52840.overlay`.
151+
152+
Using the controller with the Zephyr host
153+
=========================================
154+
155+
This describes how to hook up a board running this sample to a board running
156+
an application that uses the Zephyr host.
157+
158+
On the controller side, the `zephyr,bt-c2h-uart` DTS property (in the `chosen`
159+
block) is used to select which uart device to use. For example if we want to
160+
keep the console logs, we can keep console on uart0 and the HCI on uart1 like
161+
so:
162+
163+
.. code-block:: dts
164+
165+
/ {
166+
chosen {
167+
zephyr,console = &uart0;
168+
zephyr,shell-uart = &uart0;
169+
zephyr,bt-c2h-uart = &uart1;
170+
};
171+
};
172+
173+
On the host application, some config options need to be used to select the H4
174+
driver instead of the built-in controller:
175+
176+
.. code-block:: kconfig
177+
178+
CONFIG_BT_HCI=y
179+
CONFIG_BT_CTLR=n
180+
CONFIG_BT_H4=y
181+
182+
Similarly, the `zephyr,bt-uart` DTS property selects which uart to use:
183+
184+
.. code-block:: dts
185+
186+
/ {
187+
chosen {
188+
zephyr,console = &uart0;
189+
zephyr,shell-uart = &uart0;
190+
zephyr,bt-uart = &uart1;
191+
};
192+
};

0 commit comments

Comments
 (0)