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

problem with bond and pstorage............?

hai, i am using mbed to program my nrf51822.

i need the following requirements

1.store some data on nrf51822 flash memory using pstorage.

2.setup bonding for security using securitymanager.

now i am able to do both these separately. but when i combine this two there are some issues with the flash memory. when i use a single page of flash for store my data then the bonding information overwrite my data in flash. so i have initialised two pages and the second page is used for data storage. but the store and load operations failed when the load and store functions called before the initialisation of ble. but which works fine if the store and load functions are called after ble initialisation. but i need the data from flash to initialise the ble.

so i need to know the following information

  1. can i assign some portion of memory for bonding information.
  2. why i can't load data from flash before initialise ble.
  • Hi,

    The documentation of the pstorage module is available here. Your modules should be able to request blocks in memory, and should not overlap.

    In our SDK, there is a dedicated pstorage module for use without softdevice. I'm not sure if this is ported to the mbed library, or if it's just the version that is dependent on the softdevice that is available. Do you have a lot of data that you need to read/write? I guess there are other more low-level methods of writing to flash in mbed, such as the nrf_nvmc API, which can be used as an alternative to the pstorage module.

    Best regards,

    Jørgen

  • i have already gone through the documentation . and i requested two memory block with a size of 1024

            pstorage_module_param_t param;
            param.block_size  = 1024;
            param.block_count = 2;
            param.cb = cb_handler;
            retval = pstorage_register(&param, &base_handle);
    

    now when a bonding is established the bonding information is stored in any of this page , some times overwrites my data.

    i need atleast 1 page to store my data.

Related