• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/29-Dec-2025-616440

src/29-Dec-2025-32,49025,504

CMakeLists.txtD29-Dec-20251 KiB4232

KconfigD29-Dec-2025407 2114

Kconfig.sysbuildD29-Dec-2025499 1612

README.rstD29-Dec-20255.2 KiB175126

hci_ipc.confD29-Dec-202561 20

overlay-bt_ll_sw_split.confD29-Dec-20252.5 KiB8046

overlay-le-audio.confD29-Dec-20254.6 KiB186128

overlay-mesh.confD29-Dec-20251.8 KiB6354

prj.confD29-Dec-20252 KiB7872

prj_br.confD29-Dec-2025348 1613

rd_rw612_bga.overlayD29-Dec-2025287 2017

sysbuild.cmakeD29-Dec-2025670 2518

testcase.yamlD29-Dec-20252.9 KiB111108

README.rst

1Bluetooth Tester application
2############################
3
4The Tester application uses binary protocol to control Zephyr stack and is aimed at
5automated testing. It requires two serial ports to operate.
6The first serial is used by Bluetooth Testing Protocol (BTP) to drive Bluetooth
7stack. BTP commands and events are received and buffered for further processing
8over the same serial.
9
10BTP specification can be found in auto-pts project repository:
11https://github.com/intel/auto-pts
12The auto-pts is an automation framework for PTS Bluetooth testing tool provided
13by Bluetooth SIG.
14
15See https://docs.zephyrproject.org/latest/guides/bluetooth/index.html for full
16documentation about how to use this test.
17
18
19Supported Profiles and Services
20*******************************
21
22Host/Core
23=========
24
25* GAP
26* GATT
27* IAS
28* L2CAP
29* OTS
30* SM
31
32LE Audio
33========
34
35* AICS
36* ASCS
37* BAP
38* CAP
39* CAS
40* CCP
41* CSIP
42* CSIS
43* HAP
44* HAS
45* MCP
46* MCS
47* MCIP
48* MICS
49* PACS
50* PBP
51* TBS
52* TMAP
53* VCP
54* VCS
55* VOCS
56
57Mesh
58====
59
60* Mesh Node
61* Mesh Model
62
63Building and running on QEMU
64****************************
65
66QEMU should have connection with the external host Bluetooth hardware.
67The btproxy tool from BlueZ can be used to give access to a Bluetooth controller
68attached to the Linux host OS:
69
70$ sudo tools/btproxy -u
71Listening on /tmp/bt-server-bredr
72
73/tmp/bt-server-bredr option is already set in Makefile through QEMU_EXTRA_FLAGS.
74
75To build tester application for QEMU use BOARD=qemu_cortex_m3 and
76CONF_FILE=qemu.conf. After this qemu can be started through the "run"
77build target.
78
79Note: Target board have to support enough UARTs for BTP and controller.
80      We recommend using qemu_cortex_m3.
81
82'bt-stack-tester' UNIX socket (previously set in Makefile) can be used for now
83to control tester application.
84
85Next, build and flash tester application by employing the "flash" build
86target.
87
88Use serial client, e.g. PUTTY to communicate over the serial port
89(typically /dev/ttyUSBx) with the tester using BTP.
90
91Building and running on :zephyr:board:`native_sim <native_sim>` on Linux
92************************************************************************
93
94It is possible to build and run the tester application using the
95:zephyr:board:`native_sim <native_sim>` board, and any compatible HCI controller.
96This has the advantage of allowing the use of Linux debugging tools like valgrind and gdb,
97as well as tools like btmon.
98It is also faster to apply changes to the code,
99as building for :zephyr:board:`native_sim <native_sim>` is usually faster,
100and there is no flashing step involved.
101
102Building for :zephyr:board:`native_sim <native_sim>` is just
103
104.. code-block::
105
106    west build -b native_sim
107
108Which will generate a zephyr.exe file that can be executed as
109
110.. code-block::
111
112    zephyr.exe --bt-dev=hciX
113
114Where ``hciX`` is the HCI controller (like ``hci0``).
115However for the purpose of running the tester application with auto-pts,
116running the application is left to the auto-pts client.
117
118
119Building the Zephyr controller for a :zephyr:board:`native_sim <native_sim>` host on Linux
120==========================================================================================
121
122To build and flash the Zephyr controller as an HCI controller usable by Linux,
123either the :zephyr:code-sample:`bluetooth_hci_uart` or :zephyr:code-sample:`bluetooth_hci_usb`
124samples can be used.
125See also :ref:`bluetooth-tools`.
126When building these samples, the tester application controller overlay should be supplied.
127For example
128
129.. code-block::
130
131    west build -b nrf5340_audio_dk/nrf5340/cpunet -d ${ZEPHYR_BASE}/build/nrf5340_audio_dk_nrf5340_cpunet ${ZEPHYR_BASE}/samples/bluetooth/hci_ipc/ -- -DEXTRA_CONF_FILE=${ZEPHYR_BASE}/tests/bluetooth/tester/overlay-bt_ll_sw_split.conf
132    west flash -d ${ZEPHYR_BASE}/build/nrf5340_audio_dk_nrf5340_cpunet
133    west build -b nrf5340_audio_dk/nrf5340/cpuapp -d ${ZEPHYR_BASE}/build/nrf5340_audio_dk_nrf5340_cpuapp ${ZEPHYR_BASE}/samples/bluetooth/hci_uart/
134    west flash -d ${ZEPHYR_BASE}/build/nrf5340_audio_dk_nrf5340_cpuapp
135
136Will build and prepare a nRF5340 Audio DK to be an HCI controller over UART.
137
138For single core boards like the nRF52840 DK it is a bit simpler and can be done like
139
140.. code-block::
141
142    west build -b nrf52840dk/nrf52840 ${ZEPHYR_BASE}/samples/bluetooth/hci_uart/ -- -DEXTRA_CONF_FILE=${ZEPHYR_BASE}/tests/bluetooth/tester/overlay-bt_ll_sw_split.conf
143    west flash
144
145The :zephyr:code-sample:`bluetooth_hci_usb` sample can also be used,
146but support for Bluetooth Isochronous channels is not yet fully supported.
147
148Building for LE Audio
149*********************
150
151The tester application can be built with support for BT LE Audio by applying the
152the ``overlay-le-audio.conf`` and ``hci_ipc.conf`` with ``--sysbuild`` for the supported boards,
153e.g.:
154
155.. code-block::
156
157    west build -b nrf5340dk/nrf5340/cpuapp --sysbuild \
158        -- -DEXTRA_CONF_FILE=overlay-le-audio.conf;hci_ipc.conf
159
160Building with support for btsnoop and rtt logs
161**********************************************
162
163Add following options in desired configuration file:
164
165CONFIG_LOG=n
166CONFIG_LOG_BACKEND_RTT=y
167CONFIG_LOG_BACKEND_RTT_BUFFER=1
168CONFIG_LOG_BACKEND_RTT_MODE_DROP=n
169
170CONFIG_USE_SEGGER_RTT=y
171CONFIG_SEGGER_RTT_SECTION_CUSTOM=y
172
173CONFIG_BT_DEBUG_MONITOR_RTT=y
174CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER=2
175