Skip to content

Commit cb44b7e

Browse files
carlescufijhedberg
authored andcommitted
doc: Bluetooth: Document the debug monitor and btmon in general
Move the original documentation in the arduino_101 board to a common section in the Bluetooth documentation and document the use of `btmon` in general. Signed-off-by: Carles Cufi <[email protected]>
1 parent c616f21 commit cb44b7e

File tree

3 files changed

+42
-24
lines changed

3 files changed

+42
-24
lines changed

boards/x86/arduino_101/doc/index.rst

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -432,30 +432,8 @@ Connect to the debug server at the ARC core from a second console:
432432
Bluetooth Firmware
433433
------------------
434434

435-
You will only see normal log messages on the console, by default, without any
436-
way of accessing the HCI traffic between Zephyr and the nRF51 controller.
437-
However, there is a special Bluetooth logging mode that converts the console to
438-
use a binary protocol that interleaves both normal log messages as well as the
439-
HCI traffic. Set the following Kconfig options to enable this protocol before
440-
building your application:
441-
442-
.. code-block:: console
443-
444-
CONFIG_BT_DEBUG_MONITOR=y
445-
CONFIG_UART_CONSOLE=n
446-
447-
The first item replaces the BT_DEBUG_LOG option, the second one
448-
disables the default printk/printf hooks, and the third one matches the console
449-
baudrate with what's used to communicate with the nRF51, in order not to create
450-
a bottleneck.
451-
452-
To decode the binary protocol that will now be sent to the console UART you need
453-
to use the btmon tool from BlueZ 5.40 or later:
454-
455-
456-
.. code-block:: console
457-
458-
$ btmon --tty <console TTY> --tty-speed 1000000
435+
See :ref:`bluetooth-hci-tracing` to find out how to debug the Bluetooth
436+
firmware.
459437

460438
Release Notes
461439
*************

doc/guides/bluetooth/bluetooth-dev.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,34 @@ To start developing using this setup follow the :ref:`Getting Started Guide
4242
boards that support Bluetooth and then :ref:`run the application
4343
<application_run_board>`).
4444

45+
.. _bluetooth-hci-tracing:
46+
47+
Embedded HCI tracing
48+
--------------------
49+
50+
When running both Host and Controller in actual Integrated Circuits, you will
51+
only see normal log messages on the console by default, without any way of
52+
accessing the HCI traffic between the Host and the Controller. However, there
53+
is a special Bluetooth logging mode that converts the console to use a binary
54+
protocol that interleaves both normal log messages as well as the HCI traffic.
55+
Set the following Kconfig options to enable this protocol before building your
56+
application:
57+
58+
.. code-block:: console
59+
60+
CONFIG_BT_DEBUG_MONITOR=y
61+
CONFIG_UART_CONSOLE=n
62+
63+
Setting :option:`CONFIG_BT_DEBUG_MONITOR` to ``y`` replaces the
64+
:option:`CONFIG_BT_DEBUG_LOG` option, and setting :option:`CONFIG_UART_CONSOLE`
65+
to ``n`` disables the default ``printk``/``printf`` hooks.
66+
67+
To decode the binary protocol that will now be sent to the console UART you need
68+
to use the btmon tool from :ref:`BlueZ <bluetooth_bluez>`:
69+
70+
.. code-block:: console
71+
72+
$ btmon --tty <console TTY> --tty-speed 115200
4573
4674
QEMU with an external Controller
4775
================================

doc/guides/bluetooth/bluetooth-tools.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ transports when building a single-mode, Zephyr-based BLE Controller:
162162
* USB: Use the :ref:`hci_usb <bluetooth-hci-usb-sample>` sample and then
163163
treat it as a Host System Bluetooth Controller (see previous section)
164164

165+
HCI Tracing
166+
===========
167+
168+
When running the Host on a computer connected to an external Controller, it
169+
is very useful to be able to see the full log of exchanges between the two,
170+
in the format of a :ref:`bluetooth-hci` log.
171+
In order to see those logs, you can use the built-in ``btmon`` tool from BlueZ:
172+
173+
.. code-block:: console
174+
175+
$ btmon
176+
165177
.. _bluetooth_ctlr_bluez:
166178

167179
Using Zephyr-based Controllers with BlueZ

0 commit comments

Comments
 (0)