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

SDK9.0 DFU

FormerMember
FormerMember

the mcu is nrf51822,I use sdk9.0,

sdk9.0\examples\dfu\bootloader\pca10028\dual_bank_ble_s110\arm5_no_packs

  1. In this project, I delete led,button,
  2. change “dfu_start |= ((nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0) ? true: false);” to “dfu_start |=TRUE”
  3. change the “SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true);” to “SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true);”
  4. change the target “IRAM1 0x1380” and “ IRAM2 0x20003F80”

it can dfu,and start the new application program, but when I let it power off,and then power on,it back to advertising “DfuTarg”

Parents
  • This is the expected behavior you will get by setting dfu_start |= true;, i.e. dfu_start is always true. If you take a look at the code you'll see that you will always enter the following statement

     if (dfu_start || (!bootloader_app_is_valid(DFU_BANK_0_REGION_START)))
        {
            nrf_gpio_pin_clear(UPDATE_IN_PROGRESS_LED);
    
            // Initiate an update of the firmware.
            err_code = bootloader_dfu_start();
            APP_ERROR_CHECK(err_code);
    
            nrf_gpio_pin_set(UPDATE_IN_PROGRESS_LED);
        }
    

    If you do not have a bootloader button in you design then I suggest that you just remove the line, i.e. alter the code from

    dfu_start  = app_reset;
    dfu_start |= ((nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0) ? true: false);
    

    to

    dfu_start  = app_reset;
    

    Best regards

    Bjørn

  • Happy to help Yangying :) I would appreciate if you could mark the answer as correct by clicking the checkmark in the circle to the left of the answer.

Reply Children
No Data
Related