How do I add a DFU support for nRF Connect SDK in Linux

Hello, 

I'm using Linux (Ubuntu) and I would like to add a DFU support to my app.

Tried to follow Add DFU support to your application but it seems to me that some of the steps really focus on the sample they used in the article.

Additionally, I get an error when trying to add the includes described in the article, so I don't know how to proceed from here.

Advice and tips are welcome :)

Parents Reply Children
  • Thanks a lot.

    I will start researching and going over things.

  • Regarding section 2,
    I have an app with bootloader B0 and MCUBoot in the second stage.
    I have done a DFU OTA for the app itself.

    Now I'm trying to do an update to MCUBoot using BLE.
    Does it happen the same way the firmware update happens (described in the Add DFU support to your application article) or there is a different way to to it?

  • Hi Matan, 
    It's a bit tricky when doing MCUBoot update. You would need to choose the exact slot you want to update. If your current MCUBoot is running on slot S0  you should use the image for s1 slot : 

    signed_by_mcuboot_and_b0_s1_image_update.bin

    If your MCUBoot is running on S1 , then you need to use the image for s0: 

    signed_by_mcuboot_and_b0_s0_image_update.bin

  • Hi, thanks.
    How can I configure that?

    I tried to look in the Kconfig for some configuration options but culdn't find any.

    In the Kconfig I set  "use secure Bootloader", 
    and I enabled MCUBoot by adding these lines:

    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_SECURE_BOOT=y


    According to this output, what can I understand about which slots I used?

    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x9200.
    Verifying signature against key 0.
    Hash: 0x0f...a7
    Firmware signature verified.
    Firmware version 1
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    I: Starting bootloader
    I: Primary image: magic=bad, swap_type=0x3, copy_done=0x2, image_ok=0x2
    I: Secondary image: magic=bad, swap_type=0x0, copy_done=0x1, image_ok=0x1
    I: Boot source: none
    I: Swap type: none
    I: Primary image: magic=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2
    I: Secondary image: magic=bad, swap_type=0x0, copy_done=0x1, image_ok=0x1
    I: Boot source: none
    I: Swap type: none
    I: Bootloader chainload address offset: 0x23000
    *** Booting Zephyr OS build v3.2.99-ncs1 ***

  • Hi Matan, 


    From the log you can find Slot 0 is used. If you want to update, you need to update Slot 1: 

    signed_by_mcuboot_and_b0_s1_image_update

Related