@@ -26,36 +26,18 @@ For running with QEMU or :zephyr:board:`native_sim <native_sim>`, see :ref:`blue
2626Setup Linux
2727***********
2828
29- Install nrftools (only required in the actual hardware test mode)
30- *****************************************************************
29+ Please follow :ref: `getting_started ` on how to setup Linux for building and flashing applications.
3130
32- Download latest nrftools (version >= 10.12.1) from site
33- https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools/Download.
34-
35- .. image :: download_nrftools_linux.png
36- :height: 350
37- :width: 600
38- :align: center
39-
40- After you extract archive, you will see 2 .deb files, e.g.:
41-
42- - JLink_Linux_V688a_x86_64.deb
43-
44- - nRF-Command-Line-Tools_10_12_1_Linux-amd64.deb
45-
46- and README.md. To install the tools, double click on each .deb file or follow
47- instructions from README.md.
48-
49- Setup Windows 10 virtual machine
50- ********************************
31+ Setup Windows 10/11 virtual machine
32+ ***********************************
5133
5234Choose and install your hypervisor like VMWare Workstation(preferred) or
5335VirtualBox. On VirtualBox could be some issues, if your host has fewer than 6 CPU.
5436
5537Create Windows virtual machine instance. Make sure it has at least 2 cores and
5638installed guest extensions.
5739
58- Setup tested with VirtualBox 7.1 .4 and VMWare Workstation 16.1.1 Pro.
40+ Setup tested with VirtualBox 7.2 .4 and VMWare Workstation 16.1.1 Pro.
5941
6042Update Windows
6143==============
@@ -186,10 +168,10 @@ consoles. We will use Git Bash as Windows terminal.
186168 :width: 400
187169 :align: center
188170
189- Install PTS 8
190- =============
171+ Install PTS
172+ ===========
191173
192- On Windows virtual machine, install latest PTS from https://www .bluetooth.org .
174+ On Windows virtual machine, install the latest PTS from https://pts .bluetooth.com/download .
193175Remember to install drivers from installation directory
194176"C:/Program Files (x86)/Bluetooth SIG/Bluetooth PTS/PTS Driver/win64/CSRBlueCoreUSB.inf"
195177
@@ -245,16 +227,6 @@ Connect devices (only required in the actual hardware test mode)
245227 :width: 500
246228 :align: center
247229
248- Flash board (only required in the actual hardware test mode)
249- ************************************************************
250-
251- On Linux, go to ~/zephyrproject. There should be already ~/zephyrproject/build
252- directory. Flash board:
253-
254- .. code-block ::
255-
256- west flash
257-
258230Setup auto-pts project
259231**********************
260232
@@ -279,7 +251,6 @@ Install required python modules:
279251.. code-block ::
280252
281253 cd auto-pts
282- pip3 install --user wheel
283254 pip3 install --user -r autoptsclient_requirements.txt
284255
285256 Autopts server on Windows virtual machine
@@ -301,9 +272,14 @@ Install required python modules:
301272 Restart virtual machine.
302273
303274Running AutoPTS
304- ****************
275+ ***************
276+
277+ Please follow the information from
278+ https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/bluetooth/tester on how to build,
279+ flash and run the Bluetooth Tester application.
305280
306- Server and client by default will run on localhost address. Run server:
281+ Server and client by default will run on localhost address.
282+ Run the server in the Windows virtual machine:
307283
308284.. code-block ::
309285
@@ -314,59 +290,89 @@ Server and client by default will run on localhost address. Run server:
314290 :width: 700
315291 :align: center
316292
317- Testing Zephyr Host Stack on QEMU:
293+ See also https://github.com/auto-pts/auto-pts for additional information on how to run auto-pts.
294+
295+ Testing Zephyr Host Stack on hardware
296+ =====================================
318297
319298.. code-block ::
320299
321- # A Bluetooth controller needs to be mounted.
322- # For running with HCI UART, please visit: https://docs.zephyrproject.org/latest/samples/bluetooth/hci_uart/README.html#bluetooth-hci-uart
300+ python ./autoptsclient-zephyr.py zephyr-master -t /dev/ttyACM0 -b BOARD -i SERVER_IP -l LOCAL_IP
323301
324- python ./autoptsclient-zephyr.py "C:\Users\USER_NAME\Documents\Profile Tuning Suite\PTS_PROJECT\PTS_PROJECT.pqw6" \
325- ~/zephyrproject/build/zephyr/zephyr.elf -i SERVER_IP -l LOCAL_IP
302+ Where ``/dev/ttyACM0 `` is the tty for the board,
303+ ``BOARD `` is the board to use (e.g. ``nrf53_audio ``),
304+ ``SERVER_IP `` is the IP of the AutoPTS server,
305+ ``LOCAL_IP `` is the local IP of the Linux machine.
326306
307+ Testing Zephyr Host Stack on QEMU
308+ =================================
327309
328- Testing Zephyr Host Stack on :zephyr:board: `native_sim <native_sim> `:
310+ A Bluetooth controller needs to be mounted.
311+ For running with HCI UART, please visit :zephyr:code-sample: `bluetooth_hci_uart `.
329312
330313.. code-block ::
331314
332- # A Bluetooth controller needs to be mounted.
333- # For running with HCI UART, please visit: https://docs.zephyrproject.org/latest/samples/bluetooth/hci_uart/README.html#bluetooth-hci-uart
315+ python ./autoptsclient-zephyr.py zephyr-master BUILD_DIR/zephyr/zephyr.elf -i SERVER_IP -l LOCAL_IP
334316
335- west build -b native_sim zephyr/tests/bluetooth/tester/ -DEXTRA_CONF_FILE=overlay-native.conf
317+ Where ``BUILD_DIR `` is the build directory,
318+ ``SERVER_IP `` is the IP of the AutoPTS server,
319+ ``LOCAL_IP `` is the local IP of the Linux machine.
336320
337- sudo python ./autoptsclient- zephyr.py "C:\Users\USER_NAME\Documents\Profile Tuning Suite\PTS_PROJECT\PTS_PROJECT.pqw6" \
338- ~/zephyrproject/build/zephyr/zephyr.exe -i SERVER_IP -l LOCAL_IP --hci 0
321+ Testing Zephyr Host Stack on : zephyr:board: ` native_sim <native_sim> `
322+ ====================================================================
339323
324+ When tester application has been built for :zephyr:board: `native_sim <native_sim> ` it produces a
325+ ``zephyr.exe `` file, that can be run as a native Linux application.
326+ Depending on your system,
327+ you may need to perform the following steps to successfully run ``zephyr.exe ``.
340328
341- Testing Zephyr combined (controller + host) build on nRF52:
329+ Setting capabilities
330+ --------------------
342331
343- .. note ::
332+ Since the application will need access to connect to a socket for HCI,
333+ you may need to perform the following
344334
345- If the error "ImportError: No module named pywintypes" appeared after the fresh setup,
346- uninstall and install the pywin32 module:
335+ .. code-block ::
347336
348- .. code-block ::
337+ setcap cap_net_raw,cap_net_admin,cap_sys_admin+ep zephyr.exe
349338
350- pip install --upgrade --force-reinstall pywin32
339+ This is not required if you run `` zephyr.exe `` or `` ./autoptsclient-zephyr.py `` with e.g. `` sudo ``.
351340
352- Run client:
341+ Downing the HCI controller
342+ --------------------------
343+
344+ You may also need to "down" or "power off" the HCI controller before running ``zephyr.exe ``.
345+ This can be done either with ``hciconfig `` as
353346
354347.. code-block ::
355348
356- python ./autoptsclient-zephyr.py zephyr-master ~/zephyrproject/build/zephyr/zephyr.elf -t /dev/ACM0 \
357- -b nrf52 -l 192.168.2.1 -i 192.168.2.2
349+ hciconfig hciX down
358350
359- .. image :: autoptsclient_run_2.png
360- :height: 100
361- :width: 800
362- :align: center
351+ Where ``hciX `` is a value like ``hci0 ``. You may run ``hciconfig `` to get a list of your HCI devices.
363352
364- At the first run, when Windows asks, enable connection through firewall:
353+ Since `` hciconfig `` is deprecated on some systems, you may need to use
365354
366- .. image :: allow_firewall_2.png
367- :height: 450
368- :width: 600
369- :align: center
355+ .. code-block ::
356+
357+ btmgmt -i hciX power off
358+
359+ Similar to ``hciconfig ``, ``btmgmt info `` may be used to list current controllers and their states.
360+
361+ Both ``hciconfig `` and ``btmgmt `` may require ``sudo `` when powering down a controller.
362+
363+ Running the client
364+ ------------------
365+
366+ The application can be run as
367+
368+ .. code-block ::
369+
370+ python ./autoptsclient-zephyr.py zephyr-master --hci HCI BUILD_DIR/zephyr/zephyr.exe -i SERVER_IP -l LOCAL_IP
371+
372+ Where ``HCI `` is the HCI index, e.g. ``0 `` or ``1 ``,
373+ ``BUILD_DIR `` is the build directory,
374+ ``SERVER_IP `` is the IP of the AutoPTS server,
375+ ``LOCAL_IP `` is the local IP of the Linux machine.
370376
371377Troubleshooting
372378****************
0 commit comments