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

What conditions cause OP_CODE_SYS_RESET to get sent during DFU?

Hi, I'm testing doing a soft device update (v7.0 to v7.1) over DFU, but I consistently get OP_CODE_SYS_RESET sent to my device after 4 packets(80 bytes), at which point the update fails. I'm using an Android device using nRF Toolbox v1.4 to perform the update. I'm curious what would cause the android device to send that op code. thank you, akbar

Parents
  • Hi Hung, I believe I've solved the issue. It has to do with timing between when "pstorage_raw_clear" is called during "dfu_sd_prepare" and when the first data packets start to arrive. Basically, firmware image data packets are arriving before "pstorage_raw_clear" has a chance to finish. This causes a backup in the hci memory pool module, because there is no place for these incoming packets to go(can't write to flash while it's being cleared). Ultimately the hci memory pool runs out of space and I get the NRF_ERROR_NO_MEM message which is causing DFU to fail.

    I was able to solve this issue by waiting until "pstorage_raw_clear" finishes before calling "ble_dfu_response_send" which notifies the Controller that the Start Packet (OpCode 1) has been properly handled and that the Controller can move on to the Init Packet (OpCode 2) or Firmware Image Packets (OpCode 3).

  • Hi Akbar,

    I believe that our code (SDK v6.1) does wait for the raw clear command to complete with state = DFU_STATE_PREPARING until we receive the callback pstorage_callback_handler() with PSTORAGE_CLEAR_OP_CODE. After that we will send the notification back to the DFU master (using m_data_pkt_cb(START_PACKET, result, p_data), please see pstorage_callback_handler() .

    The DFU peer master should wait for this notification before proceed.

Reply
  • Hi Akbar,

    I believe that our code (SDK v6.1) does wait for the raw clear command to complete with state = DFU_STATE_PREPARING until we receive the callback pstorage_callback_handler() with PSTORAGE_CLEAR_OP_CODE. After that we will send the notification back to the DFU master (using m_data_pkt_cb(START_PACKET, result, p_data), please see pstorage_callback_handler() .

    The DFU peer master should wait for this notification before proceed.

Children
No Data
Related