Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Set device configuration defaults at manufacture

I have a firmware which uses FDS to store configuration, and I want to set some defaults at manufacture. The data might be hundreds of bytes. I could write the data as a binary blob to flash using nrfjprog, and on first boot load this data into memory and write it back to flash using FDS, however I thought it might be simpler to write it directly to flash in the format FDS expects, I can see the format is documented here.

  1. Is writing to flash in FDS format a good approach, or do you have any other suggestions?
  2. I don't suppose there is a python or C library for formatting data in FDS format?
  3. Can I just tag the first page as data (2 header bytes) and then write the records required in the format described in the link above?
    1. Do I need to tag another page as swap?
  • Hi Nick,

    Writing to flash in FDS format sounds good. But I am afraid there are no libraries relating to this and the page you referred is a good start.

    In order to store a large amount of data, you can just increase the FDS_VIRTUAL_PAGE_SIZE in the ''sdk_config.h''.

    Regards,

    Priyanka

  • Hi Nick,

    In order to write to flash you can use FDS and FDS creates the format for all the records and file IDs. You do not have to provide page tags etc. But if you need to have more control over the data that you write, you could use the fstorage instead of FDS.

    So in case you require a simple and more abstract access to flash, use FDS but if you are sure of the flash addresses etc then go for fstorage.

    Also, in order to understand about both, kindly refer the infocenter: FDS and fstorage

    Hope this helps. Slight smile

    Regards,

    Priyanka

Related