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

How to add a custom marker by the package generated by nrfutil?

I want to know how to add custom field in the firmware package generated using nrfutil? I generate three firmwares but sometimes its error prone, I saw wrong firmware flashed on the device, is it possible to verify the package?

My manifest.json file looks like this,

{
    "manifest": {
        "application": {
            "bin_file": "ble_app_template_pca10056_s140.bin",
            "dat_file": "ble_app_template_pca10056_s140.dat"
        }
    }
}

I use --application-version-string 2, but this helps one inspecting the file, I want something to be written inside the manifest file.

example 

{
    "manifest": {
        "application": {
            "version":  "1.0.0.panther",
            "bin_file": "ble_app_template_pca10056_s140.bin",
            "dat_file": "ble_app_template_pca10056_s140.dat"
        }
    }
}

  • Hi,

    We do not have that kind of functionality in nrfutil, but:

    You can show all information about a DFU package using the command "nrfutil pkg display ZIP_FILE", where ZIP_FILE is the name of the DFU package zip file. This will reveal application version among other information about the package.

    If you still need to change the manifest file, or do other modifications to the generated DFU package, there are a couple of ways to do so:

    You could write command line scripts to use as a wrapper around nrfutil, so that: A "packet generating" script first generates a packet using nrfutil and then edits the manifest file of that packet. A "perform DFU" script first checks the version field of the manifest, then (if the version is correct) performs DFU using nrfutil.

    Alternatively, the source code for nrfutil is available on Github. This means it should be possible for you to patch nrfutil to get the wanted behavior, if you want it inside of nrfutil. A drawback of modifying nrfutil this way is you have to patch future versions of nrfutil the same way.

    Although both a script and direct modification of nrfutil are possible, the "nrfutil pkg display" command should cover at least 99 % of use cases.

    Regards,
    Terje

Related