Bluetooth: samples: hci_uart: Add debug configuration using RTT

Add debug configuration to easily enable logging through RTT. Required
to use RTT since the UART is otherwise used for the h4 UART driver.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-02-26 10:38:49 +01:00 committed by Anas Nashif
commit e0d38bf6a1
3 changed files with 36 additions and 0 deletions

View file

@ -184,6 +184,8 @@ and debug tool. Flash and debug can be done as follows:
:goals: debug
.. _jlink-rtt-debug-probe:
Using Segger J-Link
-------------------

View file

@ -113,3 +113,15 @@ BlueZ loads and initializes the attached controller.
Once the controller is attached follow the instructions in the
:ref:`bluetooth_ctlr_bluez` section to use BlueZ with it.
Debugging the controller
========================
The sample can be debugged using RTT since the UART is otherwise used by this
application. To enable debug over RTT the debug configuration file can be used.
.. code-block:: console
west build samples/bluetooth/hci_uart -- -DOVERLAY_CONFIG='debug.conf'
Then attach RTT as described here: :ref:`jlink-rtt-debug-probe`

View file

@ -0,0 +1,22 @@
CONFIG_ASSERT=y
CONFIG_THREAD_NAME=y
CONFIG_THREAD_ANALYZER=y
CONFIG_THREAD_ANALYZER_AUTO=y
CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_CONSOLE=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_LOG_BUFFER_SIZE=4096
CONFIG_RTT_CONSOLE=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_RTT_MODE_DROP=n
CONFIG_USE_SEGGER_RTT=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024
CONFIG_LOG_STRDUP_BUF_COUNT=20
CONFIG_LOG_DEFAULT_LEVEL=3