-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ZMS to Zephyr port #493
Conversation
0f53707
to
c7cde6e
Compare
18b9635
to
fea9e01
Compare
config/zephyr/Kconfig
Outdated
device-specific entries. | ||
device-specific entries. It makes sense only for NVS filesystem. | ||
|
||
config CHIP_FACTORY_RESET_ERASE_ZMS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine for now and will accept this, however, what do you think to have one Matter config like CHIP_FACTORY_RESET_NVM_PARTITION_ERASE
(or sth similar) which would use ZMS or NVS underneath based on the selected backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but it impacts many platforms that use Zephyr... We can do it, but not so easily. :/ I think we can create a follow up task for that after the release. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also think that using two different Kconfigs for that is not the best idea. Why is it not that easy? Isn't it just about changing CHIP_FACTORY_RESET_ERASE_NVS->CHIP_FACTORY_RESET_ERASE_SETTINGS and then adding depends on depends on SETTINGS_NVS || SETTINGS_ZMS? Then we can use zms_clear or nvs_clear in the cpp file based on SETTINGS_NVS/SETTINGS_ZMS selection, because it's a choice. I don't think it would affect anyone much unless he will use SETTINGS_ZMS.
config/zephyr/Kconfig
Outdated
device-specific entries. It makes sense only for NVS filesystem. | ||
|
||
config CHIP_FACTORY_RESET_ERASE_ZMS | ||
bool "Erase ZMS flash pages on factory reset" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool "Erase ZMS flash pages on factory reset" | |
bool "Erase ZMS non-volatile pages on factory reset" |
config/zephyr/Kconfig
Outdated
|
||
config CHIP_FACTORY_RESET_ERASE_ZMS | ||
bool "Erase ZMS flash pages on factory reset" | ||
depends on SETTINGS_ZMS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have protection on setting this config when DAC migration is turned on? I mean we should not allow for setting this config if DAC migration is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I've added it to the nrfconnect's .Kconfig file, but please double check it :)
fea9e01
to
2b4d74d
Compare
241fd44
to
655b3a8
Compare
default y | ||
depends on NVS || KVS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KVS?
if (status) | ||
{ | ||
ChipLogError(DeviceLayer, "Factory reset failed: %d", status); | ||
} | ||
#else | ||
#else // CONFIG_SETTINGS_NVS || CONFIG_SETTINGS_ZMS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant comment.
655b3a8
to
8131336
Compare
@@ -160,6 +160,10 @@ CHIP_ERROR FactoryDataProvider<FlashFactoryData>::MoveDACPrivateKeyToSecureStora | |||
} | |||
|
|||
#ifdef CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY | |||
#ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS | |||
#error "Do not use both CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS and CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY kconfig options " \ | |||
"because you will lose the DAC private key permanently from the device." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"because you will lose the DAC private key permanently from the device." | |
"because you will permanently loose the DAC private key from the device." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"lose", not "loose".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right :)
@@ -207,8 +207,8 @@ set the `CONFIG_CHIP_NFC_COMMISSIONING` option. | |||
By default, the factory reset procedure implemented in the Matter stack removes | |||
Matter-related settings only. If your application does not depend on any | |||
device-lifelong data stored in the non-volatile storage, set the | |||
`CONFIG_CHIP_FACTORY_RESET_ERASE_NVS` option to fully erase the NVS partition at | |||
the factory reset. This approach is more robust and regains the original NVS | |||
`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` option to fully erase the non-volatile partition at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` option to fully erase the non-volatile partition at | |
`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` option to fully erase the non-volatile settings partition at |
Can we somehow highlight what Configs have been changed? |
Added a possibility to use ZMS fs backend in Zephyr. NVS fs backend imply is now controlled by the nrfconnect platform configuration directly. All other platforms use NVS fs backend by default. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
8131336
to
30ce78e
Compare
Disabled NVS and enabled ZMS fs backend for all devices that uses RRAM. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
30ce78e
to
2bd04ee
Compare
Add ZMS to Zephyr port, Enable ZMS in nrfconnect if RRAM is in use.