<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Adding one more FDS record once device deployed over DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61311/adding-one-more-fds-record-once-device-deployed-over-dfu</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jan 2020 12:26:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61311/adding-one-more-fds-record-once-device-deployed-over-dfu" /><item><title>RE: Adding one more FDS record once device deployed over DFU</title><link>https://devzone.nordicsemi.com/thread/249482?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 12:26:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d5c251e-d7f6-4072-8288-10eb0de858a2</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Thank you for confirmation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding one more FDS record once device deployed over DFU</title><link>https://devzone.nordicsemi.com/thread/249481?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 12:24:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bd11726-276a-467c-a535-2d384aa1d497</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, you can add new records before and after DFU.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding one more FDS record once device deployed over DFU</title><link>https://devzone.nordicsemi.com/thread/249480?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 11:39:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:685fd84a-5ec0-4cb7-86e9-711beac262db</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Assume I added one FDS record in my application. With this I released my device to field and getting used by customer.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* 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       = &amp;amp;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),
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;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).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* 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       = &amp;amp;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),
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So in this case will it cause any problem after loading latest application via DFU. Whether both records be constructed and maintained properly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Vishnu Beema&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding one more FDS record once device deployed over DFU</title><link>https://devzone.nordicsemi.com/thread/249479?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 10:43:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a349e5eb-7b13-41eb-a1ae-0b7d2b603af0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;1. Sorry, not sure I understand what you mean. FDS will never attempt to overwrite an existing record. FDS documentation for reference:&amp;nbsp;&lt;a title="Experimental: Flash Data Storage" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_fds.html?cp=7_1_3_56"&gt;Flash Data Storage&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. Yes, it&amp;#39;s the&amp;nbsp;&lt;span&gt;NRF_DFU_APP_DATA_AREA_SIZE you need to modify. But note that 1024 is the page size in 4-byte words while&amp;nbsp;NRF_DFU_APP_DATA_AREA_SIZE&amp;nbsp;defines the number of bytes to reserve. 12288 / &lt;strong&gt;4096&lt;/strong&gt; = 3 flash pages.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. Yes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. It should be fine as long as your application handles variable payload lengths for this particular record.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding one more FDS record once device deployed over DFU</title><link>https://devzone.nordicsemi.com/thread/249478?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 09:41:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff108e37-83d4-4db2-a084-8e70989a18fc</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Hello Berg,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) You mean I can add new record over already existing FDS records via DFU.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2) In ble_app_blink app I am seeing the macro&amp;nbsp;FDS_VIRTUAL_PAGES. We are using Serial boot loader and I am not seeing any such macro. How to reserve &amp;quot;Application data&amp;quot; in bootloader. Do I need to modify&amp;nbsp;NRF_DFU_APP_DATA_AREA_SIZE.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Currently&amp;nbsp;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.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3) If I change&amp;nbsp;&lt;span&gt;FDS_VIRTUAL_PAGES 13 then only I need to change&amp;nbsp;NRF_DFU_APP_DATA_AREA_SIZE.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Vishnu Beema&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding one more FDS record once device deployed over DFU</title><link>https://devzone.nordicsemi.com/thread/249477?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 08:33:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c623e13f-48af-44ea-a701-a5b513ce1d91</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello &lt;span&gt;Vishnu&amp;nbsp;&lt;/span&gt;,&lt;/p&gt;
[quote user=""]Later we want to add few more FDS records. We will generate new DFU package with increased FDS records.[/quote]
&lt;p&gt;&amp;nbsp;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.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can increase&amp;nbsp;&lt;span&gt;FDS_VIRTUAL_PAGES, but then you should also make sure to increase the reserved app data region inside the bootloader to ensure it doesn&amp;#39;t overwrite&amp;nbsp;FDS pages during DFU. See&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;a title="Memory layout" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_bootloader.html?cp=7_1_3_5_0_7#lib_bootloader_memory"&gt;Memory layout&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>