This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pstorage page size

I try to optmize my code so it can run on the 128k chip. My issue is with pstorage: I have 7 variables (from 4 bytes to 20 bytes) that I store in individual blocks. But it seems that on a page, there is only one block ? So for each block, I need PSTORAGE_FLASH_PAGE_SIZE. if PSTORAGE_FLASH_PAGE_SIZE = 1024, I need 7k to store my 7 variables ?

So I try to reduce PSTORAGE_FLASH_PAGE_SIZE, but I have strange behaviour when I do this. Should it be possible to have PSTORAGE_FLASH_PAGE_SIZE to 20 bytes ?

Parents
  • I am not a pstorage expert, but a quick look at how PSTORAGE_FLASH_PAGE_SIZE is used indicates changing it to something other than PSTORAGE_FLASH_PAGE_SIZE would result in some odd behaviors.

    Why not just call pstorage_register once with the block count set to 7 and the block size set to 20? This should give you a single flash page with 7 blocks of 20 bytes to store your data.

Reply
  • I am not a pstorage expert, but a quick look at how PSTORAGE_FLASH_PAGE_SIZE is used indicates changing it to something other than PSTORAGE_FLASH_PAGE_SIZE would result in some odd behaviors.

    Why not just call pstorage_register once with the block count set to 7 and the block size set to 20? This should give you a single flash page with 7 blocks of 20 bytes to store your data.

Children
No Data
Related