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 GC page erase

Hi,

When factory resetting the flash storage, I delete all records, and then call fds_gc(). However, the page that's used for garbage collection still contains a copy of a data page before deletion.

It would be nice if there's a function to erase that page.

Parents
  • Hi,

    I do not quite understand what you mean by "the page that's used for garbage collection still contains a copy of a data page before deletion". During garbage collection, only valid records are copied from the data page to the swap page, then the data page is erased, the swap page promoted to data page, and the old data page (now erased) gets to be the next swap page.

    If all records have been deleted, you should end up with swap page and data pages, all of which are empty, save for the FDS page header.

    Can you provide a flash dump after record deletion and garbage collection? (nrfjprog --readcode dump.hex)

    Regards,
    Terje

Reply
  • Hi,

    I do not quite understand what you mean by "the page that's used for garbage collection still contains a copy of a data page before deletion". During garbage collection, only valid records are copied from the data page to the swap page, then the data page is erased, the swap page promoted to data page, and the old data page (now erased) gets to be the next swap page.

    If all records have been deleted, you should end up with swap page and data pages, all of which are empty, save for the FDS page header.

    Can you provide a flash dump after record deletion and garbage collection? (nrfjprog --readcode dump.hex)

    Regards,
    Terje

Children
Related