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

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

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 (master) nrfconnect/sdk-connectedhomeip#527 nrfconnect/sdk-connectedhomeip#527/files

DNM label due to: 1 project with PR revision

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: 9

Inputs:

Sources:

sdk-nrf: PR head: 9f41e4593eebd42ab4339e58bb18dc78c9f2fbb5
matter: PR head: d4993d3e4158dd0db7446b3c5cd4b7275079e405

more details

sdk-nrf:

PR head: 9f41e4593eebd42ab4339e58bb18dc78c9f2fbb5
merge base: a30fb624e41f0282d4f9920f65cb840f4ac6a001
target head (main): 8cc2355b999aa77b56e5d08e582e99ebd4fe2569
Diff

matter:

PR head: d4993d3e4158dd0db7446b3c5cd4b7275079e405
merge base: ad8ba68fd93b25f3fc0c0093bdaade96439b3987
target head (master): 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: 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: 140
  • ✅ 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.

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>
@@ -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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNM 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