Best way to write persistent data in factory

Hi, team.

I am trying to find a way to write some persistent data in factory.

The data is a couple of certificates and should be written differently for each devices.

What is the best way to achieve this?

I am considering to use NVS and zephyr settings libraries to save certificates, but want to know whether the better/recommended way exists.

And also, let me know some guideline how to make suitable format (like .hex, maybe?) for writing to flash with well-known flash writing tools like nrfprog or Programmer.

I tried to make my own CLI interface via UART, etc., but currently, target device is lack of resources, and can't afford for it.

Parents Reply
  • Hi,

     

    choehyunho said:
    1. Writing certs in NCS CLI via UART. With this way, I can easily adapt my settings code and just implement proper shell command. But I am not sure current CONFIG_SHELL feature in zephyr is properly handling thousands of bytes certificates or not.

    This is one way of doing it. It is very similar to the "at_client", where we have the option to write certificates to the nRF9160 modem.

    choehyunho said:
    2. Writing small PC utility for making HEX fitted in settings partition. I found https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/matter/nrfconnect_factory_data_configuration.html document and looking into settings_ncs.c in NCS. It is quite a large work and I am still suspicious it is worthy.

    A solution similar to this will probably be the quickest way, as you're writing the data directly into flash.

    This is a solution that is tailored towards matter applications. You can try to adjust the parameters to make it match your setup, but this will require tuning on your side.

     

    I would recommend that you test this to see if it can be used for your exact use-case.

     

    Kind regards,

    Håkon

Children
Related