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

Fstorage queue

nRF52832 SDK14.0

Hi,

I had two questions regarding Fstorage:

  1. The Fstorage module works by having a queue of NVM operations. This queue only holds two types of operations: Erase and Write operations. It doesn’t hold any read operations in the queue. Is this correct? If it is, what happens if there are multiple read requests at the same time?

  2. When using the Fstorage module using the NVMC backend, it doesn’t seem like it has a queue of operations. What happens if there are multiple write requests from multiple clients?

Thank you.

Parents
  • Hi,

    1. Read operations are always blocking function calls when using Fstorage, regardless of backend. Multiple reads from the same address should not be an issue if using threading.
    2. Write and Erase operations are blocking when using the NVMC backend with Fstorage. The function calls will not return until the operations are completed. Note that the event is still passed to the event handler when operation is completed. The write/erase operations are protected by the flash_operation_ongoing flag, to prevent multiple users to perform flash operations simultaneously.

    Best regards,

    Jørgen

    1. Yes, this is correct. Read operations are implemented using memcpy function, and will block until read is completed.
    2. The write/erase operations will be executed using the Softdevice Flash API for safe writing. If multiple operations are scheduled, they will be executed in FIFO order. Read operations were previously not part of Fstorage, as it is a trivial operation to read from flash. No events have been added at this point, as it does not take the same amount of time to read as it does to write/erase flash.
Reply
    1. Yes, this is correct. Read operations are implemented using memcpy function, and will block until read is completed.
    2. The write/erase operations will be executed using the Softdevice Flash API for safe writing. If multiple operations are scheduled, they will be executed in FIFO order. Read operations were previously not part of Fstorage, as it is a trivial operation to read from flash. No events have been added at this point, as it does not take the same amount of time to read as it does to write/erase flash.
Children
No Data
Related