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

Serial DFU tool

I have a nrf51-DK, SDK 9.0, S110, dual-bank bootloader that supports both serial and ble protocols, developed using GCC/Eclipse. I'm able to flash my app/bootloader/softdevice using JLink through Eclipse as well as update my app via OTA. Now I need to be able to update the app via serial reflash. I use nRF Toolbox to do the OTA. Is there a similar app capable of performing serial reflash of my app? I see the format of the data and the handshake back and forth described here - infocenter.nordicsemi.com/index.jsp. Is there a tool/script available that implements this, or do I need to write this myself?

UPDATE: It looks like nrfutil is the program I need to do a serial reflash of my app. However, I'm having issues getting it to work. Here is what I'm sending:

nrfutil.exe dfu serial --package C:\Firmware\strobe\build\obj_strobe\strobe.zip --port 11 --flowcontrol --baudrate 38400

And here is what I get back:

Upgrading target on 11 with DFU package C:\Firmware\strobe\build\obj_strobe\stro be.zip. Flow control is enabled. [------------------------------------] 0%

Failed to upgrade target. Error is: Serial port could not be opened on 11. Reaso n: could not open port u'11': WindowsError(2, 'The system cannot find the file s pecified.')

Possible causes:

  • bootloader, SoftDevice or application on target does not match the requirement s in the DFU package.
  • baud rate or flow control is not the same as in the target bootloader.
  • target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.

C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>

I have first put by dev kit into serial bootloader mode upon reset - I have LED3 lit.

From Windows Device Manager, I can see that Com11 is the correct port:

image description

The package file, strobe.zip, is the same file I use to program the device OTA, which works correctly. I generated it using the following: "c:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio"nrfutil dfu genpkg strobe.zip --application strobe.hex --application-version 0xffff --dev-revision 0xffff --dev-type 0xffff --sd-req 0xfffe

Any ideas what I might be doing wrong? Thanks!

  • Hi, you can use nRFgo studio if you want a GUI for this. See the nRF5x bootloader item listed in Device manager. However, the approach you describe above should work. Please try with nRFgo studio and see if you still get the same error.

    EDIT 16.11 Tried the same in the command line:

    image description

    I suggest to try with the same arguments and check if it still doesn't work.

  • I tried nRFgo Studio and this worked. However, I would still like to get the command line version of this working since it needs to be run in a production and scripted environment. I changed my original command line and replaced "--port 11" with "--port COM11", and this got me further. However, it still did not succeed. I'm now getting the following error:

    C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfutil.exe dfu serial --package C:\Firmware\strobe\build\obj_strobe\strobe.zip --port COM11 --flowcont rol --baudrate 38400

    Upgrading target on COM11 with DFU package C:\Firmware\strobe\build\obj_strobe\s trobe.zip. Flow control is enabled. [------------------------------------] 1% 00:18:17Timed out waiting for ac knowledgement from device.

    Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.

    Possible causes:

    • bootloader, SoftDevice or application on target does not match the requirement s in the DFU package.
    • baud rate or flow control is not the same as in the target bootloader.
    • target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.

    So it looks like my command line is still off, but not sure where. Any suggestions?

  • Brian did you accomplished to solve this bug? were you able to load the files?

  • Hi There,

    Did you managed to resolve your prob? I facing this issue with s132_nrf52_5.0.0_softdevice using nRFgo studio with the following message.

    Timed out waiting for acknowledgement from device.

    Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.

    Error msg

    my setting

  • Hi,

    The serial DFU feature in nRFgo studio supports the legacy bootloaders only (pre-SDK 12). For the new secure DFU bootloaders  you can use nrfutil.

Related