From 34519739bbcdf3e6b8eb78f95573fe2c66fad22e Mon Sep 17 00:00:00 2001 From: jmartinez-silabs <67972863+jmartinez-silabs@users.noreply.github.com> Date: Thu, 6 Jan 2022 18:07:35 -0500 Subject: [PATCH] [EFR32] fix BLE not advertising at boot while device is not provisionned (#13346) * Erase Kvs partition on Factory Reset. this deletes the fabric ids. There was an error with the ChipCounter key placement * Restyled by clang-format Co-authored-by: Restyled.io --- src/platform/EFR32/ConfigurationManagerImpl.cpp | 4 ++++ src/platform/EFR32/EFR32Config.h | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/platform/EFR32/ConfigurationManagerImpl.cpp b/src/platform/EFR32/ConfigurationManagerImpl.cpp index 24407f7342ea12..f550516e28b5a3 100644 --- a/src/platform/EFR32/ConfigurationManagerImpl.cpp +++ b/src/platform/EFR32/ConfigurationManagerImpl.cpp @@ -287,6 +287,10 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_KVS_AVAILABLE + PersistedStorage::KeyValueStoreMgrImpl().ErasePartition(); +#endif // CHIP_KVS_AVAILABLE + // Restart the system. ChipLogProgress(DeviceLayer, "System restarting"); NVIC_SystemReset(); diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index 5331c85b30e2b8..ec0715e231f745 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -94,12 +94,12 @@ class EFR32Config static constexpr Key kConfigKey_RegulatoryLocation = EFR32ConfigKey(kChipConfig_KeyBase, 0x09); static constexpr Key kConfigKey_CountryCode = EFR32ConfigKey(kChipConfig_KeyBase, 0x0A); static constexpr Key kConfigKey_Breadcrumb = EFR32ConfigKey(kChipConfig_KeyBase, 0x0B); + static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x0C); + static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1B); // Allows 16 Group Keys to be created. - static constexpr Key kConfigKey_BootCount = EFR32ConfigKey(kChipCounter_KeyBase, 0x0C); - static constexpr Key kConfigKey_TotalOperationalHours = EFR32ConfigKey(kChipCounter_KeyBase, 0x0D); - - static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x0E); - static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1D); // Allows 16 Group Keys to be created. + // CHIP Counter Keys + static constexpr Key kConfigKey_BootCount = EFR32ConfigKey(kChipCounter_KeyBase, 0x00); + static constexpr Key kConfigKey_TotalOperationalHours = EFR32ConfigKey(kChipCounter_KeyBase, 0x01); // Set key id limits for each group. static constexpr Key kMinConfigKey_ChipFactory = EFR32ConfigKey(kChipFactory_KeyBase, 0x00);