From 9f07771c1ddd8ef3d4093a135fd54c28db347ab3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Balys Date: Thu, 2 Jan 2025 12:50:23 +0100 Subject: [PATCH] samples: matter: disable mpsl before preforming factory reset 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 --- .../releases/release-notes-changelog.rst | 3 ++- .../common/src/app/fabric_table_delegate.h | 16 ++++++++++++++-- west.yml | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 1fe46a72431b..620cfa122cc8 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -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. Matter fork +++++++++++ diff --git a/samples/matter/common/src/app/fabric_table_delegate.h b/samples/matter/common/src/app/fabric_table_delegate.h index fdc6e4051660..c175e2cc9fb6 100644 --- a/samples/matter/common/src/app/fabric_table_delegate.h +++ b/samples/matter/common/src/app/fabric_table_delegate.h @@ -12,6 +12,10 @@ #include "app/group_data_provider.h" +#ifdef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL +#include +#endif + #ifdef CONFIG_CHIP_WIFI #include #endif @@ -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 - /* Erase Matter data */ - chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().DoFactoryReset(); /* 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(); +#endif + /* Erase Matter data */ + chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().DoFactoryReset(); +#ifdef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL + /* Re-enable mpsl after clearing persistent data. */ + mpsl_lib_init(); +#endif #ifdef CONFIG_CHIP_WIFI chip::DeviceLayer::WiFiManager::Instance().Disconnect(); chip::DeviceLayer::ConnectivityMgr().ClearWiFiStationProvision(); diff --git a/west.yml b/west.yml index e71c4aaf2d4b..18885ea9db8e 100644 --- a/west.yml +++ b/west.yml @@ -159,7 +159,7 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: ad8ba68fd93b25f3fc0c0093bdaade96439b3987 + revision: pull/527/head west-commands: scripts/west/west-commands.yml submodules: - name: nlio