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

OTA DFU bootloader

I am having some success with custom hardware running an OTA DFU bootloader from the SDK17 by Hung Bui March 2017 within a nRF52832. I utilize the bootloader to program the ble_app_uart into the hardware and things work as expected. I do have trouble when I load an app with no soft device. It appears to load but will not run the app that runs the display, just hangs. The tutorial describes how to perform a zip of the application, but the description has a option with the softdevice, but the application has no SD.

Can the bootloader program an application without an SD and run the application without problems?

  • You need to modify the linker script/settings for the application.

    Reason: The SD has to stay in place - otherwise the OTA DFU bootloader won't work. Thus the application has to occupy the flash area after the SD. You also need to reserve a small amount of RAM (8 bytes IIRC) for the Softdevice - even when it is disabled - in order to use interrupt forwarding.

    An unmodified app would occupy the space for the SD in flash - this should be rejected in the bootloader logic. And no, cannot run a statically linked app from a flash address other than it was linked to.

  • The tutorial utilizes the 

    nrfutil pkg generate --hw-version 52 --application-version 1 --application _build/nrf52832_xxaa.hex --sd-req 0xCB --key-file private.key app_dfu_package.zip
    to zip the application. Can this same utility be used to zip the app in the correct way? The option of the --sd with the version 7.0.1 is being used but I dont think it will run properly without the option, but will run with the option being 0x00.
  • Well, utilizing the nrfutil and the 0x00 on the sd option will zip and data transfers but will not run the application. 

  • Hi, 

    Cy said:
    nrfutil pkg generate --hw-version 52 --application-version 1 --application _build/nrf52832_xxaa.hex --sd-req 0xCB --key-file private.key app_dfu_package.zip

    If you already programmed the  s132_nrf52_7.0.1_softdevice.hex and only want to only update the app, your commend is correct. You can test with the hrs_application_s132.hex nRF5_SDK_17.0.0\examples\dfu\secure_dfu_test_images\ble\nrf52832

    -Amanda H. 

  • Hmm, I have no use for hrs_application_s132.hex, and that is a soft device application. I have a situation where the application useful to me does not require a soft device. Well, I guess it is prudent to dig into the bootloader program and the linker script to figure out where, what, and how. 

Related