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

when Pstorage_clear is done?

Hello, I am using pstorage function and I would like to know oppionions of your's what would be the best practise to wait until processor erases the flash memory and would ready for other actions? How should I know the process have been done?

here is the clear function: image description

here is how I use it: image description

I am thinking that NRF_NVMC->READY register is never being busy (it's value never =0). Is it possibile, because if try to turn LED while NRF_NVMC->READY is busy it never turns on.

Parents
  • The pstorage operations other than read are asynchronous. Once you call them and they return you must wait for a flash event to come back from the soft device to indicate that the operation is complete. The mechanism you use above will almost certainly not work as the operation probably hasn't even been scheduled yet. Many people seem to use a flag that is set or cleared when the flash operation completes to know that they can proceed.

    Search for pstorage posts here in the forum, there is a ton of discussion on this if you dig for a few minutes.

Reply
  • The pstorage operations other than read are asynchronous. Once you call them and they return you must wait for a flash event to come back from the soft device to indicate that the operation is complete. The mechanism you use above will almost certainly not work as the operation probably hasn't even been scheduled yet. Many people seem to use a flag that is set or cleared when the flash operation completes to know that they can proceed.

    Search for pstorage posts here in the forum, there is a ton of discussion on this if you dig for a few minutes.

Children
Related