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

problem testing DFU functionality w/SDK14 SoftDevice v5

Hello,

I am trying to update our application with DFU support but it will not work for me. One of 2 things happens:

  1. Programming the bootloader and softdevice by programming the hex image bootloader_secure_ble/hex directory. Then I download the application using Keil. It appears the bootloader gets erased. This appears to be the case because in nrf_dfu_svci_vector_table_set(), NRF_UICR->NRFFW[0] == 0xFFFFFFFF
  2. Using nRFgo to program the bootloader, softdevice and our application, it powers up into the bootloader not the application.

How can I test the DFU integration in our application using the bootloader images provided?

Thanks

  • Hello ajc

    Please try to follow the DFU example documentation here. Are you able to correctly program and update your application when you follow the example?

    Best regards

    Jørn Frøysa

  • Thank you for the reply Jorn,

    Let me take a moment to explain my solution to this problem. The example documentation sort of glosses over some important details.

    • If you are using an IDE to perform the download of the application, you may need to change the JTAG/Flash Download configuration. The default configuration for Keil will delete both the application and the bootloader. To fix this change RAM size from 0x4000 to 0x2000.
    • Having the bootloader installed isn't enough to boot your application, you also need to have the bootloader settings page programmed and properly configured.

    So, if you want to test the DFU download operation using the bootloader images provided and your own application, do the following:

    • Erase flash and program the bootloader and softdevice (using hex images provided)
    • Create a bootloader settings page for your application. The only significant fields are --family, --application and --bl-settings-version. Don't forget the output hex file at the end.

    nrfutil.exe settings generate --family NRF52 --application ./nrf52832_xxaa.hex --application-version 0 --application-version-string 0.1.0 --bootloader-version 0 --bl-settings-version 1 app_settings.hex

    • Program the bootloader settings page. One way to do this is with nrfjprog.exe.

    nrfjprog.exe --program app_settings.hex --sectorerase --verify --family NRF52

    • Now program your application and reset.

    nrfjprog.exe --program nrf52832_xxaa.hex --sectorerase --verify --family NRF52 --reset

    Please verify that this is correct. It works for me.

    Thanks, Allen

  • Yes this looks correct. Just one thing, I have only had Keil delete the bootloader when the settings under Utilities are set to full chip erase. As long as the application code is not large enough to intrude on the flash memory occupied by the bootloader it should not get deleted, as I believe it is set to sector erase by default. And it should therefore only erase the parts of flash actually occupied by the application.

Related