<?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>preserve data in the flash over DFU using FDS [sdk 14.2]</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39012/preserve-data-in-the-flash-over-dfu-using-fds-sdk-14-2</link><description>Hello everybody, 
 I need to store some data in the flash for application purposes. I&amp;#39;m using the SD332 and the application goes in the DFU mode with the DFU buttonless service. I&amp;#39;m using the sdk14.2. 
 I modified the app using the FDS library to store</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Oct 2018 08:22:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39012/preserve-data-in-the-flash-over-dfu-using-fds-sdk-14-2" /><item><title>RE: preserve data in the flash over DFU using FDS [sdk 14.2]</title><link>https://devzone.nordicsemi.com/thread/151357?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 08:22:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a76987c3-219b-463b-8f60-faa46715834f</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Fabiano,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes, you are correct.&amp;nbsp;&amp;nbsp;&lt;span&gt;The&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__fds.html#gaa71e86ec4e3022063eb08c3411636561"&gt;fds_record_update&lt;/a&gt;&amp;nbsp;documentation states that updating a record first writes a new record to flash and then deletes the old record.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note that deleting a record does not free the space it occupies in flash memory. To reclaim flash space used by deleted records, call&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__fds.html#ga90285f376c435c64b352023e725b7ebb"&gt;fds_gc&lt;/a&gt;&amp;nbsp;to run garbage collection.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: preserve data in the flash over DFU using FDS [sdk 14.2]</title><link>https://devzone.nordicsemi.com/thread/151285?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 15:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe6ae47d-7544-4c0c-bca4-75544170141b</guid><dc:creator>Fabiano</dc:creator><description>&lt;p&gt;Thank you very much&amp;nbsp;&lt;span&gt;Bj&amp;oslash;rn, I have&lt;/span&gt;&amp;nbsp;just another question:&lt;/p&gt;
&lt;p&gt;I noticed that every time I modify the value of any data (uploading it in the flash with the function fds_record_update(); like in the example flash_fds_example) the address where are saved my data keep increase,&amp;nbsp;I guess till will reach the last address available in the space reserved to store data. At that point will I receive an&amp;nbsp;FDS_ERR_NO_SPACE_IN_FLASH error when I try to update the data? if yes&amp;nbsp;do I have just to use the garbace collector and then proceed to keep storing data?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thank you very much for your help&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Fabiano&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: preserve data in the flash over DFU using FDS [sdk 14.2]</title><link>https://devzone.nordicsemi.com/thread/151270?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 14:30:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bbea0c2-f066-4c0a-8be3-9f16f85cc0f6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Fabiano,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the&amp;nbsp;&lt;strong&gt;DFU_APP_DATA_RESERVED&lt;/strong&gt; define is by default set to &lt;strong&gt;CODE_PAGE_SIZE * 3&amp;nbsp;&lt;/strong&gt;in nrf_dfu_types.h in the bootloader code. This will ensure that both the bonding data and the application data is retained during a DFU.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So unless you expect your application data to exceed one flash page, i.e. 4kB, then you do not need to do anything with either the application or bootloader code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>