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

dual bank DFU is redundancy?

I try  dual bank DFU on nrf52832+SDK15.0.0.

After extract new image to dst_addr(run image_copy),

DFU run nrf_dfu_settings_write().

nrf_dfu_settings_write() is run, nrf_dfu_flash_erase() and nrf_dfu_flash_store().

When  happen 'RESET' between nrf_dfu_flash_erase() and nrf_dfu_flash_store() , DFU setting seem invalid.

Is there a way to avoid this?

Parents
  • Are you building your own custom bootloader? Have you taken a look at the code in the secure_bootloader example in the latest sdk? If you want to do a dual bank dfu, I would take a look at how the example code does the dfu & base your bootloader on that code. The documentation at this link might also be helpful. Dual Bank DFU is mainly used as a fail safe so that if the firmware update fails, you can still boot your old application. If you do a single bank dfu, your old application will be erased. So if the DFU fails in a single bank dfu, you do not have a working application anymore. See the documentation I posted for more info regarding this.

  • I look at secure_bootloader(pca10040_ble).

    Another words question,
    When running nrf_dfu_settings_write().
    1. old application information is in m_dfu_settings_buffer only?
    2. nrf_dfu_flash_erase() and nrf_dfu_flash_store() run in order?
    3. After nrf_dfu_flash_erase() run, where old application information remain?

  • The nrf_dfu_settings_write() function writes the bootloader DFU settings to flash. The bootloader settings contains information about the current DFU process, in addition to application & firmware version numbers. 

    1) The old bootloader settings application version information is located in the m_dfu_settings_buffer. This buffer gets updated with the new bootloader settings in the nrf_dfu_settings_write() function.

    2) nrf_dfu_flash_erase() is executed before nrf_dfu_flash_store().

    3) The bootloader settings (including application version information) are erased during the nrf_dfu_flash_erase() function.

    If you want to know what happens with the application itself, take a look at this link.

  • If, betweeen nrf_dfu_flash_erase() and before nrf_dfu_flash_store(). reset happen.

    Can bootloader run the new application ?
    or
    bootloader run the DFU operation ?

Reply Children
Related