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

pstorage_store and pstorage_update execution time

Hello

Where can I find operating characteristics of pstorage_store and pstorage_update?

Actually, I observe that about 100 ms are needed to update 4 bytes data. For me, it seems a little long for an internal memory access.

Is it normal ?

Thanks

Parents
  • Hi

    According to the nRF51822 PS v3.1 table 61, flash write operation takes up to 46.3us and flash erase takes up to 22.3ms. Flash erase can be performed on minimum a whole page, i.e. 1024 bytes. Flash write can be done on minimum one word, i.e. 4 bytes.

    What happens when you issue an pstorage_update is as follows:

    • The so called swap page is erased
    • The data of the updated page that is not being updated is written to the swap page
    • The page is erased
    • The update data is written to the flash page
    • The the remainder of the page that is not to be updated is written back to the page from the swap page

    So the pstorage_update command actually contains at least two flash erase commands and multiple flash write commands, which explains how long it takes.

Reply
  • Hi

    According to the nRF51822 PS v3.1 table 61, flash write operation takes up to 46.3us and flash erase takes up to 22.3ms. Flash erase can be performed on minimum a whole page, i.e. 1024 bytes. Flash write can be done on minimum one word, i.e. 4 bytes.

    What happens when you issue an pstorage_update is as follows:

    • The so called swap page is erased
    • The data of the updated page that is not being updated is written to the swap page
    • The page is erased
    • The update data is written to the flash page
    • The the remainder of the page that is not to be updated is written back to the page from the swap page

    So the pstorage_update command actually contains at least two flash erase commands and multiple flash write commands, which explains how long it takes.

Children
Related