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

nRF52840 SDK16 - OTA DFU - Application version

Hi everyone,

I am working on buttonless OTA DFU. I have generated my own private and public keys using nrfutil and created the .zip file for DFU.

While generating the ZIP file I had to include application's version as shown:

nrfutil pkg generate --hw-version 52 --application-version 1 --application BLE_IMU_V4.hex --sd-req 0xCA --key-file private.key app_dfu_package.zip

I am a bit confused regarding the versioning. What I have understand so far is that there are two types of versions, the application version and the bootloader version.

According to Acceptance rules for versions, to update the bootloader, the version of the image must be greater than the version of the existing bootloader. While, to update the application the image is accepted if the new firmware version is greater than or equal to (>=) the existing version of the bootloader.

1. Can I use float numbers for versioning e.g 1.1

2. What is the procedure if I want to initialize the version numbering (for example to downgrade from v.5 to v.1). I need to compile a new bootloader with new public key?

3. When I flashed the secure bootloader I was not asked to enter any version.. I just used nrfjprog -f NRF52 --program file.hex --chiperase -r to flash the softdevice and nrfjprog -f NRF52 --program file.hex  -r  to flash the bootloader. So, If I want to flash a new secure bootloader how I will increament its version? Is this something that is performed automatically by the system?

4. How can I keep track of the current version of the application? I mean how could I know the current version of my application running on chip?

Thanks in advance

Nick

3. How can I track the current version of the bootloader and firmware? For example I've flashed

  • Hello,

    1. Can I use float numbers for versioning e.g 1.1

     Technically not a float, but you can specify the application version as a string instead of an integer value, see help text below.

    nrfutil pkg generate --help

    2. What is the procedure if I want to initialize the version numbering (for example to downgrade from v.5 to v.1). I need to compile a new bootloader with new public key?

    Downgrades can be accepted by building the bootloader with NRF_DFU_APP_DOWNGRADE_PREVENTION disabled in sdk_config.h

    3. When I flashed the secure bootloader I was not asked to enter any version.. I just used nrfjprog -f NRF52 --program file.hex --chiperase -r to flash the softdevice and nrfjprog -f NRF52 --program file.hex  -r  to flash the bootloader. So, If I want to flash a new secure bootloader how I will increament its version? Is this something that is performed automatically by the system?

    The version numbers are specified when you generate Bootloader settings page. You can find instructions on how to generate it here: Combine application, bootloader and softdevice image - Bootloader setting

    4. How can I keep track of the current version of the application? I mean how could I know the current version of my application running on chip?

     It will be stored in the bootloader settings structure (nrf_dfu_settings_t) at the last flash page, so you can reference it with a pointer.

    Best regards,

    Vidar

Related