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

pstorage request block id

Hi,

Currently I'm working on updating some code based op pstorage on the nRF51822 with SDK 10 an SD S110 (v8).

Right know we're not using "blocks". We're using pstorage_update(&m_pstorage_handle, ...) directly on the handle obtained via pstorage_register(&param, &m_pstorage_handle). Which causes all data to be saved in the address 0x3B800 to 0x3B810. Our bootloader starts at 0x3C000. Yet all documentation point to the fact that you need to use block via pstorage_block_identifier_get(). We only use one block, but I would want the code to be future proof (we support OTA update) so it's probably a good idea to do so.

So does the number of blocks include the swap block? Or can I just use pstorage_block_identifier_get(&m_pstorage_handle, 0, &block_handle);? Our params look like this:

pstorage_module_param_t param;
param.block_size  = 0x40;
param.block_count = 0x01;
param.cb          = pstorage_callback;

edit: also we would like to preserve data during DFU that's why I'm checking the addresses

Thanks!

Parents
  • I think you are mixing up blocks with flash pages. There is no swap block, but there is a swap page.

    Have a look at pstorage_platform.h, the start and en addresses are defined there.

    It seems you have defined Pstorage to use 1 flash page, in addition to 1 swap page.

    The flash page is from 0x3B800, and the swap page is from 3BC00, and the bootloader is from 0x3C000.

Reply
  • I think you are mixing up blocks with flash pages. There is no swap block, but there is a swap page.

    Have a look at pstorage_platform.h, the start and en addresses are defined there.

    It seems you have defined Pstorage to use 1 flash page, in addition to 1 swap page.

    The flash page is from 0x3B800, and the swap page is from 3BC00, and the bootloader is from 0x3C000.

Children
Related