<?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>All the fds virtual pages are not used</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85711/all-the-fds-virtual-pages-are-not-used</link><description>In our project, we have defined 5 FDS_VIRTUAL_PAGES each of size 1024 words and have programmed to do GC if &amp;gt; 10 records are deleted. I see the 1st page being used for storing the records and when GC happens, there after 2nd page is used for storing records</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 20 Mar 2022 09:24:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85711/all-the-fds-virtual-pages-are-not-used" /><item><title>RE: All the fds virtual pages are not used</title><link>https://devzone.nordicsemi.com/thread/358961?ContentTypeID=1</link><pubDate>Sun, 20 Mar 2022 09:24:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ceba91b-603e-41d1-a1e3-39cd3db4cf04</guid><dc:creator>rsingh</dc:creator><description>&lt;p&gt;Thanks for the info&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: All the fds virtual pages are not used</title><link>https://devzone.nordicsemi.com/thread/357646?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 12:19:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99542256-6a75-483e-b4b4-c94ff5ecd8ff</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Records are written sequentially to flash which means that all records will in the start reside in the same flash page, if you don&amp;#39;t write enough data to fill the other flash pages. One page is always used as a swap page.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Let&amp;#39;s say that you have 3 pages, where 2 is used to store records called data pages and the last one is used as a swap page.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page1&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|Record 1 |&amp;nbsp; Record 2 | Record 3|&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page2&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|Record 4 |&amp;nbsp; Record 5 | Record 6|&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(255, 0, 255, 1);"&gt;Page3&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|SWAP page |&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You now decide to delete record 5 and call the GC.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page1&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|Record 1 |&amp;nbsp; Record 2 | Record 3|&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page2&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|Record 4 |&amp;nbsp; &lt;span style="color:rgba(255, 0, 0, 1);"&gt;Record 5&lt;/span&gt; | Record 6|&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(255, 0, 255, 1);"&gt;Page3&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|SWAP page |&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The FDS module will invalidate the deleted record and will copy the remaining records to the&amp;nbsp;swap page&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page1&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|Record 1 |&amp;nbsp; Record 2 | Record 3|&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page2&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;|Record 4 |&amp;nbsp;&amp;nbsp;&lt;span style="color:rgba(255, 0, 0, 1);text-decoration:line-through;"&gt;Record 5&lt;/span&gt;&amp;nbsp;| Record 6|&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(255, 0, 255, 1);"&gt;Page3&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;|Record 4&amp;nbsp;&lt;/span&gt;&lt;span&gt;| Record 6|&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Page 3 will then be promoted to a data page, and Page 2 will be the new Swap page:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page1&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;|Record 1 |&amp;nbsp; Record 2 | Record 3|&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(255, 0, 255, 1);"&gt;Page2&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;| SWAP |&lt;/p&gt;
&lt;p&gt;&lt;span style="color:rgba(0, 255, 0, 1);"&gt;Page3&lt;/span&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;|Record 4&amp;nbsp;&lt;/span&gt;&lt;span&gt;| Record 6|&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;So the FDS module will always use at least 2 pages, one swap page, and at least one data page(depends on amount of records stored). You get basic wear leveling of the flash since the swap page moves around.&lt;/p&gt;
&lt;p&gt;Hope that it explained it.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>