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

Some problem about pstorage

Hi all, I have some question want to ask.I have about 200 bytes to write to the flash and also I would use the bootloader.

I'm using nRF5_SDK_11.0.0_89a8197 and s130_nrf51_2.0.0_softdevice.hex on PCA10028.

Q1: I found that device_manager_init has initializeed persistent storage module. Do I need to call pstorage_init() again to initializeed persistent storage module and then register the block? If I don't call pstorage_init() again, it would be reset when I call the pstorage_register and the return value is 0x07(Invalid Parameter).

Q2: In the dm_init,

param.block_size = ALL_CONTEXT_SIZE;

param.block_count = DEVICE_MANAGER_MAX_BONDS;

dm_init function has register DEVICE_MANAGER_MAX_BONDS(7 blocks) blocks, so there are just three blocks(10 blocks in total) for application to use, right?

Q3: If I do like this:

param.block_size = 160;

param.block_count = 2;

This means that two blocks would be registered and each block is 160 bytes and 320 bytes in total, right?

Because the dm_init function has registered 7 blocks,the parameter “block_num”in the pstorage_block_identifier_get function couldn't be 0 to 6 when I register the other two blocks, right?

Thanks for you help.

Related