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

Nrf52832 ble dfu not working

Hi,

I am trying to do dfu in nrf52832..i made a zip file containing (app+bl and sd).the size of zip packet is 530 kb but the application space in nrf52 is only 328 kb..while performing dfu it shows insufficient resources..what should i do?

The steps i performed is

1.first flash secure bootloader in nrf52

2.make zip file by combining bootloder settings,app and softdevice

  • If you've already flashed the SoftDevice before you flashed Secure bootloader, why does it have to be part of the DFU package?

    Also, bootloader settings should not be packaged along with DFU package. You only need BL Settings hex when you are debugging the firmware, and you have included Secure bootloader. Haven't seen any other use for manually generating settings.hex

    What is the application hex size? Which SoftDevice are you using? Also, do note that 0x78000 - 0x80000 (32KB) would be used for the secure bootloader.

  • These are the steps i follow

    First generate bootlodr settings hex..and then merge bl settings and app and produce output.hex, and then make zip using output hex and softdevice.

    Can u plz mention simple steps to perform dfu in nrf52832..softdevice is s132 v6.1.0 and application hex size is 250 kb

  • Steps -

    1. Build the app hex file.

    2. Run nrfutil command to generate dfu package for application using just the app hex file and sd_req set to S132 v6.1.0 hex code.

    3. Erase and Flash the S132 SoftDevice and then the Secure bootloader hex using SWD/JTAG.

    4. Reset the device and in nRF Connect for Mobile, connect to device advertising "DfuTarg".

    5. Then flash the zip file you have generated.

    Had followed this and it had worked fine. Merging hex files was not necessary, as far as I know.

  • ok.then the application works fine..then how do we update next app using dfu..it shows characteristics error. Don't we have to upload bootloader settings to our board.?..i think we need bootloader settings in our board to update app again again using dfu.

  • Thomasthomas said:
    Don't we have to upload bootloader settings to our board.?

     No, the bootloader settings are used only when you program the application via a programmer. When you perform a DFU the bootloader will generate it's own bootloader settings. What you need to do when you want to perform a DFU is to generate an application image, which is generated using the private key. If the new application is using the same softdevice, you don't need to  include the softdevice hex. You only need something like:

    nrfutil pkg generate --application app.hex --application-version 2 --hw-version 52 --sd-req 0xCA --key-file private.pem dfu_image.zip

    has provided a useful guide with the steps. There is also an official guide on how to perform a DFU here.

    Best regards,

    Edvin

Related