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

mpsl: clock_ctrl: Add MRAM high frequency request to MPSL #20532

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ppryga-nordic
Copy link
Contributor

In the nRF54h20 SoC the non-volatile memory is located in a global domain which by default configured by nrf2 clock control to run with 64MHz. That makes a code execution time longer so it doesn't fit into radio protocols time requirements. That causes e.g. Bluetooth stack to assert in radio events.

To make sure the clock needed for MRAM (non-volatile memory in nRF54h20 SoC) is always setup to highest avaialble frequency MPSL will put a request for the clock to clock control driver. In case there is any other user of the clock that runs from radio core and allows to lower the global domain clock frequency, the clock will still be stay as requested by MPSL.

@ppryga-nordic ppryga-nordic requested review from a team as code owners February 20, 2025 12:55
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Feb 20, 2025
Copy link

github-actions bot commented Feb 20, 2025

After documentation is built, you will find the preview for this PR here.

Preview links for modified nRF Connect SDK documents:

https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio_spi.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/app_dev/device_guides/fem/fem_nrf2220.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/app_dev/device_guides/fem/fem_simple_gpio.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_gs.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_keys.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/libraries/networking/downloader.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/protocols/lte/index.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/protocols/matter/index.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/2.4.99-cs3_to_2.6.99-cs2/migration_guide_2.4.99-cs3_to_2.6.99-cs2_application.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/2.4.99-cs3_to_2.6.99-cs2/migration_guide_2.4.99-cs3_to_2.6.99-cs2_environment.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_1.x_to_2.x.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_2.4.99-cs3_to_2.6.99-cs2.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_2.5.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_2.6.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_2.7.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_2.8.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_2.9.0-nRF54H20-1-rc2.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_2.9.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_3.0.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs1.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_nRF54H20_cs_to_2_7_99-cs2.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_guide_spm_to_tf-m.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_hwmv2.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/migration_sysbuild.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.4.99-cs3_to_2.7_application.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2.7_application.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/migration_guide_2.6.99-cs2_to_2_7_environment.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration/nRF54H20_migration_2.7/transition_guide_2.4.99-cs3_to_2.7_environment.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/migration_guides.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/release_notes.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/releases_and_maturity/releases/release-notes-changelog.html
https://ncsdoc.z6.web.core.windows.net/PR-20532/nrf/samples/bluetooth/fast_pair/locator_tag/README.html

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Feb 20, 2025

CI Information

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

Inputs:

Sources:

sdk-nrf: PR head: e2250c7a4bbc8d154f9ff4ee4a0dc1be5f78a643

more details

sdk-nrf:

PR head: e2250c7a4bbc8d154f9ff4ee4a0dc1be5f78a643
merge base: 007584f39218442b84ca5b50bdda24ef1fa57a45
target head (main): ef49118310251ad3b04b8b9e3b5ba0a2693dbaf6
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 (2)
subsys
│  ├── mpsl
│  │  ├── clock_ctrl
│  │  │  ├── Kconfig
│  │  │  │ mpsl_clock_ctrl.c

Outputs:

Toolchain

Version: aedb4c0245
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:aedb4c0245_bece0367df

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 871
  • ✅ Integration tests
    • ✅ test_ble_nrf_config
    • ✅ test-fw-nrfconnect-ble_samples
    • ✅ test-fw-nrfconnect-chip
    • ✅ test-fw-nrfconnect-rs
    • ✅ test-fw-nrfconnect-fem
    • ✅ test-fw-nrfconnect-thread
    • ✅ test-fw-nrfconnect-zigbee
    • ✅ test-sdk-find-my
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-boot
    • 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_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-tfm
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • 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

@ppryga-nordic ppryga-nordic force-pushed the mpsl-clock-ctrl-request-gd-320mhz branch from 8c9e4bf to faeb332 Compare February 20, 2025 13:48
@ppryga-nordic ppryga-nordic force-pushed the mpsl-clock-ctrl-request-gd-320mhz branch 2 times, most recently from 70d4eb3 to 9187eaf Compare February 21, 2025 06:24
@ppryga-nordic
Copy link
Contributor Author

I've added small change to make the frequency more portable/safe. Instead of using a frequency index and DT_PROP_BY_IDX I changed it to DT_PROP_LAST so that we always get the highest frequency. With that the BUILD_ASSERT checking size of elements in supportes-clock-frequencies is not needed anymore.

Comment on lines 20 to 22
int ""
default CLOCK_CONTROL_NRF2_NRFS_CLOCK_TIMEOUT_MS if CLOCK_CONTROL_NRF2
default 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a prompt but the prompt is empty, this is not right. If this should not be user adjustable, drop the prompt

@ppryga-nordic ppryga-nordic force-pushed the mpsl-clock-ctrl-request-gd-320mhz branch from 9187eaf to 203931a Compare February 21, 2025 07:27
In the nRF54h20 SoC the non-volatile memory is located in a global
domain which by default configured by nrf2 clock control to run
with 64MHz. That makes a code execution time longer so it doesn't
fit into radio protocols time requirements. That causes e.g.
Bluetooth stack to assert in radio events.

To make sure the clock needed for MRAM (non-volatile memory in
nRF54h20 SoC) is always setup to highest avaialble frequency
MPSL will put a request for the clock to clock control driver.
In case there is any other user of the clock that runs from
radio core and allows to lower the global domain clock frequency,
the clock will still be stay as requested by MPSL.

Signed-off-by: Piotr Pryga <[email protected]>
@ppryga-nordic ppryga-nordic force-pushed the mpsl-clock-ctrl-request-gd-320mhz branch from 203931a to e2250c7 Compare February 21, 2025 11:54
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants