This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

regarding DFU

Hi. I'm using nRF52832, SDK13, S132V4.0.2. I'm trying to test DFU. I have 2 questions.

Q1. How can I make image for merged files? I can see it works very well when I make zip files as below.

BOOT : nrfutil pkg generate --hw-version 52 --sd-req 0x98 --bootloader-version 0x11 --bootloader boot.hex --key-file priv_0407.pem boot_dfu_package.zip

APPLICATION : nrfutil pkg generate --hw-version 52 --sd-req 0x98 --application-version 0x11 --application application.hex --key-file priv_0407.pem app_dfu_package.zip

SOFT DEVICE : nrfutil pkg generate --hw-version 52 --sd-req 0x98 --softdevice s132_nrf52_4.0.2_softdevice.hex --key-file priv_0407.pem sd_dfu_package.zip

Each DFU operations are very good.

But how can I make zip files merged. for example, boot+application or application + soft device or boot+soft device or boot+application+soft device?

Q2. What if DFU fails? If communication is disconnected during DFU or Something could be happend. Does DFU program save old program? I want to know how it works. Can you give me an advise for it?

I hope your reply.

Parents
  • Hi Roger,

    Q1: You can create combined images, e.g. SoftDevice+Bootloader, by combining the --application, --softdevice and --bootloader options. The allowed combinations are shown in the table below and is also displayed in nrfutil's documentation found here.

    image description

    So if you want to create a SoftDevice+Bootloader firmware image you use the following command

    nrfutil pkg generate --hw-version 52 --sd-req 0x98 --bootloader-version 0x11 --bootloader boot.hex --softdevice s132_nrf52_4.0.2_softdevice.hex --key-file priv_0407.pem sd_boot_dfu_package.zip

    Q2: The secure bootloader (SDK v12.x.x and later) will perform a dual bank updates if there is enough space, otherwise it will perform a single bank update, see this Infocenter page. You can configure the bootloader to only perform dual bank update, i.e. you will get an error at the start of the DFU process if the image is to large.

    In your specific case, the S132 v4.0.2 requires 0x0001F000 bytes (124kB) and the bootloader requires 0x5000 bytes (20kB), this leaves you with 368 kB (512kB - 124kB - 20kB). This means that you can perform a dual bank update of your application if its 368kB/2 = 184 kB. The combined SD+BL image is only 144kB, so you will be able to update the SoftDevice and bootloader without the application being erased as long as the application is not larger than 368-144kB = 224kB. However, I expect that the SoftDevice size will increase as we release newer versions so it is always wise to leave some space to account for this.

    Bjørn

  • Happy to help :) I would appreciate if you could mark the answer as correct/accepted by clicking the checkmark in the circle to the left of the answer.

Reply Children
No Data
Related