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

Buttonless OTA DFU stops after switching to bootloader

Hi,

I'm evaluating the nRF5_SDK_v15.0.0 buttonless example OTA DFU bootloaders on a nRF52840-PDK.

The buttonless examples are working well. So I integrated the buttonless service into my own application.

The change from my appliction to the bootloader is working. Then the bootloader stays in the DFU mode, but the download doesn't start and a timeout error is rised.

I'm using a secure bootloader, wthout bonding and the peer manager is not integrated in my application.

What could be the reason of braeking the connection, while changeing from the application to the bootloader?

Best regards

Roland

  • Hello Edvin,

    Yes, the address i used, was didfferent form the standard address, and the bootloader was advertising as "DfuTarg" on the standard device address from FICR->DEVICEADDR[0] and FICR->DEVICEADDR[1].

    An other problem was, that I had set m_bt_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;.

    Now it's working fine, but i had to change the address to the standard address and the address type to BLE_GAP_ADDR_TYPE_RANDOM_STATIC (like in the nordic buttonless example).

    Which changes are needed in the bootloder to use a custom address with address type BLE_GAP_ADDR_TYPE_PUBLIC?

    Thanks a lot for your help!

    Best regards,

    Roland

  • Hello Roland,

     

    Try to modify the gap_params_init() function in nrf_dfu_ble.c in the bootloader project:

    static uint32_t gap_params_init(void)
    {
        uint32_t                err_code;
        ble_gap_conn_sec_mode_t sec_mode;
        uint8_t const *         device_name;
        uint32_t                name_len;
    
        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
    
    #if (!NRF_DFU_BLE_REQUIRES_BONDS)
    
        err_code = gap_address_change();
        VERIFY_SUCCESS(err_code);
    
        if ((m_flags & DFU_BLE_FLAG_USE_ADV_NAME) != 0)
        {
            NRF_LOG_DEBUG("Setting adv name: %s, length: %d", m_adv_name.name, m_adv_name.len);
            device_name = m_adv_name.name;
            name_len    = m_adv_name.len;
        }
        else
        
    #endif
        {
            // Change address here:
            ble_gap_addr_t my_addr;
            err_code = sd_ble_gap_addr_get(&my_addr);
            APP_ERROR_CHECK(err_code);
            
            my_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
            my_addr.addr[0] = 0x00;
            my_addr.addr[1] = 0x00;
            my_addr.addr[2] = 0x00;
            my_addr.addr[3] = 0x00;
            my_addr.addr[4] = 0x00;
            my_addr.addr[5] = 0x00;
            
            err_code = sd_ble_gap_addr_set(&my_addr);
            VERIFY_SUCCESS(err_code);
            
            NRF_LOG_DEBUG("Using default advertising name");
            device_name = (uint8_t const *)(NRF_DFU_BLE_ADV_NAME);
            name_len    = strlen(NRF_DFU_BLE_ADV_NAME);
        }
    
        err_code = sd_ble_gap_device_name_set(&sec_mode, device_name, name_len);
        VERIFY_SUCCESS(err_code);
    
        err_code = sd_ble_gap_ppcp_set(&m_gap_conn_params);
        return err_code;
    }

     

    Best regards,

    Edvin

  • Hi,

    Please help me in this 

    How to switch from application mode to bootloader mode again in OTA.

    I am using nRF52832 DK as well as my custom board based on nRF52832.

    I have implemented the OTA-DFU and uploaded the application zip.

    Now I want to upload new application hex'z zip but unable to switch from application mode to bootloader mode again.

    regards,

      Archana

  • Hello Archana,

    Im facing the same issue. My Application won't give control to my Bootloader DFU after firmware download.

    Im using The exemple inside the SDK11 and  Red Bear Nano V2 Board.

    Did you resolve this issue ?

Related