Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

wait_for_flash_ready Not Returning

Hi team,

I am using SDK V16.0.0 and looking at the flash_fstorage_s140 example. There are wait_for_flash_ready function calls after the nrf_fstorage_write function calls in the main.c file. However, in the cli.c file, when using the fstorage_write command, there is no wait_for_flash_ready function used.

Is this wait_for_flash_ready necessary? When we use it in our application, it is not returning from the wait_for_flash_ready. Do we need to include it? If we do not include it, will there be data corruption?

Regards,

Akash Patel

  • If you are using the fstorage module, then the fstorage module can queue several flash operations, the fstorage module will then run the flash operations after eachother. This means there may be no reason to wait for FlashWaitForFlashReady() as long as nrf_fstorage_write() and nrf_fstorage_erase() doesn’t return NRF_ERROR_NO_MEM.

    Is this wait_for_flash_ready necessary?

    Not really, maybe if you want to read it back again immediately or want to go to system OFF, then it make sense to ensure that "flash is ready". However in such case you may just as well use nrf_fstorage_is_busy(NULL); to check if there is any on-going flash operations, before reading data or going to system OFF.

Related