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

NRF_EVT_FLASH_OPERATION_SUCCESS fired only if Radio notifications enabled.

Hello, Before writing here I made some forum search and didn't find the answer. Previously I used radio notifications to sync ADC measurements with radio events. Now I need to disable radio notifications in the project and noticed that firmware become working unstable. The BLE connection breaks ocasionally and the flash write operations stuck. Softdevice used S110. I do not use pstorage but use own functions. Flash operation states are read from SD_EVT_IRQHandler (SWI2) ( NRF_EVT_FLASH_OPERATION_SUCCESS and NRF_EVT_FLASH_OPERATION_ERROR ). Noticed that no interrupt fired after flash operation (sd_flash_write()) . What could cause such behaviour? Why enabling Radio notifications make flashoperation working?

P.S. I read the errata for softdevice but do not see the link with my issue.

Parents
  • The scheme of my NV functionality is next:

    void SD_EVT_IRQHandler(void){
     uint32_t evt_id;
     while (sd_evt_get(&evt_id)!= NRF_ERROR_NOT_FOUND){
    switch (evt_id){
    case NRF_EVT_FLASH_OPERATION_SUCCESS:
    if(need_to_write) sd_flash_write();
    else set(EVENT);
    break;				
     case NRF_EVT_FLASH_OPERATION_ERROR:            
    set(EVENT);
    break;
    }
    }
    	
    void flash_write(){  //erase page and wait until write operation started on erase operation finished. Than after write operation finished issue EVENT to break while loop.   
    sd_flash_erase();
    while( !EVENT || !TIMEOUT);
    }
    

    This works if radio notifications enabled, otherwise no interrupt triggered.

Reply
  • The scheme of my NV functionality is next:

    void SD_EVT_IRQHandler(void){
     uint32_t evt_id;
     while (sd_evt_get(&evt_id)!= NRF_ERROR_NOT_FOUND){
    switch (evt_id){
    case NRF_EVT_FLASH_OPERATION_SUCCESS:
    if(need_to_write) sd_flash_write();
    else set(EVENT);
    break;				
     case NRF_EVT_FLASH_OPERATION_ERROR:            
    set(EVENT);
    break;
    }
    }
    	
    void flash_write(){  //erase page and wait until write operation started on erase operation finished. Than after write operation finished issue EVENT to break while loop.   
    sd_flash_erase();
    while( !EVENT || !TIMEOUT);
    }
    

    This works if radio notifications enabled, otherwise no interrupt triggered.

Children
No Data
Related