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

pstorage: unable to write twice on the same block

It seems that is not possible to rewrite data on a block ? I want to persist some data. The first time (after erasing all the flash memory) I store a data on a block, it works: I restart the chip, and I can retrieve my data. But the second time, the data is not replaced. Is it a normal behaviour ?

If I call pstorage_clear before writing the data on the second time, it works... But pstorage_clear clears all blocks, not just the one I want to clear...

As a workaround, I register a block (pstorage_register) for each data I need to save. Is it correct ?

Related