[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.

  • Let us take a step back here:

    Why do you need a standalone app to generate the file for DFU?
    The easiest way is normally to get the automatically generated zephyr.signed.bin.
    Let's have a look at why this method is not a good fit for you, and we can hopefully find out which solution is best for your use-case

  • 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.

Reply
  • 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.

Children
Related