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

DFU fails with "Operation failed" error 200204

I am using the secure DFU bootloader without bonding. Sometimes it DFUs successfully. Sometimes it produces this. I notice there is an error 0x200204, which I believe implies the DFU bootloader is returning NRF_ERROR_INVALID_STATE in nrf_dfu_set_adv_name_on_sys_evt. Is that right? I do not know exactly how to reproduce this error, When I power cycle, this error goes away and I can DFU again. 

S132 5.0.0 

SDK 14.0 

iOS app

Parents
  • Hi,

    Yes, the error indicates that bootloader failed to store the new advertisement name to flash, possibly due to flash timeout. However,  I haven't seen this error actually being triggered before.

    A flash timeout means that the softdevice was unable  to schedule a flash operation which was successfully requested by the application/bootloader. This should not happen unless there is a lot of BLE activity in parallel with the flash writes. Please have a look at table 1 in the Flash memory API chapter and see if your application meets any of the criteria for low to medium probability of success.

    Also, if it is not too hard to reproduce, it would be great if we could  confirm whether this is a flash timeout or not. You can place a breakpoint or blink a led in bootloader-> nrf_dfu_scvi_handler.c-> nrf_dfu_set_adv_name_on_sys_evt->NRF_EVT_FLASH_OPERATION_ERROR to verify this. 

Reply
  • Hi,

    Yes, the error indicates that bootloader failed to store the new advertisement name to flash, possibly due to flash timeout. However,  I haven't seen this error actually being triggered before.

    A flash timeout means that the softdevice was unable  to schedule a flash operation which was successfully requested by the application/bootloader. This should not happen unless there is a lot of BLE activity in parallel with the flash writes. Please have a look at table 1 in the Flash memory API chapter and see if your application meets any of the criteria for low to medium probability of success.

    Also, if it is not too hard to reproduce, it would be great if we could  confirm whether this is a flash timeout or not. You can place a breakpoint or blink a led in bootloader-> nrf_dfu_scvi_handler.c-> nrf_dfu_set_adv_name_on_sys_evt->NRF_EVT_FLASH_OPERATION_ERROR to verify this. 

Children
  • My setup breaks if I try to turn the debug logs on for some reason and there are only a few pins. On top of that, this error is kind of hard to reproduce. It's more important for me to react to it. In the past, I notice that if I get "operation failed", restarting the DFU process makes the "operation failed" message appear again until I manually reset the nRF. Then I can DFU successfully. 

    If the operation failed, how do I restart the flash operation? Or do I just insert a call to NVIC_SystemReset if I detect NRF_EVT_FLASH_OPERATION_ERROR?

  • I think it's probably best to recover with a system reset since we don't know the root cause.

    "Or do I just insert a call to NVIC_SystemReset if I detect NRF_EVT_FLASH_OPERATION_ERROR?"

    Yes, this should work as long as the issue is caused by flash timeout. Another option is to do it from the app after the error message is sent.

Related