Skip to content

Commit

Permalink
samples: matter: disable mpsl before preforming factory reset
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ArekBalysNordic committed Dec 20, 2024
1 parent 31d1fa5 commit bca218c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions samples/matter/common/src/app/fabric_table_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <lib/support/logging/CHIPLogging.h>

#include "app/group_data_provider.h"
#include <mpsl/mpsl_lib.h>

#ifdef CONFIG_CHIP_WIFI
#include <platform/nrfconnect/wifi/WiFiManager.h>
Expand Down Expand Up @@ -57,10 +58,14 @@ 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
/*/ Disable mpsl before start removing settings to improve the performance. */
mpsl_lib_uninit();
/* Erase Matter data */
chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().DoFactoryReset();
/* Erase Network credentials and disconnect */
chip::DeviceLayer::ConnectivityMgr().ErasePersistentInfo();
/*/ Re-enable mpsl after clearing persistent data. */
mpsl_lib_init();
#ifdef CONFIG_CHIP_WIFI
chip::DeviceLayer::WiFiManager::Instance().Disconnect();
chip::DeviceLayer::ConnectivityMgr().ClearWiFiStationProvision();
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ manifest:
- name: matter
repo-path: sdk-connectedhomeip
path: modules/lib/matter
revision: 20babbe7904f55511c39f19cae2162f7b770f974
revision: pull/527/head
west-commands: scripts/west/west-commands.yml
submodules:
- name: nlio
Expand Down

0 comments on commit bca218c

Please sign in to comment.