Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FDS - data corruption

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 procedure.

  • Then assigning new record id will overlap existing ones.

When just first two words of a record are copied to the swap page, the header of this record will pass header_check function.

During the page_scan procedure, this corrupted header will be used to update m_latest_rec_id. It will result in assigning new record ids from 0.

Solution:

I have updated header_check function to check record_id against 0xFFFFFFFF value, and now I am testing this workaround.

Parents
  • Hey Wojciech,

    Were you able to fix this issue? We are seeing something that sounds very similar when doing a lot of FDS writes.

    Thanks,
    Wael

  • Yes, I have fixed 2 issues.

    I am still struggling with one more. The one with losing swap page after power failure. 

  • Have you already solved all the problems connected with FDS? I have similar problem with losing swap page.

  • Unfortunately no. We decided to drop fds and use something more stable.

  • Could you tell me solution you used instead of fighting with FDS?

Reply Children