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

Using pstroage with different data sizes.

In our application, we need to save a group of data objects, how many data objects in a group is dynamic. also each data object has different sizes, a few bytes up to 100+ bytes.

The size of data is not known in advance.

It seems unrealistic to call pstorage_register multiple times to register block for different size because:

  1. we don't know the data size in advance
  2. it's a nightmare to maintain dynamic number of pstorage handle

So what is my option then?

It seems pstorage raw mode also would not help, since it also needs to register block size and block amount in advance.

pstorage source code shows that it actually uses sd_flash_page_erase adn sd_flash_flash,

can I use these flash function directly?

Related