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

how pstorage_register insure same address between startup?

it register a handler, what about restart and run pstorage_register again, how it insure everytime we get the same address for our content in the flash? before pstorage_register, we use flash_io, which we know the address, so no problem to access the right place in flash, so pstorage_register ensures the correct address by order of calling pstorage_register?

and PSTORAGE_MAX_APPLICATIONS, seems not for application, but defines how many pages we use? is there a max number of pages we can use? how to find out this number for nrf51822-xxaa-s110? as I recalled, 16k for softdevice, and size of app(how to find the size of app in the device?) anything else will take space?

Thanks!

Parents
  • Torbjørn,

    I apologize for missing this description in the SDK. The step by step instructions worked perfectly for me - after I changed PSTORAGE_MAX_APPLICATIONS from 2 to 3 in pstorage_platform.h

    I am not clear on why I needed to do that, honestly. The bond manager is the only other application it seems that uses the PStorage services. So it plus my user app = 2 (not 3).

    For all other developers please be mindful that if you have already run your app with with SDK and then you increase PSTORAGE_MAX_APPLICATIONS to now support your own NV storage needs, the bond manager code will likely hard fault when retrieving an illegal bond table. You must force a clear; in the ble_hrs demo this is accomplished by setting bonds_delete=true before calling the function in ble_bondmngr.c:

       // Erase all stored centrals if specified.
        if (m_bondmngr_config.bonds_delete)
        {
    ...
    

    Thank you for your excellent assistance, Dan Danknick

Reply
  • Torbjørn,

    I apologize for missing this description in the SDK. The step by step instructions worked perfectly for me - after I changed PSTORAGE_MAX_APPLICATIONS from 2 to 3 in pstorage_platform.h

    I am not clear on why I needed to do that, honestly. The bond manager is the only other application it seems that uses the PStorage services. So it plus my user app = 2 (not 3).

    For all other developers please be mindful that if you have already run your app with with SDK and then you increase PSTORAGE_MAX_APPLICATIONS to now support your own NV storage needs, the bond manager code will likely hard fault when retrieving an illegal bond table. You must force a clear; in the ble_hrs demo this is accomplished by setting bonds_delete=true before calling the function in ble_bondmngr.c:

       // Erase all stored centrals if specified.
        if (m_bondmngr_config.bonds_delete)
        {
    ...
    

    Thank you for your excellent assistance, Dan Danknick

Children
No Data
Related