<?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>FDS init with 2 pages labeled as swap</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69080/fds-init-with-2-pages-labeled-as-swap</link><description>I have an found a problem where I find FDS has 2 pages labeled as swap, which results in loss of one of the data pages. 
 
 my configuration is 2 data pages and 1 swap page. at start up, the pages show 1 data page and 2 swap pages. 
 after init the swap</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Dec 2020 11:26:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69080/fds-init-with-2-pages-labeled-as-swap" /><item><title>RE: FDS init with 2 pages labeled as swap</title><link>https://devzone.nordicsemi.com/thread/283515?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2020 11:26:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fed5de5a-98f5-40a4-8864-3f31da971235</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I see.&lt;/p&gt;
&lt;p&gt;I think it is a good idea to backport the FDS, as it contains some bug fixes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another thing that is worth mentioning is that you should only call fds_gc() in cases where you receive events indicating that the FDS is full. Don&amp;#39;t do so by default on startup of the application. We see a lot of customers doing this, as they think it is a good idea.&lt;/p&gt;
&lt;p&gt;The reason this is a bad idea is that if this is a battery powered device, you may experience a lot of resets when the battery is running out, causing many (!) fds_gc() to be called, and many aborted during power cuts. This behavior will provoke any potential bugs in the FDS regarding fds_gc().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So please don&amp;#39;t call fds_gc() in the startup of your application. Only if the FDS is in fact full.&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: FDS init with 2 pages labeled as swap</title><link>https://devzone.nordicsemi.com/thread/283371?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 16:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29cdecc7-aeba-4d87-a366-df3c23e88988</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;Hello Edvin,&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I stepped through the pages_init function and verified the page_type had 2 pages with&amp;nbsp;FDS_PAGE_SWAP and only 1 page with&amp;nbsp;FDS_PAGE_DATA.&amp;nbsp; After this occurred only 1 entry in m_pages was initialized.&lt;/p&gt;
&lt;p&gt;Unfortunately after getting this far in the debug, I erased the device since I was trying to complete a feature before the end of the day.&amp;nbsp; I realize now saving off the complete flash would have been a really good idea.&amp;nbsp; &amp;nbsp;I&amp;#39;ll look at backporting the changes to FDS from SDK17, which will be a low risk versus completely upgrading the sdk for our production devices.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a*&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS init with 2 pages labeled as swap</title><link>https://devzone.nordicsemi.com/thread/283311?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 13:11:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b93fa516-41a7-43e0-bed9-baff5e90a78d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have not seen this happen before. Do you have a reliable way to replicate this? Are you sure that both pages are defined as swap page, and that you don&amp;#39;t have one corrupted page, one swap page and one data page?&lt;/p&gt;
&lt;p&gt;Can you send a flash dump of your device? You can use &amp;quot;nrfjprog --readcode my_flash_dump.hex&amp;quot; to generate the flash dump.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As mentioned, I have not seen any issues with 2x swap pages before, but there are some bugfixes that were applied to SDK16.0.0 or SDK17.0.0 (I don&amp;#39;t remember which one, but you can check the release notes. I would suggest to port to that version if you have FDS issues. There are very few (if any) API changes between the later SDKs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>