This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Adding one more FDS record once device deployed over DFU

Hello,

 

I am using nRF52840, SDK_16.0.0, SoftDevice S140 V7.0.1 and Segger for flashing the image. I am using ‘ble_app_blinky’.

 

Assume I have one FDS record. With this binary, we released devices to field.

Later we want to add few more FDS records. We will generate new DFU package with increased FDS records.

Using DFU will there be impact in case:

 

1) Without changing number of pages FDS_VIRTUAL_PAGES, if I just increase number of records and do DFU will there be any issues.

2) How about changing number of pages FDS_VIRTUAL_PAGES.

Will it cause any problem in re-constructing the FDS records after device reset.

 

Thanks & Regards

Vishnu Beema

  • Hello Vishnu ,

    Later we want to add few more FDS records. We will generate new DFU package with increased FDS records.

     Assume the records are written at runtime by the new app, and not included in the FW image? The application can store as many records it wants as long as there is free space available. 

    You can increase FDS_VIRTUAL_PAGES, but then you should also make sure to increase the reserved app data region inside the bootloader to ensure it doesn't overwrite FDS pages during DFU. See Memory layout

    Best regards,

    Vidar

  • Hello Berg,

    1) You mean I can add new record over already existing FDS records via DFU.

    2) In ble_app_blink app I am seeing the macro FDS_VIRTUAL_PAGES. We are using Serial boot loader and I am not seeing any such macro. How to reserve "Application data" in bootloader. Do I need to modify NRF_DFU_APP_DATA_AREA_SIZE.

    Currently NRF_DFU_APP_DATA_AREA_SIZE is defined to 12288. So can I assume already 12 pages (12288 / 1024) where 1024 is page size) are reserved.

    3) If I change FDS_VIRTUAL_PAGES 13 then only I need to change NRF_DFU_APP_DATA_AREA_SIZE.

    4) What about changing the size of existing record itself. Assume existing record size is of 4 bytes and in new application, I change same record size to 8 bytes. Will this cause any issue.

    Thanks & Regards

    Vishnu Beema

  • Hello,

    1. Sorry, not sure I understand what you mean. FDS will never attempt to overwrite an existing record. FDS documentation for reference: Flash Data Storage

    2. Yes, it's the NRF_DFU_APP_DATA_AREA_SIZE you need to modify. But note that 1024 is the page size in 4-byte words while NRF_DFU_APP_DATA_AREA_SIZE defines the number of bytes to reserve. 12288 / 4096 = 3 flash pages.

    3. Yes.

    4. It should be fine as long as your application handles variable payload lengths for this particular record.

    Best regards,

    Vidar

  • Hi,

    Assume I added one FDS record in my application. With this I released my device to field and getting used by customer.

    /* A record containing dummy configuration data. */
    static fds_record_t const m_dummy_record =
    {
        .file_id           = CONFIG_FILE,
        .key               = CONFIG_REC_KEY,
        .data.p_data       = &m_dummy_cfg,
        /* The length of a record is always expressed in 4-byte units (words). */
        .data.length_words = (sizeof(m_dummy_cfg) + 3) / sizeof(uint32_t),
    };

    Assume after a year, we want to store one more record as below in same application. Now latest application with 2 records will be loaded into the customer device which is already in filed (Flashing latest image using DFU).

    /* A record containing dummy configuration data. */
    static fds_record_t const m_dummy_record1 =
    {
        .file_id           = CONFIG_FILE,
        .key               = CONFIG_REC_KEY1,
        .data.p_data       = &m_dummy_cfg1,
        /* The length of a record is always expressed in 4-byte units (words). */
        .data.length_words = (sizeof(m_dummy_cfg1) + 3) / sizeof(uint32_t),
    };
    

    So in this case will it cause any problem after loading latest application via DFU. Whether both records be constructed and maintained properly.

    Thanks & Regards

    Vishnu Beema

  • Hi,

    Yes, you can add new records before and after DFU.

    Best regards,

    Vidar

Related