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

nrfutil dfu very slow compared to nrf connect dfu

Using the same connectivity firmware, a dfu update using nrfutil takes about four times as long as the same update using nrf connect. I have to setup dfu updating in a production setup and need a command line driven dfu process. Any options to speed up nrfutil, or alternatives to nrfutil?

  • Ok, thanks for the follow up.

    I suppose there is no other command line DFU possibility?

  • Since the source code for both nRFConnect and nRFUtil are available on Github, there is an option that you take these code and either take the code from NRFConnect and make it commandline, or modify the code in nRFUtil to make it send more packet.

    Unfortunately, I'm not familiar with both of them and we have reduced staff in this period so I couldn't help.

  • Hi, any update here? I checked the python sources for nrfutil, but could not find a way to force multiple packets per conenction interval...

  • Hi bds,

    It's very unfortunate that the developer who worked on DFU on nrfutil moved. So I couldn't get hold of him. I had a look in the code and seems that it may requires some change in the lower level at pc_ble_driver_py library . You can have a look here at line 322. We send a write command and we wait for a TX_COMPLETE event before we continue. This explains why the nrfutil only send one packet per event.

    It's possible to modify that and queue more packet and don't wait for TX_COMPLETE. Then retry when the buffer is full.

    If you don't want to implement that, I would suggest to simply reduce the connection interval, for now it's 30 ms, you can change it to 7.5 ms and will have the update 4 times faster. To change connection interval you need to modify BLEGapConnParams in on_gap_evt_adv_report() in dfu_transport_ble.py. And update MIN_CONN_INTERVAL and MAX_CONN_INTERVAL in nrf_ble_dfu.c in the bootloader.

    Another, better solution is simply use the node.js javascript that used in nRFConnect to do the updating. And you can do it on commandline. Have a look here, you can find the syntax

    node dfu.js FF:11:22:33:AA:BF ./dfu/dfu_test_app_hrm_s132.zip
    
  • Hi, I tried the java script and it's faster indeed. However, i ran into another problem:

    • if i run the script from my computer, the dfu takes about 30s
    • if i run the script from another computer (our production setup), the dfu takes about 1min20s
    • if i connect from my computer through remote desktop to that other computer, the dfu takes again 30s...

    The same behavior can also be observed using nrfutil.

    Any idea why the dfu process could be running slower on another computer, and why this would be solved connecting with remote desktop? I'm guessing it has something to do with the serial port driver, but could not find any explanation for now...

Related