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

nRF51 Flash Write/Erase fails with success status

Hello,

Our device based on nRF51822 with SD110 v.8.0.0. The firmware use defined area in top of the flash to store some data. The "RAW" functions sd_flash_write and sd_flash_page_eraseare used for flash write and erase operations correspondingly.
The next construction used for checking success of flash operation:

while (sd_evt_get(&evt_id) != NRF_ERROR_NOT_FOUND) {
   if (evt_id == NRF_EVT_FLASH_OPERATION_SUCCESS){
   //SUCCESS
   }else if (evt_id == NRF_EVT_FLASH_OPERATION_ERROR){
   //ERROR
   }
}

In general, it works for a long time without any troubles.
However, is some cases both write and erase operations return success while flash area remained unchanged. I made some investigation and nodiced some dependence of influence of power supply on actual result of flash operation. In our device we use CR2032 batteries for powering and in seem that on sligtly discharged batteries this failure behavior is more repetable. I enabled NRF_EVT_POWER_FAILURE_WARNING at level NRF_POWER_THRESHOLD_V25 and effect became even more noticeable because the warning notifies about the voltage drops lower than 2.5v and problem with flash taking place. So my questions regarded:

  1. Is described effect investigated? Any reports?
  2. Why NRF_EVT_FLASH_OPERATION_SUCCESS status received if no changes in flash? Does Softdevice make verification of written/erased area?
  3. Any workarounds except battery replacement and doing "manual" verification by reading defined area?
Parents Reply Children
Related