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

DFU procedure

Hello,

I want to add DFU fonction on my custom application. The final goal is to update my firmware from my custom app (not just once).

My setup is : SDK11 - nRF52832 - MacOS environnement - armgcc

Is it the correct way to do that :

  1. Flash the softdevice :

nrfjprog --program /home/name/Desktop/Workspace/nRF52832/nRF5_SDK_11.0.0/examples/dfu/bootloader/hex/dfu_dual_bank_ble_s132_pca10040.hex -f nrf52 --chiperase

nrfjprog --reset -f nrf52

  1. Device is advertising with new name : DFUTarg

  2. Prepare the zip file ( for the nRF Toolbox )

nrfutil dfu genpkg --application TTblink.bin --application-version 0xff

--dev-revision 1 --dev-type 1 --sd-req 0xfffe TTblink.zip

  • Is it necessary to modify the code of blinky ? I'm using the blinky app without DFU
  • When I use nrFToolbox the firmware is correctly updated.
  • Is the softdevice :

s132_nrf52_2.0.0_softdevice.hex

the same of

dfu_dual_bank_ble_s132_pca10040.hex

( with DFU more) ? Softdevice + bootloader ?

Is it the correct way ? I don't understand why is it necessary to change the code of the app. Can I let my app without modification ?

Thank you very much.

  • Hi Nabil,

    What exactly do you want ?

    You can enter bootloader mode again by holding button 4 on the board when resetting.

    If you want to enter bootloader without pressing the button, you would need to implement DFU buttonless service into your application. Basically it's about sending BLE command to tell the application to switch to bootloader.

    You can have a look here.

    dfu_dual_bank_ble_s132_pca10040.hex is a precompiled hex with the softdevice bundled and the softdevice is the same as s132_nrf52_2.0.0_softdevice.hex

  • Thank you very much for your help.

    The only thing know is to work with SDK12 to get security level.

  • For information I'm working with (to programm softdevice + custom bootloader ) :

    flash_custom: 
    	@echo custom temporary flash soft_dfu: 
    	mergehex --merge /%WORKSPACEDIR%/nRF52832/nRF5_SDK_11.0.0/components/softdevice/s132/hex/s132_nrf52_2.0.0_softdevice.hex _build/nrf52832_xxaa_s132.hex --output SD_BL.hex
    	nrfjprog --program SD_BL.hex -f nrf52 --chiperase
    	nrfjprog --reset -f nrf52
    
  • Hi Nabil,

    Please describe what exactly you want to do ?

    Just for your information, I have a blog here. Maybe it's useful for you.

  • Thanks for the post.

    I think that it's already done