[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

  • Let’s suppose:

    • I need to design, for a client, a hardware/firmware system based on the nRF54.
    • During the production phase, the client wants to manage their own private/public keys for firmware signing.
    • At each firmware release, I will provide the client with unsigned images.
    • The client must then sign the images and create the DFU package independently.

    How can they do this without downloading the entire nRF Connect SDK?

  • Bad idea. You just experienced why - the resulting mess will be very difficult to maintain. SDKs are moving targets...

    Since your client is not an end user I don't see the problem with installing NCS SDK and toolchain. Makes all the dependency tracking a lot simpler since it everything was already included.

    I rather waste a couple of GB worth of HDD space instead of waiting a few extra weeks for the deliverables.

  • Ok- but i do not think that my case is so uncommon...i would expcet that nrfutil embeds those utilities...

  • I concur. I don't need complexity for the sake of complexity. I just want an app that can take the hex file output of the build tools, and program it using DFU into a processor that already has the required bootloader. I have many projects I need to continue supporting using Segger, but will take a look at moving to Zephyr.

  • In short: Exactly what you are looking for does not exist.
    However, you should be able to achieve what you need, but it will require some effort.

    longo92 said:
    .i would expcet that nrfutil embeds those utilities..

    nrfutil does not support signing binaries for DFU.
    It did support this for the legacy nRF5 SDK bootloader, but not for the nRF Connect SDK. => We can rule out nrfutil as an opetion for a standalone script.

    longo92 said:

    Let’s suppose:

    • I need to design, for a client, a hardware/firmware system based on the nRF54.
    • During the production phase, the client wants to manage their own private/public keys for firmware signing.
    • At each firmware release, I will provide the client with unsigned images.
    • The client must then sign the images and create the DFU package independently.

    How can they do this without downloading the entire nRF Connect SDK?

    This use-case makes sense to me, and why you do not want to have to download the nRF Connect SDK. 

    imgtool.py is the script you need for this. imgtool has dependencies on python and some pip packages, yes.
    However, python and pip packages are common developer tools, and personally I would argue that it is within reason to expect developers to be able to run python scripts.

    If you do not want the signer to have to install python or pip packages, you are free to include imgtool.py into a stand-alone tool you make yourself, which matches your requirements. I think for example "pyinstaller" is one tool that could help with this.
    PS: I found "pyinstaller" with a web search, so do take this suggestion with a pinch of salt.

    EDIT: Also see that imgtool is a standalone package, as longo remarked as a response to this comment.
    Referenced as such:

    longo92 said:

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

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

Related