[DFU] How to create dfu using a standalone command

Hi,

i am developing under NCS 3.2.1.

I would like to if there exist a stand-alone command for creating DFU (nrfutil sub-command or similar) instead of https://github.com/nrfconnect/sdk-nrf/blob/v3.2.1/scripts/bootloader/generate_zip.py.

Thank you,

Alessandro

Parents
  • Hi all,

    To keep it simple, I will assume the case is for an application with MCUboot as an immutable bootloader.

    TL;DR: To manually generate files for DFU, use imgtool.py.

    zephyr.signed.bin

    To update an application with MCUboot, you need zephyr.signed.bin. This file is automatically generated by our build system, as part of the Output Build Files.

    You can generate your own signed binary manually using imgtool.py if you prefer. If you do this, you can start with build/<app>/zephyr.hex, which is your application.

    To learn how to upload zephyr.signed.bin to a device to perform DFU, see DevAcademy -> nRF Connect SDK Intermediate ->  Lesson 9 on DFU.

    dfu_application.zip

    Some places you see dfu_application.zip being generated and used, such as in the DevAcademy course for FOTA. However, in this case, dfu_application is not used directly by the SoC. Instead, dfu_application contains zephyr.signed.bin and a manifest json file. The application responsible for the DFU, for example nRF Connect for Mobile or nRF Cloud, will then unzip this file, and DFU the containing zephyr.signed.bin as instructed in the manifest file. This method is useful for more flexible DFU solutions, such as multi image DFU.

    The script you refer to is used to generate dfu_application.zip from already signed binary files.

    Regards,
    Sigurd Hellesvik

  • You're on the right track, but this rabbit hole has a lot of blind alleys. I was able to download and install Python, but now I'm stuck on finding Pip3. I would really like to find or create a simple Windows app that my customer could use to program a simple hex file via DFU to my target (currently nRF52840, could be 52832 on future products). Just using this for field firmware updates.

  • That's fine, in fact imgtool is standlone and can be downloaded as python package: 

    https://pypi.org/project/imgtool/

    Why don't  you think to make also https://github.com/nrfconnect/sdk-nrf/blob/v3.2.1/scripts/bootloader/generate_zip.py  as stand-alone python package (along with its dependecies)?

    Also this one https://github.com/nrfconnect/sdk-nrf/blob/v3.2.1/scripts/generate_psa_key_attributes.py for creating public keyfile would be useful to have as stand-alone pyhon package (need for client to generate the public key file).

    You will easily resolve the needs of most users to have such tool, without digging in nrf repository to find that script....

  • Back at this after a couple days with other distractions. I've read thru the above links, and tried to follow them, but I hit dead ends everywhere. I downloaded nrfutil.exe, but nrfutil list shows me zero commands installed. Where can I download the commands, and why is it a dead end as downloaded?

    To clarify, I don't need to DFU a bootloader, nor probably even the softdevice. Both of those will be in the device when shipped. I just need to be able to have a relatively novice user be able to update the application firmware. I should be able to provide an executable and a hex file, or even better, an executable with my hex file embedded, that the user can run to update the application firmware.

  • Further clarification: The immediate need is for an nRF52840 system, but I also have nRF52832 based systems in the field that could benefit.

  • SteveHx said:
    but nrfutil list shows me zero commands installed.

    Correct. nrfutil is a tool manager that lets you install multiple tools with it.

    Do "nrfutil search" to list alternatives and then "nrfutil install ..." for what you need.

    If Im correct and you need nRF5 SDK DFU, you can do 

    nrfutil install nrf5sdk-tools

    and then use "nrfutil nrf5sdk-tools ..." as described in  nrf5sdk-tools: Generating DFU packages.

    If you need more help with nRF5 SDK DFU, could you open a new ticket for it?
    This is because this ticket is originally about nRF Connect SDK DFU, so let's try to not confuse future readers of this ticket.

  • Since I just downloaded nrfutil.exe in the past week or so, I would expect all required resources to still be available. When I do

    nrfutil install nrf5sdk-tools

    The response is

    Error: Failed to install nrfutil-nrf5sdk-tools

    Caused by:
        0: Could not download package
        1: failed to download from `developer.nordicsemi.com/.../nrfutil-nrf5sdk-tools-x86_64-pc-windows-msvc-1.0.1.tar.gz`
        2: failed to get 200 response from `developer.nordicsemi.com/.../nrfutil-nrf5sdk-tools-x86_64-pc-windows-msvc-1.0.1.tar.gz`, got 410

    Okay, so let's see what's going on under the hood. Putting that link in my browser (FireFox), yields:

    Gone

    The requested resource
    /.pc-tools/nrfutil/nrfutil-nrf5sdk-tools-x86_64-pc-windows-msvc-1.0.1.tar.gz
    is no longer available on this server and there is no forwarding address. Please remove all references to this resource.

    Also tested with Chrome and Edge, same result.

    Any system with so many scattered pieces is bound to lose a few now and then. But where did it go?

Reply
  • Since I just downloaded nrfutil.exe in the past week or so, I would expect all required resources to still be available. When I do

    nrfutil install nrf5sdk-tools

    The response is

    Error: Failed to install nrfutil-nrf5sdk-tools

    Caused by:
        0: Could not download package
        1: failed to download from `developer.nordicsemi.com/.../nrfutil-nrf5sdk-tools-x86_64-pc-windows-msvc-1.0.1.tar.gz`
        2: failed to get 200 response from `developer.nordicsemi.com/.../nrfutil-nrf5sdk-tools-x86_64-pc-windows-msvc-1.0.1.tar.gz`, got 410

    Okay, so let's see what's going on under the hood. Putting that link in my browser (FireFox), yields:

    Gone

    The requested resource
    /.pc-tools/nrfutil/nrfutil-nrf5sdk-tools-x86_64-pc-windows-msvc-1.0.1.tar.gz
    is no longer available on this server and there is no forwarding address. Please remove all references to this resource.

    Also tested with Chrome and Edge, same result.

    Any system with so many scattered pieces is bound to lose a few now and then. But where did it go?

Children
Related