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

How can opertaion the pstorage for flash write and read? use S110 V7.1.0,nrf51822,

I use S110 V7.1.0,nrf51822 chip, now I need write and read flash data in BLE mode.

When can I write the flash data at BLE mode?

When can I read the flash data at BLE mode?

Who can offer me an example?

  • Hi Mike

    Thanks for your question.

    The pstorage guide is here. This thread provides a pstorage example.

    Basically, the pstorage module implements a queuing system for flash commands, so that the application can just send flash commands (write/clear) to the pstorage module without worrying about timing. The thing that you must realize however is that if you want to read back the flash data, you must wait for it to be written first, because read commands are not queued in the pstorage queue, pstorage data is just immediately read from the memory map. This wait is implemented in the pstorage example provided.

    Flash write/erase operations and radio activity can not happen concurrently. Flash clear operation takes about 22ms typically. If you have BLE connection interval <~30ms, it is not possible for the softdevice to schedule a flash erase (pstorage clear) operation between BLE radio events. In that case, the softdevice will occasionally cancel BLE radio event in order to erase a flash page. This will degrade BLE throughput and occasionally increase delay. This will appear to be a packet loss seen from the peer device.

Related