Skip to content

Commit

Permalink
[nrf noup] Disable mpsl before performing factory data
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 2340e0a commit 885aa07
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ config NVS_LOOKUP_CACHE_SIZE
config ZMS_LOOKUP_CACHE_SIZE
default 512 if ZMS

# Enable Dynamic interrupts in MPSL to have a possibility to reconfigure it.
config DYNAMIC_INTERRUPTS
default y

config DYNAMIC_DIRECT_INTERRUPTS
default y

config MPSL_DYNAMIC_INTERRUPTS
default y

# ==============================================================================
# Zephyr networking configuration
# ==============================================================================
Expand Down
9 changes: 9 additions & 0 deletions src/platform/Zephyr/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
#include <platform/ThreadStackManager.h>
#endif

#if CHIP_DEVICE_LAYER_TARGET_NRFCONNECT
#include <mpsl/mpsl_lib.h>
#endif

namespace chip {
namespace DeviceLayer {

Expand Down Expand Up @@ -220,6 +224,11 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
}
#else

#if CHIP_DEVICE_LAYER_TARGET_NRFCONNECT
// Disable mpsl before start removing settings to improve the performance.
mpsl_lib_uninit();
#endif

const CHIP_ERROR err = PersistedStorage::KeyValueStoreMgrImpl().DoFactoryReset();

if (err != CHIP_NO_ERROR)
Expand Down

0 comments on commit 885aa07

Please sign in to comment.