Bluetooth: UTP

This sample builds a Bluetooth® LE HCI controller that is accessed over UART and that supports the Unified Test Protocol (UTP), the Nordic UTP extensions, and Direct Test Mode (DTM) over HCI.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Board target

nRF7120 DK

PCA10217

nrf7120dk

nrf7120dk/nrf7120/cpuapp

nRF54LV10 DK

PCA10188

nrf54lv10dk

nrf54lv10dk/nrf54lv10a/cpuapp

nRF54LS05 DK

PCA10214

nrf54ls05dk

nrf54ls05dk/nrf54ls05b/cpuapp nrf54ls05dk/nrf54ls05a/cpuapp

nRF54LM20 DK

PCA10184

nrf54lm20dk

nrf54lm20dk/nrf54lm20b/cpuapp

nRF54LC10 DK

PCA10226

nrf54lc10dk

nrf54lc10dk/nrf54lc10a/cpuapp

nRF54L15 DK

PCA10156

nrf54l15dk

nrf54l15dk/nrf54l15/cpuapp

nRF54L15 DK (emulating nRF54L10)

PCA10156

nrf54l15dk

nrf54l15dk/nrf54l10/cpuapp

nRF54L15 DK (emulating nRF54L05)

PCA10156

nrf54l15dk

nrf54l15dk/nrf54l05/cpuapp

nRF54H20 DK

PCA10175

nrf54h20dk

nrf54h20dk/nrf54h20/cpurad

Additionally, the sample requires one of the following testing devices:

  • Dedicated test equipment that supports HCI over UART and the Unified Test Protocol. This can be, for example, a Bluetooth RFPHY tester. See Testing.

  • A computer that sends HCI commands over the serial port of the development kit.

Overview

The sample is based on the Zephyr HCI UART async sample. It runs the Bluetooth LE controller on the device and exposes it to the host as an HCI H4 transport over UART. The controller supports the following test features:

  • UTP

  • Nordic UTP extensions

  • DTM over HCI

You can use the sample to test the following features of the radio:

  • Transmission power and receiver sensitivity

  • Frequency offset and drift

  • Modulation characteristics

  • Packet error rate

  • Intermodulation performance

Implementation

The sample reuses the sources of the Zephyr HCI UART async sample. The controller is configured in the prj.conf file and the UART used for HCI is selected in a devicetree overlay.

Unlike the Bluetooth: Direct Test Mode sample, no conversion between the 2-wire UART protocol and HCI is needed, because the host speaks HCI directly.

UART configuration

The UART that carries the HCI traffic is set as the zephyr,bt-c2h-uart chosen node and is configured to run at 1000000 baud with hardware flow control. The sample removes the console, shell, MCUmgr, and Bluetooth monitor assignments from the chosen nodes, so that they do not interfere with the HCI UART.

Each supported board has its own overlay in the boards directory. The following table lists the UART instances used on each board:

Board target

HCI UART

nrf54h20dk/nrf54h20/cpurad

uart135

nrf54l15dk/nrf54l05/cpuapp, nrf54l15dk/nrf54l10/cpuapp, nrf54l15dk/nrf54l15/cpuapp

uart20

nrf54lc10dk/nrf54lc10a/cpuapp

uart30

nrf54lm20dk/nrf54lm20b/cpuapp

uart20

nrf54ls05dk/nrf54ls05a/cpuapp, nrf54ls05dk/nrf54ls05b/cpuapp

uart20

nrf54lv10dk/nrf54lv10a/cpuapp

uart20

nrf7120dk/nrf7120/cpuapp

uart20

Configuration

See Configuring and building for information about how to permanently or temporarily change the configuration.

Configuration options

The sample configuration is in the prj.conf file. To enable and configure UTP, the sample enables the following Kconfig options:

Debugging

The HCI UART is the only UART used by the sample. The console, shell and Bluetooth monitor are not available on it, and the default configuration does not enable logging. If you want to view debug messages, enable logging with an alternative backend, such as RTT. See Testing and optimization and Debugging an application for details.

Building and running

This sample can be found under samples/bluetooth/utp in the nRF Connect SDK folder structure.

To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.

Note

When building repository applications in the SDK repositories, building with sysbuild is enabled by default. If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.

Testing

After programming the sample to your development kit, connect the host to the serial port of the HCI UART. Use eight data bits, no parity, one stop bit, a baud rate of 1000000 and hardware flow control enabled. Then send HCI commands to the controller, using one of the following methods:

  • Use a certified tester or an RFPHY tester that supports HCI over UART. The setup and test procedures depend on the tester used. See the tester documentation for details.

  • Use a host application that implements the HCI H:4 transport and sends the UTP commands.

A typical test sequence consists of the following steps:

  1. Reset the controller using the HCI Reset command.

  2. Enable the LE meta event using the Set Event Mask command.

  3. Enable the LE UTP Receive event using the LE Set Event Mask command.

  4. Configure the test, for example the PHY, the packet length, the packet pattern and the frequency, using the LE UTP Send command.

  5. Observe the LE UTP Receive event to check if the parameters were accepted.

  6. Start the test, for example a transmitter or receiver test, using the LE UTP Send command.

  7. Observe the LE UTP Receive event to check if the test was started.

  8. End the test and read the result, for example the number of received packets.

Dependencies

This sample uses the following Zephyr libraries: