App-based DFU, changing bank#1 address?

nRF52840, nRFSDK v17.0.2, SD140 v7.2.0

I asked  DFU from image we download ourselves?  and learned that the `NRF_BL_DFU_ALLOW_UPDATE_FROM_APP` configuration flag enables bootloader code to look at bank1 in the settings page, and update from there.

Now I'm curious: what is the best way to set or change the bank1 address? We would like to have explicit control over where the application-provided update image is stored. Additionally, it's possible that future firmware updates might want to adjust the bank1 address as our flash map changes and evolves. But, we see that the bootloader protects the settings page.

What's the Nordic-recommended strategy for changing the bank1 address?

Thanks,

Charles

Parents
  • Hello Charles,

    The address for bank 1 is not fixed. Instead, it adjusts automatically based on the size of the current Softdevice and application. You can use the nrf_dfu_bank1_start_addr() function found in nrf_dfu_utils.c to retrieve the address.

    But, we see that the bootloader protects the settings page.

    The settings page is only partially protected when you build the bootloader with `NRF_BL_DFU_ALLOW_UPDATE_FROM_APP`. The application will have write access to the following elements of the settings structure:

    And the application must store the init command (i.e. the *.dat file) to .init_command. The bootloader will use the init command stored here to finalize the update.  

    Best regards,

    Vidar

  • Thanks Vidar for the quick and helpful answer!

    Best,

    Charles

Reply Children
No Data
Related