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

Thread (Background) DFU - How to get progress in app?

Hello, and thanks for all the great examples!

I've gotten the COAP transport for background DFU working on my custom hardware platform and app, however I have noticed that occasionally the DFU process will hang, with the app never retrying a block request. If I add a periodic `coap_dfu_reset_state`, and `coap_dfu_trigger`, the dfu process will continue. How can I access the current progress of the DFU procedure so that I can set a timeout in the application? I see that there is a way to get a diagnostic struct with `coap_dfu_diagnostic_get`, but the fields of interest about total/current block progress seem to only be updated during a multicast update.

Additionally, I have found some bugs that I needed to fix to get the example working without compiler warnings with gcc. In particular, the assert on line 486 in `nrf_dfu_req_handler.c` had to be commented out, as the background dfu does not actually set the `callback.write` function pointer.

In `background_dfu_block.c` there were warnings about comparison between unsigned and signed integers on lines 156, 394, and 440, and should be explicitly cast.

In `nrf_log_backend_interface.h` the use of STRINGIFY on line 148 should be explicitly cast to a `char *` to avoid a warning about disregarding a const.

Related