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

fs_store doesn't update memory

Hi everyone,

I am using SDK12 and the Flash Storage module to store some data in Flash. I frequently need to update some of these data basing on received commands and new data.

When I use fs_store after the fs_erase, the Flash is written as expected.

If I invoke the fs_store without the fs_erase (to update the previously written content), it doesn't update the values in Flash, even if I receive FS_SUCCESS in my handler.

  1. Do I have to erase all the page just to change few bytes in it?

  2. Is there any other technique / api that I can use to partially update a page?

(honestly, I am completely confused by the many options I have to write Flash: fstorage, pstorage, an example in SDK doesn't use any api at all, etc. Some work with the softdevice, some not, not to mention all the posts in the forum with different pieces of code, I hope to see a clarifying tutorial on this subject sooner or later)

Thanks.

Parents
  • Hi, i don't really know for the new SDK, but don't you have something like fs_update();? In older SDK we had pstorage_update(); to update a piece of flash memory, and that operation was handled everything for you. That have been said, it is normally in every mcu first to delete the flash data before writing to it. It is jus that pstorage_update(); used to handle both those operations.

Reply
  • Hi, i don't really know for the new SDK, but don't you have something like fs_update();? In older SDK we had pstorage_update(); to update a piece of flash memory, and that operation was handled everything for you. That have been said, it is normally in every mcu first to delete the flash data before writing to it. It is jus that pstorage_update(); used to handle both those operations.

Children
No Data
Related