Enhanced ShockBurst: Receiver with Bluetooth LE

The sample shows how to use the Enhanced ShockBurst (ESB) protocol in receiver mode concurrently with Bluetooth® LE protocol. It demonstrates how to configure the Enhanced ShockBurst protocol to receive packets while simultaneously running Bluetooth LE services.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Board target

nRF54LV10 DK

PCA10188

nrf54lv10dk

nrf54lv10dk/nrf54lv10a/cpuapp

nRF54LS05 DK

PCA10214

nrf54ls05dk

nrf54ls05dk/nrf54ls05b/cpuapp

nRF54LM20 DK

PCA10184

nrf54lm20dk

nrf54lm20dk/nrf54lm20b/cpuapp nrf54lm20dk/nrf54lm20a/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

nRF52 DK

PCA10040

nrf52dk

nrf52dk/nrf52832

nRF52840 DK

PCA10056

nrf52840dk

nrf52840dk/nrf52840

nRF52833 DK

PCA10100

nrf52833dk

nrf52833dk/nrf52833

Additionally, if you want to test the Enhanced ShockBurst Transmitter functionality, you need to build and run the Enhanced ShockBurst: Transmitter sample. You can use any two of the listed development kits and mix different development kits.

Overview

The sample consists of one Receiver that uses the Enhanced ShockBurst library in combination with Bluetooth LE functionality. After building and programming the sample on a development kit, you can test that packets that are sent by the Transmitter sample are picked up by the Receiver sample. Successful communication is indicated by LED changes.

The Receiver sample listens for packets and sends an ACK when a packet is received. If packets are successfully received from the Transmitter, the LED pattern changes every time a packet is received.

The sample demonstrates cooperation between ESB and Bluetooth LE protocols using the MPSL (Multiprotocol Service Layer) time slot mechanism. This mechanism allows both protocols to share radio time without interference. The sample runs the LED Button Service (LBS) alongside the ESB receiver functionality, enabling simultaneous wireless communication using both protocols. This LBS functionality is used to transmit the button state to connected BLE device and remotely control the LED on your development kit from connected BLE device.

User interface

LED 1:

Lit when the development kit is connected to BLE device.

LED 2:

Lit when the development kit is controlled remotely from the connected BLE device.

LED 3 and LED 4:

Indicate that packets are received. The first two packets turn on the LEDs sequentially. The next two packets turn them off again in the same order.

Button 1:

Send a notification with the button state: “pressed” or “released”.

Configuration

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

Building and running

The Receiver sample is located under samples/esb/esb_prx_ble in the nRF Connect SDK folder structure.

See Building an application and Programming an application for information about how to build and program the application, respectively.

FEM support

You can add support for the nRF21540 front-end module to this sample by using one of the following options, depending on your hardware:

  • Build the sample for one board that contains the nRF21540 FEM, such as nRF21540 DK.

  • Manually create a devicetree overlay file that describes how the nRF21540 FEM is connected to the SoC. See Configuring devicetree for different ways of adding the overlay file.

  • Provide nRF21540 FEM capabilities by using a shield, for example the nRF21540 EK shield that is available in the nRF Connect SDK. In this case, build the project for a board connected to the shield you are using with an appropriate variable included in the build command, for example -DSHIELD=nrf21540ek. This variable instructs the build system to append the appropriate devicetree overlay file.

    To build the sample in nRF Connect for VS Code for an nRF52840 DK with the nRF21540 EK attached, add the shield variable in the build configuration’s Extra CMake arguments and rebuild the build configuration. For example: -DSHIELD=nrf21540ek.

    See How to work with build configurations in the nRF Connect for VS Code documentation for more information.

    See Programming nRF21540 EK for information about how to program when you are using a board with a network core, for example the nRF5340 DK.

Each of these options adds the description of the nRF21540 FEM to the devicetree. See Developing with Front-End Modules for more information about FEM in the nRF Connect SDK.

To add support for other front-end modules, add the respective devicetree file entries to the board devicetree file or the devicetree overlay file.

Testing

This sample combines ESB receiver functionality with Bluetooth LE LBS service, and both protocols can be tested independently.

Testing ESB functionality

To test the ESB receiver functionality, follow the procedure described in the Testing section. In brief, you need to program the Enhanced ShockBurst: Transmitter sample on another development kit and observe that the LEDs change synchronously on both kits as packets are transmitted and received.

Testing LBS service

To test the Bluetooth LE LBS service functionality, follow the procedure described in the Testing section. You can use a smartphone or tablet with the nRF Connect for Mobile or nRF Blinky application to connect to the device (advertising as Nordic_LBS), control the LED remotely, and receive button press notifications.

Dependencies

This sample uses the following nRF Connect SDK libraries:

In addition, it uses the following Zephyr libraries:

  • include/zephyr/types.h

  • Logging

  • Kernel Services:

    • include/kernel.h

    • include/irq.h

  • Peripherals:

    • include/gpio.h

  • API:

    • include/bluetooth/bluetooth.h

    • include/bluetooth/hci.h

    • include/bluetooth/conn.h

    • include/bluetooth/uuid.h

    • include/bluetooth/gatt.h