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

How to do buttonless dfu

Hi, 

I am using nRF52832 and sdk 16

I am done secure bootloader dfu. By generating the new firmware application. Zip  , this part is working fine

Now I want to do buttonless dfu.  How to generate the bootloader settings? 

2.i have merged all the hex file into single hex file which include bootloader, softdevice, and application

3.how can I make my device to switch to dfu mode? 

Please suggest me an answer. 

Thanks

  1. Pspavi
  • Have you remembered to set up the SVCI interface with ble_dfu_buttonless_async_svci_init() at the start of main()?

  • Hi pspavi,

    Trying creating the zip again but this time don't merge the application and softdevice. Just provide the hex file separate to nrfutil using following syntax 

    nrfutil pkg generate --hw-version 52 --application-version 1 --application application.hex --sd-req 0x98 --softdevice softdevice.hex --key-file private.key app_dfu_package_softdevice.zip

    if you are running the dfu service in your application you should be able to use that service to force the peripheral to reboot into dfu mode (bootloader).

    there are two different situations: 
    1. empty chip -> install bootloader -> power cycle. then dfu process will start automatically because there is not valid application detected. -> load your zip

    2. application installed and the application has the dfu ble services running. -> connect to device and using those ble services to force the device to reboot in dfu mode -> install your zip.

  • also did you following the following steps?

    You have to make sure that you rebuild the bootloader using the newly generated keys. If not then the public_keys.c file in the order bootloader will not be able to validate the zip you generated with the new keys. If you simply flashed the example bootloader I don't believe it will work with any zip generated outside of those precompiled examples. You need to rebuild the bootloader with the correct public_key.c. This is the main step the make the bootloader secure.

Related