<?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 - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44723/fds---data-corruption-during-an-interrupted-swap</link><description>Hi, 
 I have found a bug in the fds module (Flash Data Storage), which lead to losing &amp;quot;installed pages&amp;quot;. If it was a swap page, fds module will be bricked. 
 Tested on SDK 14.2.0, but it is present in 15.2.0. Hardware is not relevant, but I tested it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Oct 2019 18:34:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44723/fds---data-corruption-during-an-interrupted-swap" /><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/216927?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 18:34:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae1393ca-9e93-4ad1-923d-ab8a8318a550</guid><dc:creator>wael</dc:creator><description>&lt;p&gt;Thanks, that works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/216926?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 18:30:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c205fcc-b5e7-4eef-84e5-828f014622c1</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/53687/fds---missing-swap-page"&gt;&lt;/a&gt;Please try now:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/53687/fds---missing-swap-page"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/53687/fds---missing-swap-page&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/216919?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 18:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3236db8-fadb-4957-aa09-33d3fd3ca5e5</guid><dc:creator>wael</dc:creator><description>&lt;p&gt;Thanks&amp;nbsp;&lt;span&gt;Wojciech&amp;nbsp;but I&lt;/span&gt;&amp;nbsp;cannot access that page. It might be a private support ticket. I&amp;#39;m curious to know the details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/216814?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 11:46:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c703024f-5c8c-42ba-a104-162053ca1e4c</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Hi Wael!&lt;/p&gt;
&lt;p&gt;I have probably fix for 3rd issue. Please see&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/support/225176"&gt;https://devzone.nordicsemi.com/support/225176&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/182787?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2019 04:26:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73150a0a-fe1b-4afd-8b37-aca6825ca8ee</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Unfortunately, I do not have a fix for this. Only workaround with erasing one data page (empty one). If I found any I will publish it and notify you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/182776?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2019 20:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08dcbade-5f4d-4c78-88bb-a12b541f2f06</guid><dc:creator>Wael</dc:creator><description>&lt;p&gt;Hi Wojciech:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your reply! did you get a response on how to fix my issue(the 3rd issue) you sent via a private ticket?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/182758?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2019 15:32:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bc392b3-555c-4fee-bf6d-783f9fd22a46</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have observed 3 different issues with fds module:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;corrupted &lt;span&gt;record_id &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43758/fds---data-corruption"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/43758/fds---data-corruption&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;loosing installed pages (this issue)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;loosing swap page (your issue)&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;Two of them are fixed and I recommend you to review and apply my patches.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The last one I have reported to Nordic as a Private Ticket (&lt;span class="attribute-value"&gt;12 Mar 2019&lt;/span&gt;) and I did not found the root cause. Please see &lt;a href="https://drive.google.com/drive/folders/1y_KOyIhVw9d-ZAAIc8SSa8k9vUOobDVz?usp=sharing"&gt;https://drive.google.com/drive/folders/1y_KOyIhVw9d-ZAAIc8SSa8k9vUOobDVz?usp=sharing &lt;/a&gt;This is dump from my reproduction of this issue. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/182757?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2019 15:12:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ece1dc0c-89e1-40cc-8d69-7ad35b391d0a</guid><dc:creator>Wael</dc:creator><description>&lt;p&gt;Hello:&lt;/p&gt;
&lt;p&gt;We seem to have a similar problem. &lt;span&gt;This problem has happened on few different boards now. we are using the nRF52832 and SDK 15. The issue seems to happen when the battery gets low and we are NOT able to reproduce it. The issue is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;1) as the battery starts to get low or close to dead, the device powered down after few seconds which is expected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2) when we put in a new battery, the board still will not power up. we are assuming the flash may have gotten corrupted(maybe by a brownout)&amp;nbsp; since we do write flash every minute.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3) I compared the flash from the failed device&amp;nbsp;&lt;/span&gt;&lt;span&gt;with a good device&lt;/span&gt;&lt;span&gt;&amp;nbsp;and the only difference appear on the 3 assigned data flash pages at addresses 0x75000, 0x76000, and 0x77000. The bootloader sits at 0x78000. The difference appears on page 0x76000 where the good device is defined as a swap page(FDS_PAGE_TAG_SWAP) and&amp;nbsp;the bad board does NOT define any of its 3 pages as swap. how can this happen?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4) on the &amp;quot;corrupted&amp;quot; FW, when I change the type from&amp;nbsp;FDS_PAGE_TAG_DATA to&amp;nbsp;FDS_PAGE_TAG_SWAP on page 0x76000, the board boots up and function as expected.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have attached the hex files for review.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have a very strong suspicion&amp;nbsp;these problems are related. Your time and effort would be greatly appreciated&amp;nbsp;in helping us nail down a quick&amp;nbsp;solution and maybe some instructions on how to reproduce the problem. I have attached the hex files for review.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/memory-dump-from-working-board.hex"&gt;devzone.nordicsemi.com/.../memory-dump-from-working-board.hex&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/memory-dump-from-failed-board-3_5F00_1_5F00_23.hex"&gt;devzone.nordicsemi.com/.../memory-dump-from-failed-board-3_5F00_1_5F00_23.hex&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/176043?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 19:29:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26f15de3-be8d-4cd6-9574-0e0ada5e2b42</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Thanks for the feedback. I had similar doubts regarding the function name. Anyway, this page from the file system is actually erased. I treat this code as a workaround, but for sure you can find a cleaner solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption during an interrupted swap</title><link>https://devzone.nordicsemi.com/thread/176032?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 17:51:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a465839-f081-4001-ad55-399a3e45d4cb</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for the report! Yes, this looks like a bug. I can confirm that you will get NO_SWAP in the way that you describe, if FDS_PAGE_TAG_MAGIC is present but neither of FDS_PAGE_TAG_SWAP nor FDS_PAGE_TAG_DATA are.&lt;/p&gt;
&lt;p&gt;I have reported the issue to the SDK team.&lt;/p&gt;
&lt;p&gt;From what I can tell your proposed fix should solve the issue, although with that change the name of the function page_is_erased() becomes misleading. (Since the first word of the page is not erased, but written to!) That means if we fix it this way then we might end up introducing other errors at a later point in time, if we rework related portions of code. That means we may choose to solve this in another way than what you propose.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>