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

Background DFU application source code

Hi there,

We are designing our DFU mechanism for our system that has 4 Nordic 52840.
It's going to be a consumer product, so we don't want the user to have to do 4 manual updates. For this reason, we are thinking to write the new application to the flash ourselves (through Wifi & ESB using our proprietary packets) and utilize the bootloader to check if there's valid application in "Bank 1" and process it if valid. So if the user requests, we will distribute the packets to the flash transparently. Then the user would only need to power cycle the boards and, voila, it's updated.

From reading through the forum, it seems like "Background DFU update" is the way to go. However, in the post such as this one, the links to the documentation seem to be invalid:
devzone.nordicsemi.com/.../163720
devzone.nordicsemi.com/.../background-dfu-update-problem-on-nrf52832
devzone.nordicsemi.com/.../180557

It seems like there are 2 parts we need to modify:
1) The bootloader part, that can be found in:
<InstallFolder>/examples/iot/bootloader
based on info here: infocenter.nordicsemi.com/.../background_dfu_bootloader.html

2) The application part, that does:
Transferring the new firmware to flash memory.
Validating checksum for each block of the firmware.
Triggering a swap procedure by entering the bootloader context.

I don't find where I can find the code for this part. Can you please direct me to the where in the <InstallFolder> it is located?

And, perhaps, if you have documentation that shows how to do background DFU? So that I can try it in the DK first...

Thanks!

  • Hello all,

    I have tried the Background Dfu code3 provided here, I have flashed the Program using the script "program_bl_sd_bl_settings_52840" but when I try to debug using j-link viewer, I get this error.

    00> <info> app: Entering DFU mode.
    00> 
    00> <info> app: NRF_DFU_EVT_DFU_INITIALIZED
    00> 
    00> <info> app: NRF_DFU_EVT_TRANSPORT_ACTIVATED
    00> 
    00> <info> app: Application version 1
    00> 
    00> <error> app: ERROR 12 [NRF_ERROR_DATA_SIZE] at E:\1-Harish-new-workspace\DFU-HTTP-AZTAG\nRF_SDK_15.3.0_background_dfu_3_uart_support\components\libraries\bootloader\serial_dfu\nrf_dfu_serial_uart.c:145
    00> 
    00> PC at: 0x0003E4E7
    00> 
    00> <error> app: End of error report
    00> 

  • Follow Up Reply:

    Hardware Usage

    I use PCA10056

    1.1.0

    2019.6

  • Hello all,

    I have tried the Background Dfu code3 provided here, I have flashed the Program using the script "program_bl_sd_bl_settings_52840" but when I try to debug using j-link viewer, I get this error.

    00> <info> app: Entering DFU mode.
    00> 
    00> <info> app: NRF_DFU_EVT_DFU_INITIALIZED
    00> 
    00> <info> app: NRF_DFU_EVT_TRANSPORT_ACTIVATED
    00> 
    00> <info> app: Application version 1
    00> 
    00> <error> app: ERROR 12 [NRF_ERROR_DATA_SIZE] at E:\1-Harish-new-workspace\DFU-HTTP-AZTAG\nRF_SDK_15.3.0_background_dfu_3_uart_support\components\libraries\bootloader\serial_dfu\nrf_dfu_serial_uart.c:145
    00> 
    00> PC at: 0x0003E4E7
    00> 
    00> <error> app: End of error report
    00> 

    Hardware Used:

    Follow Up Reply:
    
    Hardware Usage
    
    I use PCA10056
    
    1.1.0
    
    2019.6

  • Hi Vidar 
    I am trying to run the same example in nrf52832 sdk 15.3.0 but I am encountering the below error, 

    Moreover, when I pause during debugging it stops on 0x15xxx BF40 sev 
    I can't figure out how to solve it, 

Related