Skip to content

Commit

Permalink
[EFR32] fix BLE not advertising at boot while device is not provision…
Browse files Browse the repository at this point in the history
…ned (project-chip#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 <commits@restyled.io>
  • Loading branch information
jmartinez-silabs and restyled-commits authored Jan 6, 2022
1 parent fca97a3 commit fb154cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/platform/EFR32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions src/platform/EFR32/EFR32Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fb154cf

Please sign in to comment.