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

migration guide for pstorage?

I have some non-volatile storage routines that I have written before, but the new SDK V5.0.0 has this pstorage module that is supposed to replace it, right? How do I migrate safely from using ble_flash to pstorage?

It seems like ble_flash is using blocking routines but the pstorage is using some sort of command queue with a callback. Should I set a flag from within the callback and have a wait loop in my main thread checking that flag?

Is migration even neccessary?

Parents
  • Hi Frank,

    We currently don't have a migration note for pstorage.

    pstorage is first implemented on Softdevice S110 v6.0.0 (currently beta). So if you use softdevice v5.x you should use ble_flash.

    If you plan to use ble_flash on S110 v6.0.0 ..(See EDIT)

    Regarding the asynchronous property of pstorage, as you can find in the description of pstorage_store (), you should not modify or change the input data until the callback is received. So your approach to set a flag in the callback for the loop in main is a proper way of handling it.

    EDIT: [b]I was in correct about ble_flash and S110 v6.0.0. It was not possible to access NVMC when softdevice is active. So ble_flash should not be used with S110 v6.0 I am sorry for giving the wrong information. [/b]

  • @Frank: if there is data is the area you plan to write you would need to clear it before you store. You need to do it manually using pstorage_clear(). When you call pstorage_clear() all blocks that registered with the same pstorage_handle_t will be cleared. Please have a look in bondmngr library for reference.

    attribute((aligned)) is documented here in KEIL documentation, so I expect that it should be supported: http://www.keil.com/support/man/docs/armccref/armccref_Cacjcjce.htm

Reply Children
No Data
Related