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

Buttonless DFU, Jump from app to DFU not working

The jump from application to DFU is not working during buttonless DFU. NRFToolbox displays GATT ERROR. I use SDK 7.1.0 with SD V7.1.0.

In dfu_app_handler.c, I made the following changes and the jump worked, also it took around 26 seconds for the jump to happen. Would it take so much time or am I doing it wrong??

static void bootloader_start(void)
{
    m_reset_prepare();
    uint32_t err_code = sd_power_gpregret_set(BOOTLOADER_DFU_START);
    APP_ERROR_CHECK(err_code);
    err_code = sd_softdevice_disable();
    APP_ERROR_CHECK(err_code);
    err_code = sd_softdevice_vector_table_base_set(NRF_UICR->BOOTLOADERADDR);
    APP_ERROR_CHECK(err_code);
    if (m_dm_handle_valid) {
        dfu_app_set_peer_data();
    }
    NVIC_ClearPendingIRQ(SWI2_IRQn);
    interrupts_disable();
    sd_nvic_SystemReset(); //Provided a system reset instead of "bootloader_util_app_start"
//    bootloader_util_app_start(NRF_UICR->BOOTLOADERADDR);
}

Why didn't it work as such? What should I do to make it work as such?? Would this method result in faster jump from app to DFU?

Parents
  • @Martial: If you are not using bootloader_util_app_start(), in your bootloader you should force the bootloader to initialize the softdevice regardless value app_reset is. Basically you should remove
    " if (init_softdevice)" in ble_stack_init() in the bootloader main.c file.

    Note that, by doing reset, there will be no bond information sharing between the bootloader and the application.

    If you don't want to use sd_nvic_SystemReset(); and want to switch back to bootloader_util_app_start() you can copy and replace bootloader_util_reset() in bootloader.c made for GCC from SDK v8.x or 9.0 so that it would work with gcc.

  • @Hung Bui Method 1(Using sd_nvic_SytemReset()) It works but it takes around 30 - 40 sec before it starts downloading the firmware. Can this time be reduced?? Or is this the actual behaviour?? Method 2 (Using bootloader_util_app_start()) This does not work and I get GATT ERROR still after doing copy and replace bootloader_util_reset() in bootloader.c made for GCC from SDK v8.x or 9.0 so that it would work with gcc

Reply
  • @Hung Bui Method 1(Using sd_nvic_SytemReset()) It works but it takes around 30 - 40 sec before it starts downloading the firmware. Can this time be reduced?? Or is this the actual behaviour?? Method 2 (Using bootloader_util_app_start()) This does not work and I get GATT ERROR still after doing copy and replace bootloader_util_reset() in bootloader.c made for GCC from SDK v8.x or 9.0 so that it would work with gcc

Children
No Data
Related