1.. _bluetooth_direction_finding_peripheral:
2
3Bluetooth: Direction Finding Peripheral
4#######################################
5
6Overview
7********
8
9A simple application demonstrating the BLE Direction Finding CTE transmission in
10connected mode by response to a request received from connected peer device.
11
12Requirements
13************
14
15* Nordic nRF SoC based board with Direction Finding support (example boards:
16  :ref:`nrf52833dk_nrf52833`, :ref:`nrf52833dk_nrf52820`, :ref:`nrf5340dk_nrf5340`)
17* Antenna matrix for AoA (optional)
18
19Check your SoC's product specification for Direction Finding support if you are
20unsure.
21
22Building and Running
23********************
24
25By default the application supports Angle of Arrival and Angle of Departure mode.
26
27To use Angle of Arrival mode only, build this application as follows,
28changing ``nrf52833dk_nrf52833`` as needed for your board:
29
30.. zephyr-app-commands::
31   :zephyr-app: samples/bluetooth/direction_finding_peripheral
32   :host-os: unix
33   :board: nrf52833dk_nrf52833
34   :gen-args: -DEXTRA_CONF_FILE=overlay-aoa.conf
35   :goals: build flash
36   :compact:
37
38To run the application on nRF5340DK, a Bluetooth controller application must
39also run on the network core. The :ref:`bluetooth-hci-ipc-sample` sample
40application may be used. To build this sample with direction finding support
41enabled:
42
43* Copy
44  :zephyr_file:`samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.overlay`
45  to a new file,
46  :file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
47* Make sure the same GPIO pins are assigned to Direction Finding Extension in file
48  :zephyr_file:`samples/bluetooth/direction_finding_peripheral/boards/nrf5340dk_nrf5340_cpuapp.overlay`.
49  as those in the created file :file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
50* Copy
51  :zephyr_file:`samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.conf`
52  to a new file,
53  :file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.conf`.
54
55Antenna matrix configuration
56****************************
57
58To use this sample with Angle of Departure enabled on Nordic SoCs, additional
59configuration must be provided via :ref:`devicetree <dt-guide>` to enable
60control of the antenna array.
61
62An example devicetree overlay is in
63:zephyr_file:`samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.overlay`.
64You can customize this overlay when building for the same board, or create your
65own board-specific overlay in the same directory for a different board. See
66:dtcompatible:`nordic,nrf-radio` for documentation on the properties used in
67this overlay. See :ref:`set-devicetree-overlays` for information on setting up
68and using overlays.
69
70Note that antenna matrix configuration for the nRF5340 SoC is part of the
71network core application. When :ref:`bluetooth-hci-ipc-sample` is used as the
72network core application, the antenna matrix configuration should be stored in
73the file
74:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`
75instead.
76