<?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>Question about bond infomation ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47409/question-about-bond-infomation</link><description>Hi all, I have some question. 
 When I using mobile to bond with my DK nrf52832. Infomation will save to flash via FDS library. 
 So, when I delete bond from mobile and rebond with DK. I see old bond infomation not deleted, one byte was changed to 0x00</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 May 2019 07:20:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47409/question-about-bond-infomation" /><item><title>RE: Question about bond infomation ?</title><link>https://devzone.nordicsemi.com/thread/188099?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 07:20:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7f02079-3284-49e1-9eda-a021f3de323c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Quite close. As you say, the swap page is used to copy the valid records from a data page to the swap page. When all the valid records from one flash page are copied, the data page will be deleted, and the swap page becomes a data page. The empty page will become the new swap page. Since a data page can&amp;#39;t have more records than what would fit into a swap page, the swap page will never be full. Once the swap page contains all the records from a data page, and the old data page is erased and has become the swap page, the rest of the space on the new data page(the old swap page) will be used for storing new records, and the new swap page will be used to swap records for the next data page.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;fds_gc() will iterate through all the data pages, so after fds_gc() you shouldn&amp;#39;t have any dirty records.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about bond infomation ?</title><link>https://devzone.nordicsemi.com/thread/188067?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 05:03:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8277dc21-56bd-4422-956f-2212b60fb901</guid><dc:creator>Giang</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;As&amp;nbsp; I observed, if I define&amp;nbsp;&lt;a class="el" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__fds__config.html#ga5a6ee4b21f32ba0776a116880156c992"&gt;FDS_VIRTUAL_PAGES&lt;/a&gt;&amp;nbsp;= 3, I will have 2 pages (8K) for stored data, 1 page (4K) for&amp;nbsp;FDS_PAGE_SWAP, when stored full at 2 pages for data, program will run fds_gc and erase all dirty records, and copy valid record to page swap, then continue store record at swap page. When swap page full, fds_gc erase again dirty record and copy valid record to page data. the process continues, I understand that right ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about bond infomation ?</title><link>https://devzone.nordicsemi.com/thread/187928?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 12:54:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1ffa02e-00b9-411e-a685-e25a6671220e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It is correct, as you observe, that when you delete bonding information, which are FDS records, it will not actually be deleted, but marked as &amp;quot;dirty&amp;quot;, by setting the record key to 0. The records are still there, physically, since you need to erase whole flash pages in order to clear it. It may not be that the records that are stored on the same flash page is dirty (yet), so that is why the FDS doesn&amp;#39;t actually delete them.&lt;/p&gt;
&lt;p&gt;If the peer manager tries to store bonding data, and it fails because pm_peer_rank_highest() returns NRF_ERROR_STORAGE_FULL, it will call pm_handler_flash_clean_on_return(), which will run fds_gc() (garbage collection), which will go through all your records, keep the ones that are still valid, and erase the rest.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;span lang="en"&gt;&lt;span&gt;When I connect and disconnect with DK (bonded before). &lt;/span&gt;&lt;/span&gt;&lt;span lang="en"&gt;I see it will write some more data to&amp;nbsp;&lt;span&gt;adjacent data area. What is data?&amp;nbsp;&lt;/span&gt;&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;This depends. It could be that the peer manager has updated the rank of the peer, or that it stores some connection settings. It is typically not something you have to worry about.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you want to read more about the FDS records and garbage collection, you can do so &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Flib_fds_functionality.html&amp;amp;cp=5_1_3_55_1" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>