Skip to content
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

samples: bluetooth: radio_coex_1wire: Add support for nRF54H20 (cpurad) and nRF54L15 #17507

Merged
merged 4 commits into from
Oct 2, 2024

Conversation

PavelVPV
Copy link
Contributor

This PR adds support for nRF54H20 (for radio core) and nRF54L15 to radio_coex_1wire sample.

Major changes:

  • The timer counter has been replaced with egu to avoid hardcoding peripherals due to current limitations of nrfx_gppi library. See commit message for the details.
  • A binding file has been added to make nrf-regtool pick up gpio and request access to it through uicr for the radio core. See commit message for the details.

Please note that the sample requires NRFX-6423 to be fixed to run on nRF54H20. Or a workaround can be applied for testing.

This aligns the overlay file with other dts files that commonly use
tabulation.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
@PavelVPV PavelVPV requested review from a team as code owners September 26, 2024 12:25
@github-actions github-actions bot added doc-required PR must not be merged without tech writer approval. changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Sep 26, 2024
This change uses egu interrupts instead of timer counter to count radio
ready events.

This is a preparation commit for nRF54L15. In nRF54L15 the timer on the
same PD is occupied by SDC. To access the nearest available timer we
need to use PPIB.

Also, since MPSL uses predefined channels for radio events on hardware
with DPPIC support, the predefined channel needs to be used with
nrfx_gppi library. But the library doesn't support predefined channels
at this moment, it always allocates a new channel, therefore can't be
used at the moment. Because of this, we have to hardcode peripherals
(DPPIC20, PPIB11, PPIB21 and TIMER20) in the sample which doesn't look
correct. Also, bypassing nrfx_gppi may create conflicts if someone else
is gets allocated the same channel through nrfx_gppi (e.g. if an
implementor copy-pastes this code and uses it together with nrfx_gppi
library). With EGU we don't have these issues on nRF54L15.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
@PavelVPV PavelVPV force-pushed the radio_coex_1wire_nrf54h20_nrf54l15 branch from 6062d0c to b87fe3b Compare September 26, 2024 12:40
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 26, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 6

Inputs:

Sources:

sdk-nrf: PR head: 74c7a3c56bd2325a3d33d94b395207ddcb2cddc3

more details

sdk-nrf:

PR head: 74c7a3c56bd2325a3d33d94b395207ddcb2cddc3
merge base: 054a0845729f397756da2b180ba8571fcac7111a
target head (main): 0a59bda839b042c08ec52158a13653ec1f4bdeae
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (9)
samples
│  ├── bluetooth
│  │  ├── radio_coex_1wire
│  │  │  ├── CMakeLists.txt
│  │  │  ├── README.rst
│  │  │  ├── boards
│  │  │  │  ├── nrf52840dk_nrf52840.overlay
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpurad.overlay
│  │  │  │  │ nrf54l15dk_nrf54l15_cpuapp.overlay
│  │  │  ├── dts
│  │  │  │  ├── bindings
│  │  │  │  │  │ coex-pta-grant-gpios.yaml
│  │  │  ├── prj.conf
│  │  │  ├── sample.yaml
│  │  │  ├── src
│  │  │  │  │ main.c

Outputs:

Toolchain

Version: 9583beca34
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:9583beca34_81ed5a52d6

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 409
  • ✅ Integration tests
    • ✅ test-fw-nrfconnect-ble_samples
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_nrf_provisioning
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

@@ -30,11 +30,31 @@ Enter ``g`` to grant or ``d`` to deny Bluetooth radio activity.
The application generates a grant signal on the pin selected by ``coex-pta-grant-gpios``.
Connect this pin to the pin defined by the ``grant-gpios`` property in the DTS using a jumper cable.

On the ``nrf52840dk_nrf52840`` target, the default pins are **P0.26** and **P0.02**.
The following table shows the default pins used for this sample by each supported target:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following table shows the default pins used for this sample by each supported target:
The following table shows the default pins used for this sample for each supported target:

Comment on lines 53 to 59
For the ``nrf54h20dk/nrf54h20/cpurad`` target in the board's devicetree file you must define a node with the compatible property set to ``"coex-pta-grant-gpios"``.
Then set the ``coex-pta-grant-gpios`` property of that node to the desired pin.
This is needed for proper configuration of the UICR register in order to get an access to the pin from the core the application is running on.
See the :file:`boards/nrf54h20dk_nrf54h20_cpurad.overlay` file for an example.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For the ``nrf54h20dk/nrf54h20/cpurad`` target in the board's devicetree file you must define a node with the compatible property set to ``"coex-pta-grant-gpios"``.
Then set the ``coex-pta-grant-gpios`` property of that node to the desired pin.
This is needed for proper configuration of the UICR register in order to get an access to the pin from the core the application is running on.
See the :file:`boards/nrf54h20dk_nrf54h20_cpurad.overlay` file for an example.
For the ``nrf54h20dk/nrf54h20/cpurad`` target in the board's devicetree file, you must define a node with the compatible property set to ``coex-pta-grant-gpios``.
Then set the ``coex-pta-grant-gpios`` property of that node to the desired pin.
This is needed to properly configure the UICR register and get a pin access from the core the application is running on.
See the :file:`boards/nrf54h20dk_nrf54h20_cpurad.overlay` file for an example.

@PavelVPV PavelVPV force-pushed the radio_coex_1wire_nrf54h20_nrf54l15 branch from b87fe3b to 771e685 Compare September 27, 2024 07:37
Comment on lines 31 to 59
Connect this pin to the pin defined by the ``grant-gpios`` property in the DTS using a jumper cable.

On the ``nrf52840dk_nrf52840`` target, the default pins are **P0.26** and **P0.02**.
The following table shows the default pins used for this sample for each supported target:

.. table::
:align: center

+----------------------------+----------------------+-------------+
| Target | coex-pta-grant-gpios | grant-gpios |
+============================+======================+=============+
| nrf52840dk/nrf52840 | P0.26 | P0.02 |
+----------------------------+----------------------+-------------+
| nrf54l15dk/nrf54l15/cpuapp | P0.00 | P0.02 |
+----------------------------+----------------------+-------------+
| nrf54h20dk/nrf54h20/cpurad | P0.00 | P0.02 |
+----------------------------+----------------------+-------------+


The board's :ref:`/zephyr,user <dt-zephyr-user>` node must have the ``coex-pta-grant-gpios`` property set in the devicetree.
You can use this sample's board overlay as an example.

.. note:
For the ``nrf54h20dk/nrf54h20/cpurad`` target in the board's devicetree file, you must define a node with the compatible property set to ``coex-pta-grant-gpios``.
Then set the ``coex-pta-grant-gpios`` property of that node to the desired pin.
This is needed to properly configure the UICR register and get a pin access from the core the application is running on.
See the :file:`boards/nrf54h20dk_nrf54h20_cpurad.overlay` file for an example.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a Wiring section or Configuration/Setup, not Overview. https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/templates/sample_README.html#wiring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to Wiring section.

This commit adds support for nRF54L15 DK.

On platforms with DPPI support, MPSL library uses predefined channels
for radio events. SDC does configuration of radio and dppic. Therefore
we only need to subscribe egu on the predefined channel.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
@PavelVPV PavelVPV force-pushed the radio_coex_1wire_nrf54h20_nrf54l15 branch from 771e685 to 26cc9fd Compare September 27, 2024 08:33
@PavelVPV PavelVPV force-pushed the radio_coex_1wire_nrf54h20_nrf54l15 branch from 26cc9fd to e4ab45c Compare September 27, 2024 09:08
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

description: |
Coexistence PTA (Power Transmitter Amplifier) grant GPIOs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Coexistence PTA (Power Transmitter Amplifier) grant GPIOs
Coexistence PTA (Packet Traffic Arbiter) grant GPIOs

This commit adds support for nRF54H20 for this sample.

Explicit binding and extra node is needed because nrf-regtool doesn't
pick up properties from the zephyr,user node. Because of this, it
doesn't add to the UICR of the radio core the gpio that sample needs.

Other platforms don't have such security mechanism and thus don't need
this workaround.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
@PavelVPV
Copy link
Contributor Author

PavelVPV commented Oct 2, 2024

Hey, @nrfconnect/ncs-si-muffin , could you please look at this PR?

@rlubos rlubos merged commit 172fa02 into nrfconnect:main Oct 2, 2024
13 checks passed
@PavelVPV PavelVPV deleted the radio_coex_1wire_nrf54h20_nrf54l15 branch October 2, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. doc-required PR must not be merged without tech writer approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants