This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FDS Data storage fails after writing data of 5 Bytes after 409 times

Hi ,

I'm trying to write data using FDS library where ,i use fds_record_write on the first occassion and fds_record_update on all others.

Now i have debugged the issue and found out that I'm able to write data successfully up and untill m_pages.write_offset reaches 1022 .

After that i need to run fds_gc to reset this m_pages.write_offset to zero.

I want to know if there is any other way to rollover m_pages.write_offset .

Thanks,

Dhananjay

Parents
  • You will need to run garbage collection when the entire flash page has been written once, this to set the page back to FFFF...FFF's, thereby ready for writing data again.

    Best regards,
    Kenneth

Reply
  • You will need to run garbage collection when the entire flash page has been written once, this to set the page back to FFFF...FFF's, thereby ready for writing data again.

    Best regards,
    Kenneth

Children
  • Hi kenneth,

    I have done just that, i wait for fds_record_update api to fail with FDS_ERR_NO_SPACE_IN_FLASH error code then and only then i call fds_gc (garbage collector) . However can i just over write data directly in that particular offset again and again rather than writting at completely new location which occurs in both fds_record_write and fds_record_update.

  • No, that is not possible due to how FLASH memory works; it is not possible to "overwrite" data like you would do on a hard-disk for example.