This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pstorage_store vs pstorage_update

Hi.

I have been trying to store data in flash by using pstorage. What's the difference between pstorage_store and pstorage_update?

At the first time, I can save data by pstorage_store without error at the callback function. But if I try to save data again at the same block, the data is not saved even though there is no error at the callback function.

And when I use pstorage_update instead of pstorage_store, I get 0x11(Edited : NRF_ERROR_BUSY) error even though I don't get any error when I use the same data for pstorage_store.

Any idea on what is happenning here?

My development environment:

・nRF51822 Developer Kit

・iOS 7.1 iPhone5s

・nRF6310 Rev 1.4

・S110-SD-v6

Parents
  • Hi, RK. Thank you for your reply. You are right. That was a quite silly mistake.... The error means actually NRF_ERROR_BUSY as you mentioned.

    But still I don't understand why I keep getting NRF_ERROR_BUSY error. I tried using nrf_delay_us and/or timer but still I get NRF_ERROR_BUSY error.

    I also tried like this :

    uint32_t    count  = 1; 
    while(count > 0){
    	pstorage_access_status_get(&count);
    }
    

    But this loop won't finish....

    Do you know how to handle this issue?

    Edit : It turns out that this is a bug of SDK(pstorage.c). Just add

    retval = NRF_SUCCESS;

    to line 379 of pstorage.c. It should look like this :

    if (retval != NRF_ERROR_BUSY) {
         app_notify (retval); 
    } else  {   
         // In case of busy next trigger will be a success or a failure event.           
         retval = NRF_SUCCESS;
    }
    
  • You are welcome :) This is an official bug and the way to kill the bug was given by Nordic.

Reply Children
No Data
Related