Bluetooth: External radio coexistence using three-wire interface

This sample demonstrates how to use Bluetooth® external radio coexistence.

Overview

The application sets up an advertiser, and implements a rudimentary PTA in order to test coexistence. User enters g to grant or d to deny requests from Bluetooth. Since this is a basic implementation, the decision to grant or deny does not consider priority or direction of the requests.

  • When requests from Bluetooth are granted, packets will be transmitted.

  • When requests from Bluetooth are denied, no packets will be transmitted.

  • Number of packets transmitted is tracked by counting RADIO->READY event.

  • The total number of transmitted packets will be printed every second.

The application generates a grant signal on the pin selected by coex-pta-grant-gpios. This pin has to be connected to the pin defined by the grant-gpios property in the DTS using a jumper.

  • On nrf52840dk_nrf52840, the default pins are P0.26 and P0.02.

The application senses request signal on the pin selected by coex-pta-req-gpios. This pin has to be connected to the pin defined by the req-gpios property in the DTS using a jumper.

  • On nrf52840dk_nrf52840, the default pins are P0.28 and P0.03.

These two properties are defined in the DTS:

The board’s /zephyr,user node must have coex-pta-grant-gpios and coex-pta-req-gpios properties set. This sample’s board overlay can be used as an example.

Requirements

The sample supports the following development kit:

Hardware platforms

PCA

Board name

Build target

nRF52840 DK

PCA10056

nrf52840dk_nrf52840

nrf52840dk_nrf52840

Building and running

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

See Building and programming an application for information about how to build and program the application.

Testing

  1. Connect pin coex-pta-grant-gpios to pin grant-gpios on your development kit.

  2. Connect pin coex-pta-req-gpios to pin req-gpios on your development kit.

  3. Build and program the development kit.

  4. Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.

  5. Watch the number of packets transmitted.

  6. Enter d to deny packet transmission.

  7. Enter g to grant packet transmission.

Dependencies

This sample uses the following sdk-nrfxlib libraries:

The sample also uses drivers from nrfx libraries.

The sample uses the following Zephyr libraries: