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
  • 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.

    I tried this, and basically confirmed it possible. But, my current board is almost out of memory (it occupies 120KB out of 128KB), and I determined to use the second way.

    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.

    I spent some times to review the structure of Zephyr settings module, but eventually it seems to be to redundant and waste of flash space for my specific usage.

    Currently, I am tied to another urgent work and need some more time to solve this issue.

    So, I will update my experience after a while.

    BTW, I found some interesting document (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/nvs_partition_gen.html) in ESP32.

    Is it related to zephyr? It looks quite similar.

Children
Related