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

shields: fem: no more explicit pin forwarder shield #19042

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ankuns
Copy link
Contributor

@ankuns ankuns commented Nov 22, 2024

The problem

The FEM shields for multi-core devices like nRF5340 SoCs until now required a special handling.
Suppose we had FEM shield called fem_shield (just symbolic name here, where fem_shield could be one of nrf21540ek, nrf2220ek, nrf2240ek). The fem_shield itself, as passed to -DSHIELD=fem_shield is applicable only to that core of a SoC which has the RADIO peripheral (cpunet for nRF5340, different combinations for other SoC families). For multi-core SoC's like nrf5340 a special shield had to be passed to application core. Name of the shield had _fwd suffix, like -DSHIELD=fem_shield_fwd. The role of this special shield was to tell the application core to pass the pins required by the FEM to the network core. This becomes even more complicated when there are multiple different image names for every application.

west build --sysbuild -b nrf5340dk/nrf5340/cpuapp -- -D<app_core_image>_SHIELD=<fem_shield> -D<net_core_image>_SHIELD=<fem_shield>_fwd

Some applications like radio_test and dtm samples attempted to make the build more user-friendly requiring to pass just one -DSHIELD=nrf21540ek but it had following limitations:

  • only one shield had been forseen. Every new shield would require to be added to these applications explicity
  • the approach would need to be copy pasted to all sample applications

Proposal in this PR

The proposal is to simplify user experience by allowing to build an application by selecting just -DSHIELD=fem_shield, regardless of the architecture of a SoC (single core, multi core, forwarding needed or not...). The user experience on build would be limited to simple invocation of:

west build --sysbuild -b <board> -- -DSHIELD=fem_shield

The SHIELD variable is passed by sysbuild to all images the build consists of.

If passing SHIELD to every image in the sysbuild is unwanted (because of bootloader or other images involved), an user can still build the application selecting explicit -D<image_name>_SHIELD=fem_shield. However regardless of the core the image is built for, the user now has to pass just one name fem_shield. Again no need to know if "pin-forwarding shield" must be passed or the "real shield" and to which image.

This simplicity in user experience is achieved by handling each supported board on the shield level.
The drawback of this approach is that shields now have explicit list of boards they support and their implementation contains similar code in multiple files in board/ directory (this has been limited somehow in this PR by having "common" directory).

Clear benefit is consistent and simple (from user experience) way building with fem shields regardless of SoC type and no need to provide any "simplification code" on application level (see removed code for radio_test and dtm, while having the same user experience and functionality).

Justification

This PR is a side effect of upcoming support for nrf2220ek and nrf2240ek on the nRF54L15DK will be added. The nRF54L15DK is not arduino-compatible. Adding support for the nRF54L15DK will require switch to a per-board approach on shield level for nrf2220ek and nrf2240ek shields. To have the same user experience among all FEM shields regardless of SoC, the migration to per-board approach is proposed also for nrf21540ek shield.
To simplify review I decided to extract the change in approach to board handling on the shield level to this separate PR.

The chosen per-board approach is also consistient with existing
boards/shields/pca63565
boards/shields/pca63566

@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Nov 22, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Nov 22, 2024

CI Information

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

Inputs:

Sources:

sdk-nrf: PR head: 57eec5498554320e6b14b2465580d998b3acaa8c

more details

sdk-nrf:

PR head: 57eec5498554320e6b14b2465580d998b3acaa8c
merge base: 806111adeddc5ed2e89fcf670bde317d360c3c38
target head (main): a07b87c923420fdbfbdbff3698a3d30f5c1c33ee
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 (47)
CODEOWNERS
applications
│  ├── nrf5340_audio
│  │  ├── doc
│  │  │  │ configuration.rst
│  │  ├── src
│  │  │  ├── bluetooth
│  │  │  │  ├── bt_management
│  │  │  │  │  ├── controller_config
│  │  │  │  │  │  │ Kconfig
│  │  ├── tools
│  │  │  ├── buildprog
│  │  │  │  │ buildprog.py
│  ├── nrf_desktop
│  │  ├── nRF21540ek_support.rst
│  │  │ sample.yaml
boards
│  ├── shields
│  │  ├── nrf21540ek
│  │  │  ├── boards
│  │  │  │  ├── nrf52833dk_nrf52833.overlay
│  │  │  │  ├── nrf52840dk_nrf52840.overlay
│  │  │  │  ├── nrf5340_audio_dk_nrf5340_cpuapp.overlay
│  │  │  │  ├── nrf5340_audio_dk_nrf5340_cpunet.overlay
│  │  │  │  ├── nrf5340dk_nrf5340_cpuapp.overlay
│  │  │  │  │ nrf5340dk_nrf5340_cpunet.overlay
│  │  │  ├── common
│  │  │  │  ├── arduino_compatible.overlay
│  │  │  │  │ arduino_compatible_fwd.overlay
│  │  │  ├── nrf21540ek.overlay
│  │  │  │ nrf21540ek_fwd.overlay
│  │  ├── nrf2220ek
│  │  │  ├── boards
│  │  │  │  ├── nrf52833dk_nrf52833.conf
│  │  │  │  ├── nrf52833dk_nrf52833.overlay
│  │  │  │  ├── nrf52840dk_nrf52840.conf
│  │  │  │  ├── nrf52840dk_nrf52840.overlay
│  │  │  │  ├── nrf5340dk_nrf5340_cpuapp.overlay
│  │  │  │  ├── nrf5340dk_nrf5340_cpunet.conf
│  │  │  │  │ nrf5340dk_nrf5340_cpunet.overlay
│  │  │  ├── common
│  │  │  │  ├── arduino_compatible.overlay
│  │  │  │  │ arduino_compatible_fwd.overlay
│  │  │  ├── nrf2220ek.overlay
│  │  │  │ nrf2220ek_fwd.overlay
│  │  ├── nrf2240ek
│  │  │  ├── boards
│  │  │  │  ├── nrf52833dk_nrf52833.conf
│  │  │  │  ├── nrf52833dk_nrf52833.overlay
│  │  │  │  ├── nrf52840dk_nrf52840.conf
│  │  │  │  ├── nrf52840dk_nrf52840.overlay
│  │  │  │  ├── nrf5340dk_nrf5340_cpuapp.overlay
│  │  │  │  ├── nrf5340dk_nrf5340_cpunet.conf
│  │  │  │  │ nrf5340dk_nrf5340_cpunet.overlay
│  │  │  ├── common
│  │  │  │  ├── arduino_compatible.overlay
│  │  │  │  │ arduino_compatible_fwd.overlay
│  │  │  ├── nrf2240ek.overlay
│  │  │  │ nrf2240ek_fwd.overlay
doc
│  ├── nrf
│  │  ├── app_dev
│  │  │  ├── device_guides
│  │  │  │  ├── fem
│  │  │  │  │  │ 21540ek_dev_guide.rst
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
samples
│  ├── bluetooth
│  │  ├── direct_test_mode
│  │  │  ├── sysbuild.cmake
│  │  │  ├── sysbuild
│  │  │  │  ├── remote_shell
│  │  │  │  │  ├── nrf21540ek.overlay
│  │  │  │  │  │ pin_fwd.dts
│  ├── matter
│  │  ├── light_bulb
│  │  │  │ sample.yaml
│  ├── peripheral
│  │  ├── radio_test
│  │  │  ├── sysbuild.cmake
│  │  │  ├── sysbuild
│  │  │  │  ├── remote_shell
│  │  │  │  │  ├── nrf21540ek.overlay
│  │  │  │  │  │ pin_fwd.dts

Outputs:

Toolchain

Version: b77d8c1312
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:b77d8c1312_912848a074

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 584
  • ✅ Integration tests
    • ✅ test-sdk-audio
    • ✅ desktop52_verification
    • ✅ test-fw-nrfconnect-ble_samples
    • ✅ test-fw-nrfconnect-chip
    • ✅ test-fw-nrfconnect-fem
Disabled integration tests
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-nfc
    • 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-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-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

The nrf2220ek_fwd is no more necessary and deprecated. Build system
picks appropriate overlay (being either a pin-forwarder or the main
fem overlay) based on content of `boards` directory.
User does not need to pass different values for `-DSHIELD` for every
core on the SoC. It is handled on the shield level and passing just
`-DSHIELD=nrf2220ek` for all cores is enough.

Signed-off-by: Andrzej Kuros <[email protected]>
@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 Publish GitHub Action.

The nrf2240ek_fwd is no more necessary and deprecated. Build system
picks appropriate overlay (being either a pin-forwarder or the main
fem overlay) based on content of `boards` directory.
User does not need to pass different values for `-DSHIELD` for every
core on the SoC. It is handled on the shield level and passing just
`-DSHIELD=nrf2220ek` for all cores is enough.

Signed-off-by: Andrzej Kuros <[email protected]>
The nrf21540ek_fwd is no more necessary and deprecated. Build system
picks appropriate overlay (being either a pin-forwarder or the main
fem overlay) based on content of `boards` directory.
User does not need to pass different values for `-DSHIELD` for every
core on the SoC. It is handled on the shield level and passing just
`-DSHIELD=nrf21540ek` for all cores is enough.

Signed-off-by: Andrzej Kuros <[email protected]>
Direct handling of pin forwarding for nrf21540ek on the nrf5340 in
radio_test sample is not necessary and is removed. The pin forwarding
on the nrf5340 is handled by the shield code.

Signed-off-by: Andrzej Kuros <[email protected]>
Direct handling of pin forwarding for nrf21540ek on the nrf5340 in
dtm sample is not necessary and is removed. The pin forwarding
related to the pins used by the shield on the nrf5340 is handled
by the shield code.

Signed-off-by: Andrzej Kuros <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required PR must not be merged without tech writer approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants