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: matter: disable mpsl before preforming factory reset #19696

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

ArekBalysNordic
Copy link
Contributor

We can speed up flash operations while performing a factory reset by disabling mpsl before that.

Thanks to that flash operations do not wait for mpsl synchronization and all write operations take less time.

@ArekBalysNordic ArekBalysNordic requested review from a team as code owners December 20, 2024 14:37
@github-actions github-actions bot added manifest changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Dec 20, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Dec 20, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
matter nrfconnect/sdk-connectedhomeip@ad8ba68 nrfconnect/sdk-connectedhomeip@b237efc (master) nrfconnect/sdk-connectedhomeip@ad8ba68f..b237efcb

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Dec 20, 2024

CI Information

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

Inputs:

Sources:

sdk-nrf: PR head: 964ec4c631eeb0ac9abee0825128a1221754f39a
matter: PR head: b237efcbd1e65dceab20e08d80721b1b4a71e6da

more details

sdk-nrf:

PR head: 964ec4c631eeb0ac9abee0825128a1221754f39a
merge base: a30fb624e41f0282d4f9920f65cb840f4ac6a001
target head (main): 9f8c7a436e6ecc4677af32355e76acb6951bf36e
Diff

matter:

PR head: b237efcbd1e65dceab20e08d80721b1b4a71e6da
merge base: ad8ba68fd93b25f3fc0c0093bdaade96439b3987
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 (4)
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
modules
│  ├── lib
│  │  ├── matter
│  │  │  ├── config
│  │  │  │  ├── nrfconnect
│  │  │  │  │  ├── chip-module
│  │  │  │  │  │  │ Kconfig.defaults
│  │  │  ├── src
│  │  │  │  ├── platform
│  │  │  │  │  ├── Zephyr
│  │  │  │  │  │  │ ConfigurationManagerImpl.cpp
west.yml

Outputs:

Toolchain

Version:
Build docker image:

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

  • ◻️ Toolchain
  • ◻️ Build twister
  • ◻️ Integration tests
    • ◻️ test-fw-nrfconnect-chip
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-fem
    • 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-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 Publish GitHub Action.

@ArekBalysNordic ArekBalysNordic requested review from a team as code owners January 2, 2025 11:50
@github-actions github-actions bot added doc-required PR must not be merged without tech writer approval. and removed changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Jan 2, 2025
@ArekBalysNordic ArekBalysNordic force-pushed the fd_improve branch 2 times, most recently from 2a484ef to 88ae0f3 Compare January 3, 2025 09:08
@ArekBalysNordic ArekBalysNordic requested a review from peknis January 3, 2025 09:09
@@ -57,10 +61,18 @@ class AppFabricTableDelegate : public chip::FabricTable::Delegate {
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
chip::DeviceLayer::ThreadStackMgr().ClearAllSrpHostAndServices();
#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
#ifdef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL
/* Disable mpsl before start removing settings to improve the performance. */
mpsl_lib_uninit();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking loud - is there any possible issue (ala race condition) that mpsl_lib_uninit might be called while there is some ongoing Radio Driver operation? Maybe we should put the Thread interface down before?

FYI: @ankuns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or maybe we can just lock the Thread stack? What do you think? Do you mean calling there ot_ function to disable Thread? Using Matter ThreadStackManager API we can only lock the stack.

@ArekBalysNordic ArekBalysNordic force-pushed the fd_improve branch 2 times, most recently from 4db667f to 0351e6b Compare January 8, 2025 09:28
/* Erase Network credentials and disconnect */
chip::DeviceLayer::ConnectivityMgr().ErasePersistentInfo();
#ifdef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL
/* Disable mpsl before start removing settings to improve the performance. */
mpsl_lib_uninit();
Copy link
Contributor

Choose a reason for hiding this comment

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

As disucssed F2F, let's remove it from here and just modify Matter Platform's code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Provided requested changes.

@@ -133,7 +133,8 @@ Gazell
Matter
------

|no_changes_yet_note|
* Disabled the :ref:`mpsl` before performing factory reset to speed up the process.
The :ref:`mpsl` is also disabled during the last fabric removal process and is re-enabled after the flash operations are completed.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not true now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

We can speed up flash operations while performing a factory reset
by disabling mpsl before that.

Thanks to that flash operations do not wait for mpsl
synchronization and all write operations take less time.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
@NordicBuilder NordicBuilder removed the DNM label Jan 10, 2025
@ArekBalysNordic ArekBalysNordic merged commit 37d6407 into nrfconnect:main Jan 10, 2025
13 of 14 checks passed
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. manifest manifest-matter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants