<?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</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43758/fds---data-corruption</link><description>Hi, 
 I found a bug in fds module ( Flash Data Storage ) which lead to data system corruption. 
 
 Scenario: 
 
 
 Given the device started GC(Garbage Collection) procedure 
 
 
 When the device will reset during the in the certain moment of page swap</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Oct 2019 18:59:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43758/fds---data-corruption" /><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/216929?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 18:59:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9214126-14f7-4fff-ba42-f6ce8e40d812</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;&amp;nbsp;In version&amp;nbsp;&lt;span&gt;14.2 I found 3 issues:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;corrupted&amp;nbsp;record_id (this case)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;losing installed pages&amp;nbsp;(&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44723/fds---data-corruption-during-an-interrupted-swap"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/44723/fds---data-corruption-during-an-interrupted-swap&lt;/a&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;losing swap page (&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;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have checked v16 and it looks like first 2 issues are addressed.&lt;/p&gt;
&lt;p&gt;I believe this issue with losing swap page is still present. Please consider reviewing my fix&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&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</title><link>https://devzone.nordicsemi.com/thread/216850?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 12:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff9536a8-d75f-4273-8f94-9dcbd071f1b5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;There are multiple fixes added to FDS in &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/index.html?cp=5_1_0"&gt;SDK v16.0.0&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/216818?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 11:50:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fe1fa89-f0fa-490c-95f0-809bce3a8251</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Hi Lukasz!&lt;/p&gt;
&lt;p&gt;We are creating our own solution (to be compatible with fds records layout). Anyway, I believe that I found a solution for this swap page. Please see&amp;nbsp;&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</title><link>https://devzone.nordicsemi.com/thread/209426?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2019 12:21:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:214d5828-e83e-48c6-a1f4-cee91e0cd5ea</guid><dc:creator>LukaszW4</dc:creator><description>&lt;p&gt;Could you tell me solution you used instead of fighting with FDS?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/208917?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 11:55:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffb3a6a2-6434-4ad2-8c92-e0db844aa7ae</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Unfortunately no. We decided to drop fds and use something more stable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/208880?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 11:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04426a88-6ce6-4ffc-b1a1-6d2d17248655</guid><dc:creator>LukaszW4</dc:creator><description>&lt;p&gt;Have you already solved all the problems connected with FDS? I have similar problem with losing swap page.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/185320?ContentTypeID=1</link><pubDate>Mon, 06 May 2019 05:03:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32e56976-ca2a-4ebe-aa4d-3c0b3732430b</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Yes, I have fixed 2 issues.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44723/fds---data-corruption-during-an-interrupted-swap"&gt;devzone.nordicsemi.com/.../fds---data-corruption-during-an-interrupted-swap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;This one by updating function from fds.c&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief   Not initialized record id.
 */
#define FDS_RECORD_ID_NOT_INIT     (0xFFFFFFFF)

fds_header_status_t fds_header_check(fds_header_t const * p_hdr, uint32_t const * p_page_end)
{
    if (((uint32_t*)header_jump(p_hdr) &amp;gt; p_page_end))
    {
        // The length field would jump across the page boundary.
        // FDS won&amp;#39;t allow writing such a header, therefore it has been corrupted.
        return FDS_HEADER_CORRUPT;
    }

    if (   (p_hdr-&amp;gt;file_id    == FDS_FILE_ID_INVALID)
        || (p_hdr-&amp;gt;record_key == FDS_RECORD_KEY_DIRTY)
        || (p_hdr-&amp;gt;record_id  == FDS_RECORD_ID_NOT_INIT))
    {
        return FDS_HEADER_DIRTY;
    }

    return FDS_HEADER_VALID;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am still struggling with one more. The one with losing swap page after power failure.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/185008?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 21:10:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1686bd6c-ae23-40a3-922b-b906c9d257ca</guid><dc:creator>wael</dc:creator><description>&lt;p&gt;Hey Wojciech,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Were you able to fix this issue? We are seeing something that sounds very similar when doing a lot of FDS writes.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Wael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/171541?ContentTypeID=1</link><pubDate>Mon, 18 Feb 2019 06:36:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2fa7e49-e59d-4d5e-808a-4c50900fc3a4</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;I am uploading two FDS section dumps. They are binary files.&lt;/p&gt;
&lt;p&gt;First one is swap_interrupted (&lt;a href="https://drive.google.com/file/d/1YbhHWHZhjc4LcS1HGaIfJf2rJdcdAXHy/view?usp=sharing"&gt;https://drive.google.com/file/d/1YbhHWHZhjc4LcS1HGaIfJf2rJdcdAXHy/view?usp=sharing&lt;/a&gt;). It contains data in swap page, which reproduces&amp;nbsp;this issue. If we initialize fds with this data&amp;nbsp;m_latest_rec_id will be set to 0xFFFFFFFF and next created record will have id equal to 0.&lt;/p&gt;
&lt;p&gt;The second one is corrupted_data (&lt;a href="https://drive.google.com/file/d/1cMJeldRmiGFEwtxTkQgx_KWeFwsv1f-Q/view?usp=sharing"&gt;https://drive.google.com/file/d/1cMJeldRmiGFEwtxTkQgx_KWeFwsv1f-Q/view?usp=sharing&lt;/a&gt;). This is how fds looks like, after some operation with&amp;nbsp;&lt;span&gt;m_latest_rec_id&amp;nbsp;initialized to 0xFFFFFFFF.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/171447?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 15:30:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b1e23f6-5751-4280-843e-c3e4e7a1986e</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;We are using:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SDK 14.2, but it should be reproducible with SDK 15.2 (code analysis).&amp;nbsp;&lt;/li&gt;
&lt;li&gt;NRF52832 and PCA10040 - but this is purely software bug.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As I described above:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GC procedure must be triggered (for example by a lot of write requests to fds)&lt;/li&gt;
&lt;li&gt;This procedure must be interrupted with reset in a certain moment (power off/system reset)&lt;/li&gt;
&lt;li&gt;After power on next write, requests will overwrite existing (first will have record id 0 so the second one will corrupt existing records).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is hard to reproduce. In our setup, it takes about 12 h of certain tests. I believe that code analysis of page_scan and&amp;nbsp;&lt;span&gt;header_check function will help.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I can also share with you a flash dump from the corrupted&amp;nbsp;fds storage.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS - data corruption</title><link>https://devzone.nordicsemi.com/thread/171426?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 14:34:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:827739d0-d97b-412a-bbf0-680ea6eb9191</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which SDK version are you using, and what IC are you experiencing this bug on?&lt;/p&gt;
&lt;p&gt;Have you reproduced this on any of oru DKs, and can you share code/procedure that can be used to reproduce this bug?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>