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

problem in creating pstorage more than 1kb

I am working with nrf51822 board softdevice of s130,sdk11.0 version.I want to create 4 KB of Flash through PStorage.I am able to create 1 kb(maximum block size ) of flash in 1 block Sucessfully.But if I am creating more than 1 block it's throwing error NRF_ERROR_INVALID_PARAM, While creating memory using pstorage_register(&param, &master_handle) .I trace out that this is because of BLOCK_COUNT_CHECK(COUNT, SIZE) by default PSTORAGE_NUM_OF_PAGES is always 1 in the Library file so I tried to change it but its considering the default value only. so help me in creating 4kB flash using pstorage.

Parents
  • There is a define PSTORAGE_MAX_APPLICATIONS (in pstorage_platform.h) that set the amount of flash pages used by the pstorage module in total. Typically one call to pstorage_register() will allocate one flash page, if you however need to allocate more than one flash page for each pstorage_register(), then the PSTORAGE_MAX_APPLICATIONS should be set to the total amount of flash pages required by all modules in your application. So if you need 4kB (e.g. 4*1024bytes), then set PSTORAGE_MAX_APPLICATIONS to 4 (or 5 if you also have device/peer manager).

Reply
  • There is a define PSTORAGE_MAX_APPLICATIONS (in pstorage_platform.h) that set the amount of flash pages used by the pstorage module in total. Typically one call to pstorage_register() will allocate one flash page, if you however need to allocate more than one flash page for each pstorage_register(), then the PSTORAGE_MAX_APPLICATIONS should be set to the total amount of flash pages required by all modules in your application. So if you need 4kB (e.g. 4*1024bytes), then set PSTORAGE_MAX_APPLICATIONS to 4 (or 5 if you also have device/peer manager).

Children
Related