Inquiry Regarding Custom NVM Data Storage in Matter Light Color Temperature Lamp (NCS 3.1.1)

Hi there,

I am developing a Matter light color temperature lamp product based on the NCS v3.1.1, and I need to store some custom user data in NVM (Non-Volatile Memory) within the provided demo example.

Could you please guide me on how to achieve this? Are there any example projects or code snippets available that demonstrate storing custom user data persistently without interfering with Matter’s default NVM usage?

Thank you for your support!

Best regards,

  • Regarding the custom NVM storage, I found the Settings subsystem in NCS. With these configurations:

    • CONFIG_SETTINGS=y

    • CONFIG_SETTINGS_RUNTIME=y

    • CONFIG_SETTINGS_ZMS=y (for nRF54L15)

    • CONFIG_FLASH=y

    • CONFIG_FLASH_MAP=y

    Can I simply use settings_save_one() to store my custom user data? Is this approach compatible with Matter's existing NVM implementation? Any code examples would be greatly appreciated.

    Thanks again!

  • Hi,

    Yes, you can use the settings subsystem even if that is used by the Matter implementation. Note that this will then typically be erased when you perform a factory reset (depending on CONFIG_CHIP_FACTORY_RESET_ERASE_NVS) but this will most likely be desired anyway. Note that you must pick keys that do not overlap with Matter (the settings keys are strings, so as long as you pick something unique for your product, that should be no problem).

    If you need guaranteed isolation from the Matter implementation you can use a separate partition linke you outlined in your last post. But generally it should not be needed, and the settings subsystem is designed to allow multiple "users".

Related