-
Notifications
You must be signed in to change notification settings - Fork 1.4k
samples: esb: add sample showing PRX concurrent operation with BLE #25625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maje-emb
wants to merge
1
commit into
nrfconnect:main
Choose a base branch
from
maje-emb:esb_mpls_prx_sample
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,8 @@ FEM support | |
|
|
||
| .. include:: /includes/sample_fem_support.txt | ||
|
|
||
| .. _esb_prx_testing: | ||
|
|
||
| Testing | ||
| ======= | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
| cmake_minimum_required(VERSION 3.20.0) | ||
|
|
||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
| project(esb_prx_ble) | ||
|
|
||
| # NORDIC SDK APP START | ||
| target_sources(app PRIVATE | ||
| src/main.c | ||
| ) | ||
| # NORDIC SDK APP END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| source "Kconfig.zephyr" | ||
|
|
||
| menu "Enhanced ShockBurst: Receiver BLE" | ||
|
|
||
| module = ESB_PRX_BLE | ||
| module-str = "ESB_PRX_BLE" | ||
| source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" | ||
|
|
||
| endmenu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| source "share/sysbuild/Kconfig" | ||
|
|
||
| config NRF_DEFAULT_EMPTY | ||
| default y if SOC_SERIES_NRF53X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| .. _esb_prx_ble: | ||
|
|
||
| Enhanced ShockBurst: Receiver with Bluetooth LE | ||
| ################################################ | ||
|
|
||
| .. contents:: | ||
| :local: | ||
| :depth: 2 | ||
|
|
||
| The sample shows how to use the :ref:`ug_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: | ||
|
|
||
| .. table-from-sample-yaml:: | ||
|
|
||
| Additionally, if you want to test the Enhanced ShockBurst Transmitter functionality, you need to build and run the :ref:`esb_ptx` 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 :ref:`esb_README` 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 kit that runs the :ref:`Transmitter <esb_ptx>` sample are picked up by the kit that runs 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 cooperative operation 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 :ref:`lbs_readme` alongside the ESB receiver functionality, enabling simultaneous wireless communication using both protocols. | ||
|
|
||
| User interface | ||
| *************** | ||
|
|
||
| All LEDs: | ||
| Indicate that packets are sent or received. | ||
| The first four packets turn on the LEDs sequentially. | ||
| The next four packets turn them off again in the same order. | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. group-tab:: nRF52 and nRF53 DKs | ||
|
|
||
| LED 1: | ||
| Lit when the development kit is connected. | ||
|
|
||
| LED 2: | ||
| Lit when the development kit is controlled remotely from the connected device. | ||
|
|
||
| LED 3 and LED 4: | ||
| Indicate that packets are received. | ||
|
|
||
| Button 1: | ||
| Send a notification with the button state: "pressed" or "released". | ||
|
|
||
| .. group-tab:: nRF54 DKs | ||
|
|
||
| LED 0: | ||
| Lit when the development kit is connected. | ||
|
|
||
| LED 1: | ||
| Lit when the development kit is controlled remotely from the connected device. | ||
|
|
||
| LED 2 and LED 3: | ||
| Indicate that packets are received. | ||
|
|
||
| Button 0: | ||
| Send a notification with the button state: "pressed" or "released". | ||
|
|
||
| Configuration | ||
| ************* | ||
|
|
||
| |config| | ||
|
|
||
| Building and running | ||
| ******************** | ||
|
|
||
| The Receiver sample can be found under :file:`samples/esb/esb_prx_ble` in the |NCS| folder structure. | ||
|
|
||
| See :ref:`building` and :ref:`programming` for information about how to build and program the application, respectively. | ||
|
|
||
| .. include:: /includes/nRF54H20_erase_UICR.txt | ||
|
|
||
| FEM support | ||
| =========== | ||
|
|
||
| .. include:: /includes/sample_fem_support.txt | ||
|
|
||
| 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 testing procedure described in the :ref:`Testing section of the Enhanced ShockBurst: Receiver <esb_prx_testing>` sample documentation. | ||
| In brief, you need to program the Transmitter sample (:ref:`esb_ptx`) 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 testing procedure described in the :ref:`Testing section of LBS <peripheral_lbs_testing>` sample documentation. | ||
| 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 |NCS| libraries: | ||
|
|
||
| * :ref:`esb_readme` | ||
| * :ref:`ug_ble` | ||
| * :ref:`mpsl` | ||
| * :ref:`lbs_readme` | ||
|
|
||
| In addition, it uses the following Zephyr libraries: | ||
|
|
||
| * :file:`include/zephyr/types.h` | ||
| * :ref:`zephyr:logging_api` | ||
| * :ref:`zephyr:kernel_api`: | ||
|
|
||
| * :file:`include/kernel.h` | ||
| * :file:`include/irq.h` | ||
|
|
||
| * :ref:`zephyr:api_peripherals`: | ||
|
|
||
| * :file:`include/gpio.h` |
64 changes: 64 additions & 0 deletions
64
samples/esb/esb_prx_ble/boards/nrf54h20dk_nrf54h20_cpurad.overlay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /* | ||
| * Copyright (c) 2025 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| */ | ||
|
|
||
| / { | ||
| leds { | ||
| compatible = "gpio-leds"; | ||
|
|
||
| led0: led_0 { | ||
| gpios = < &gpio9 0 GPIO_ACTIVE_HIGH >; | ||
| label = "Green LED 0"; | ||
| }; | ||
|
|
||
| led1: led_1 { | ||
| gpios = < &gpio9 1 GPIO_ACTIVE_HIGH >; | ||
| label = "Green LED 1"; | ||
| }; | ||
|
|
||
| led2: led_2 { | ||
| gpios = < &gpio9 2 GPIO_ACTIVE_HIGH >; | ||
| label = "Green LED 2"; | ||
| }; | ||
|
|
||
| led3: led_3 { | ||
| gpios = < &gpio9 3 GPIO_ACTIVE_HIGH >; | ||
| label = "Green LED 3"; | ||
| }; | ||
| }; | ||
|
|
||
| aliases { | ||
| led0 = &led0; | ||
| led1 = &led1; | ||
| led2 = &led2; | ||
| led3 = &led3; | ||
| }; | ||
|
|
||
| cpurad_cpusys_errata216_mboxes: errata216_mboxes { | ||
| compatible = "zephyr,mbox-ipm"; | ||
| status = "okay"; | ||
| mboxes = < &cpusys_vevif 0x14 >, < &cpusys_vevif 0x15 >; | ||
| mbox-names = "on_req", "off_req"; | ||
| }; | ||
| }; | ||
|
|
||
| &gpio9 { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &gpio0 { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &gpiote130 { | ||
| owned-channels = <0 1 2 3 4 5 6 7>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &dppic020 { | ||
| status = "okay"; | ||
| source-channels = < 0 1 2 3 4 5 >; | ||
| sink-channels = < 6 7 8 9 10 11 >; | ||
| }; |
8 changes: 8 additions & 0 deletions
8
samples/esb/esb_prx_ble/boards/nrf54l15dk_nrf54l05_cpuapp.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| # Enable DPPI driver | ||
| CONFIG_NRFX_DPPI10=y |
8 changes: 8 additions & 0 deletions
8
samples/esb/esb_prx_ble/boards/nrf54l15dk_nrf54l10_cpuapp.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| # Enable DPPI driver | ||
| CONFIG_NRFX_DPPI10=y |
8 changes: 8 additions & 0 deletions
8
samples/esb/esb_prx_ble/boards/nrf54l15dk_nrf54l15_cpuapp.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| # Enable DPPI driver | ||
| CONFIG_NRFX_DPPI10=y |
8 changes: 8 additions & 0 deletions
8
samples/esb/esb_prx_ble/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| # Enable DPPI driver | ||
| CONFIG_NRFX_DPPI10=y |
8 changes: 8 additions & 0 deletions
8
samples/esb/esb_prx_ble/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| # Enable DPPI driver | ||
| CONFIG_NRFX_DPPI10=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # | ||
| # Copyright (c) 2025 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
| CONFIG_NCS_SAMPLES_DEFAULTS=y | ||
| CONFIG_ESB=y | ||
| CONFIG_DK_LIBRARY=y | ||
| CONFIG_CLOCK_CONTROL=y | ||
|
|
||
| CONFIG_ESB_MPSL_TIMESLOT=y | ||
| CONFIG_MPSL_TIMESLOT_SESSION_COUNT=2 | ||
|
|
||
| CONFIG_BT=y | ||
| CONFIG_BT_PERIPHERAL=y | ||
| CONFIG_BT_DEVICE_NAME="Nordic_LBS" | ||
|
|
||
| # Enable the LBS service | ||
| CONFIG_BT_LBS=y | ||
| CONFIG_BT_LBS_POLL_BUTTON=y | ||
| CONFIG_BT_GATT_CLIENT=y | ||
| CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 | ||
|
|
||
| # Bluetooth LE configuration | ||
| # Adjust connection parameters to your needs | ||
| CONFIG_BT_PERIPHERAL_PREF_MIN_INT=800 | ||
| CONFIG_BT_PERIPHERAL_PREF_MAX_INT=800 | ||
| CONFIG_BT_PERIPHERAL_PREF_LATENCY=0 | ||
| CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400 | ||
|
|
||
| # Enable DEBUG level logging | ||
| CONFIG_ESB_PRX_BLE_LOG_LEVEL_DBG=y | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| sample: | ||
| name: ESB prx BLE Sample | ||
| common: | ||
| harness: console | ||
| harness_config: | ||
| type: multi_line | ||
| ordered: true | ||
| regex: | ||
| - "Starting Enhanced ShockBurst prx with Peripheral LBS sample" | ||
| - "Bluetooth initialized" | ||
| - "Advertising successfully started" | ||
| - "ESB initialized" | ||
| - "Setting up for packet reception" | ||
| - "Initialization complete" | ||
| timeout: 15 | ||
|
|
||
| tests: | ||
| sample.esb.prx.ble.build: | ||
| sysbuild: true | ||
| integration_platforms: | ||
| - nrf54h20dk/nrf54h20/cpurad | ||
| - nrf54l15dk/nrf54l05/cpuapp | ||
| - nrf54l15dk/nrf54l10/cpuapp | ||
| - nrf54l15dk/nrf54l15/cpuapp | ||
| - nrf54lm20dk/nrf54lm20a/cpuapp | ||
| - nrf54lv10dk/nrf54lv10a/cpuapp | ||
| platform_allow: | ||
| - nrf54h20dk/nrf54h20/cpurad | ||
| - nrf54l15dk/nrf54l05/cpuapp | ||
| - nrf54l15dk/nrf54l10/cpuapp | ||
| - nrf54l15dk/nrf54l15/cpuapp | ||
| - nrf54lm20dk/nrf54lm20a/cpuapp | ||
| - nrf54lv10dk/nrf54lv10a/cpuapp | ||
| tags: | ||
| - esb | ||
| - ci_build | ||
| - sysbuild | ||
| - ci_samples_esb |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.