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

Dfu secure serial bootloader not working.

The following steps i used to Flash my nrf52 DK with DFu Serial secure.

  1. Downloaded and installed a)nrf5_SDK_13.0.0 b)nrfgo Studio c) keilv5 d)Python 2.7.9 e) pip f) nrfutil

  2. next I compiled the experimental_DFU_secure_serial from examples in 13.0.0SDK and got Errors in Micro_ecc.h compilation. I later was able to compile the library and generate private.key and public key.

  3. i generated the private.key and then corresponding public_key, saved private key on my PC and replaced the dfu_ public_key.c (that came in d example as Default) with my new public_key.

  4. now i compiled without any Errors and was able to get the nrf52832_xxaa.hex file for the Bootloader Code

  5. I then generated bootloader Settings nrfutil settings generate --family NRF52 --application C:\Users\ParthibanK\Downloads\nRF5_SDK_13.0.0_04a0bfd\examples\peripheral\blinky\pca10040\s132\arm5_no_packs_build\nrf52832_xxaa.hex --application-version 0 --bootloader-version 0 --bl-settings-version 1 C:\Users\ParthibanK\Documents\Bootloader_settings2.hex

6)I then merged bootloader Settings and nrf52832_xxaa.hex

C:\Windows\system32>mergehex --merge C:\Users\ParthibanK\Documents\Bootloader_settings2.hex C:\Users\ParthibanK\Downloads\nRF5_SDK_13.0.0_04a0bfd\examples\dfu\experimental_bootloader_secure_serial\pca10040\s132\arm5_no_packs_build\nrf52832_xxaa_s132.hex --output C:\Users\ParthibanK\Documents\BootSettv1.hex Parsing input hex files. Merging files. Storing merged file.

  1. Now i opened Nrfgo Studio and first Flashed the softdevice [SDK132] hex file from componnets\softdevice and then i flashed Bootloader as BootSettv1.hex

  2. as i understood from your instructions after a reset the board should be able to connect with my Android phone as "DfuTarg". This does not happen. I cannot fine any Bluetooth Connection with thew Name DfuTarg and so i assumed no Connection is being established also do not know wher the mistake lies as i i have followed all the necessary instructions .

Please helpimage description

Parents
  • Hi Kunal,

    up to point 4 you're on the right track, but on point 5 you should set the application version and bootloader version to 1.

    Note that when you generate the settings page and merge it with the bootloader you will set the "Bank0 Bank Code" to 0x00000001 (NRF_DFU_BANK_VALID_APP), i.e. indicating that there is a valid application in bank 0. The bootloader will check the Bank0 Bank Code field on the bootloader settings page will branch to the application if it is set to 0x00000001 (NRF_DFU_BANK_VALID_APP). If there is no application has been flashed to the device then it will branch to an empty flash region, reset and repeat.

    You should be able to put the device in bootloader mode by holding down the Bootloader button(Button 4) on your nRF52 DK, while you power-cycle your board. This will force the device to stay in bootloader mode and not branch to the application, even though the NRF_DFU_BANK_VALID_APP is set. The board should then start to advertise as "DfuTarg".

    Best regards

    Bjørn

Reply
  • Hi Kunal,

    up to point 4 you're on the right track, but on point 5 you should set the application version and bootloader version to 1.

    Note that when you generate the settings page and merge it with the bootloader you will set the "Bank0 Bank Code" to 0x00000001 (NRF_DFU_BANK_VALID_APP), i.e. indicating that there is a valid application in bank 0. The bootloader will check the Bank0 Bank Code field on the bootloader settings page will branch to the application if it is set to 0x00000001 (NRF_DFU_BANK_VALID_APP). If there is no application has been flashed to the device then it will branch to an empty flash region, reset and repeat.

    You should be able to put the device in bootloader mode by holding down the Bootloader button(Button 4) on your nRF52 DK, while you power-cycle your board. This will force the device to stay in bootloader mode and not branch to the application, even though the NRF_DFU_BANK_VALID_APP is set. The board should then start to advertise as "DfuTarg".

    Best regards

    Bjørn

Children
Related