nRF52832 buttonless DFU without bonds failed

I use nRF Connect to test  buttonless DFU without bonds failed. But nRF52832 receives BLE_GATTS_EVT_SYS_ATTR_MISSING event.

->static void ble_evt_handler(ble_evt_t const* pBleEvt, void* pContext)
->{
->    ret_code_t errCode = NRF_SUCCESS;
->   
->   switch (pBleEvt->header.evt_id)
->   {
->       case BLE_GAP_EVT_CONNECTED:
->       {
->           NRF_LOG_INFO("BLE_GAP_EVT_CONNECTED\n");
->           BLE_UART_SetState(BLE_NUS_STATE_CONNECT);
->           errCode = bsp_indication_set(BSP_INDICATE_CONNECTED);
->           if (errCode != NRF_SUCCESS) {
->               NRF_LOG_WARNING("bsp_indication_set() failed, errCode=0x%x\n", errCode);
->               return;
->           }    
->
->           m_cur_conn_handle = pBleEvt->evt.gap_evt.conn_handle;
->
->           errCode = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_cur_conn_handle);
->           if (errCode != NRF_SUCCESS) {
->               NRF_LOG_WARNING("nrf_ble_qwr_conn_handle_assign() failed, errCode=0x%x\n", errCode);
->               return;
->           }
->       }    
->       break;
->
->       case BLE_GATTS_EVT_SYS_ATTR_MISSING:
->       {
->           NRF_LOG_INFO("BLE_GATTS_EVT_SYS_ATTR_MISSING\n");
->           // No system attributes have been stored.
->           errCode = sd_ble_gatts_sys_attr_set(pBleEvt->evt.gap_evt.conn_handle, NULL, 0, 0);
->           APP_ERROR_CHECK(errCode);
->       }
->...
->}

-> Code0> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
 0> <info> app: BLE_GAP_EVT_CONNECTED
 0>
 0> <debug> app: state=1
 0>
 0> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
 0> <info> app: BLE_GATTS_EVT_SYS_ATTR_MISSING

Parents
  • Hi, 

    What SDK version are you using?

    I use nRF Connect to test  buttonless DFU without bonds failed.

    Can you provide the log from the nRF Connect? 

    Please try to erase the kit before programming. 

    Regards,
    Amanda

  • Hi, 

    The secure_bootloader supports buttonless DFU without other modifications. When the device enters DFU mode, DFU mode is indicated by LED 3 being lit. From the log, the secure_bootloader seems to go into the buttonless DFU. It should advertise "DfuTarg" as the name. You can check with the nRFConnect mobile app. 

    -Amanda

  • Now I encounter another issue, that is "nrf_dfu_validation: CRC check of app failed". Do I need enable CRC16 or CRC32?

    00> <info> app: Inside main
    00>
    00> <debug> app: In nrf_bootloader_init
    00>
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00>
    00> <debug> nrf_dfu_flash: Initialiúing nrf_fstorage_nvmc backend.
    00>
    00> <debug> nrf_dfu_settings: Using settings page.
    00>
    00> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00>
    00> <info> app: No firmware to activate.
    00>
    00> <debug> app: crc_on_valid_app_required() return 0x1
    00>
    00>
    00> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    00>
    00> <debug> app: App is valid
    00>
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00>
    00> <debug> nrf_dfu_segs: Destination settings are identical to source, write not +'Ã
    14> d. Skip.
    14>
    14> +Ãug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Callinï îru_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_sett: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate
    14>
    14> <info> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_‹«ûired() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_booder_app_t with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settingsllinf_dfu_segs_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Bag uptings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate
    14>
    14> <info> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destinatiettings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activateinfop: Nrmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CReck of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to addrex7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. ping<debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to addres7E000.
    14>
    14> <de nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate
    14>
    14> <info> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app fd. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info~ dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_boadåòactivate
    14>
    14> <info> apo firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Run_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> o> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate
    14>
    14> <info> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: B_KÃng up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfttings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <iîfpp: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_sett: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settingestination settings are identical to sou/gù write not needed. Skipping.
    14>
    14> <«ûg> app: Enter nrf_bootloader_fw_acti
    14>
    14> <info> app: No firmware to activate.
    14> ebugp: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debugf_dfu_settings: Destination settings are identical turce, write not needed. Skipping.
    14>
    14> <debapp: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> Ú<info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_segs_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate
    14>
    14> <info> app: No firmware ttivate.
    14> íæo> aprc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debugp: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settinoge to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_acti
    14>
    14> <info> app: No firmware to activasiø
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> apn nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrfßsettings: Using settings page.
    14>
    14> <debug> nrf_dfu_settingopying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings:tination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write needed. Skipping.
    14>
    14> <debug> app: r nrf_boader_fw_activate
    14>
    14> <info> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> o> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_££ûings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settingó~ Änation settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_booôìk³Ã_fw_£Kûvateéîîïp: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_vation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> o> app: Inside main
    14>
    14> <debug> app: In nrf_bïader_init
    14>
    14> <debug> nrf_«ûÂsett: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed.`SÜing.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate
    14>
    14> <info> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootüïa“ûú
    10> pp_start with address: 0x00001000
    10>
    10> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    10>
    10> <infpp: Inside main
    10>
    10> <debug> app: In nrf_bootloader_init
    10>
    10> <debug> nrf_dfu_settings: Calling nrf_dfttinnit()...
    10>
    10> <debug> nrf_dfu_flash: Initializing nrf_fstor+ûÂnvmc backend.
    10>
    10> <debug> nrf_dfu_settings: Using settings page.
    10>
    10> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    10>
    10> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    10>
    10> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    10>
    10> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    10>
    10> <debug> app: Enter nrf_bootloader_fw_activate
    10>
    10> <info> app: No fire to activate.
    10>
    10> <debug> app: crc_on_valid_app_required() reôuv1
    10>
    10>
    10> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    10>
    10> <debug> app: App is valid
    10>
    10> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    10>
    10> <debug> nrf_dfu_settinDestination settings are identical to source, write not k#Ã
    14> d. Skipping.
    14>
    14> <debug> app: Run nrf_bootloader_app_start with address: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dæu_££ûings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate
    14>
    14> <info> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() return 0x1
    14>
    14>
    14> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_sets: Backing up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start wéddress: 0x00001000
    14>
    14> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    14> <info> app: Inside main
    14>
    14> <debug> app: In nrf_bootloader_init
    14>
    14> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    14>
    14> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    14>
    14> <debug> nrf_dfu_settings: Using settings page.
    14>
    14> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> fo> nrf_dfu_settings: Bag up settings page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settingestination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Enter nrf_bootloader_fw_activate> app: No firmware to activate.
    14>
    14> <debug> app: crc_on_valid_app_required() retur1
    14>
    14> ebug> nrf_dfu_validation: CRC check of app failed. Return 1
    14>
    14> <debug> app: App is valid
    14>
    14> <info> nrf_dfu_settings: Backing up settkngs page to address 0x7E000.
    14>
    14> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    14>
    14> <debug> app: Running nrf_bootloader_app_start with address: 0x00001pppbug>: Disabling interrupts. NVIC->ICER[0]: 0x0
    14>
    (Connection lost)

  • I have solved CRC check of app failed issue by regenerating bootloader_setting.hex by nrfutil and reprogramming bootloader_setting.hex, bootloader.hex, softdevice_s132.hex, and nrf52832_xxaa.hex.

    But I encounter another problem. nRF Connect can't connect nRF52832 with "Faield to secure connection with handle 00".

    log messages of nRF52832 device.
    10> <info> app: Version 1.2.1
    10>
    10>
    10> <info> app: ========| flash info |========
    10>
    10> <info> app: erase unit:   4096 bytes
    10>
    10> <info> app: program unit: 4 bytes
    10>
    10> <info> app: end address: 0x72000
    10>
    10> <info> app: ==============================
    10>
    10> <info> app_timer: RTC: initialized.
    10>
    10> <info> app: Setting vector table to bootloader: 0x00072000
    10>
    10> <info> app: Setting vector table to main app: 0x00026000
    10>
    10> <debug> app: NOR_DATA_PERIOD=819
    10>
    10>
    10> <debug> app: NOR_RECORD_PERIOD=8192
    10>
    10>
    10> <info> app: bsp_button_longkey_handler 0.
    10>
    10> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
    10>
    10> <info> app: BLE_GAP_EVT_CONNECTED
    10>
    10>
    10> <debug> app: state=1
    10>
    10>
    10> <info> app: PM_EVT_CONN_SEC_FAILED
    10>
    10> <info> app: Faield to secure connection with handle 00
    10>
    10>
    10> <info> app: BLE_GAP_EVT_DISCONNECTED
    10>
    10>
    10> <debug> app: state=0
    10>
    10>
    10> <debug> app: _securityRequestHandler
    10>

    log messages of nRF Connect.

    nRF5x
    DA:73:F1:2C:90:6A
    Generic Access
    Generic Attribute
    17:32:10.097    Using nrf-device-lib-js version: 0.4.11
    17:32:10.097    Using nrf-device-lib version: 0.11.8
    17:32:10.097    Using nrfjprog DLL version: 10.15.4
    17:32:10.097    Using JLink version: JLink_V7.66a
    17:32:10.120    Installed JLink version does not match the provided version (V7.58b)
    17:32:10.601    Updated list of uuids with data from github.com/.../v1
    17:32:12.762    Selected device with s/n DA73F12C906A
    17:32:12.770    Device setup completed
    17:32:12.770    Connectivity firmware version: ble-connectivity 4.1.4+Mar-11-2021-08-36-04. SoftDevice API version: 5. Baud rate: 1000000.
    17:32:12.771    Opening adapter connected to COM10
    17:32:13.719    Successfully opened COM10. Baud rate: 1000000. Flow control: none. Parity: none.
    17:32:13.722    Reset performed on adapter COM10
    17:32:14.805    Adapter connected to COM10 opened
    17:32:18.734    Scan started
    17:33:18.739    Scanning timed out on adapter COM10
    17:33:23.212    Connecting to device
    17:33:29.327    Connected to device E8:20:9F:75:90:08: interval: 7.5ms, timeout: 4000ms, latency: 0
    17:33:29.347    ATT MTU updated for device E8:20:9F:75:90:08, new value is 185
    17:33:29.592    Attribute value read, handle: 0x03, value (0x): 41-4E-43-53-32
    17:33:34.381    Connection parameters updated for device E8:20:9F:75:90:08: interval 15ms, timeout 3000ms, latency: 0
    17:33:37.026    Security updated, mode:1, level:3
    17:33:37.079    Storing bond info for device E8:20:9F:75:90:08
    17:33:56.976    Attribute value changed, handle: 0x0E, value (0x): 02-00
    17:33:56.981    Attribute value written, handle: 0x0E, value (0x): 02-00
    17:34:13.688    Disconnected from device E8:20:9F:75:90:08, reason: BLE_HCI_CONNECTION_TIMEOUT
    17:34:38.597    Scan started
    17:34:40.480    Connecting to device
    17:35:00.489    Connection to device timed out
    17:36:02.463    Scan started
    17:36:29.017    Connecting to device
    17:36:29.529    Connected to device E8:20:9F:75:90:08: interval: 7.5ms, timeout: 4000ms, latency: 0
    17:36:29.541    ATT MTU updated for device E8:20:9F:75:90:08, new value is 185
    17:36:29.580    Security updated, mode:1, level:3
    17:36:29.844    Attribute value read, handle: 0x03, value (0x): 41-4E-43-53-32
    17:36:34.587    Connection parameters updated for device E8:20:9F:75:90:08: interval 15ms, timeout 3000ms, latency: 0
    17:36:37.127    Security updated, mode:1, level:3
    17:36:37.179    Storing bond info for device E8:20:9F:75:90:08
    17:37:43.881    Disconnected from device E8:20:9F:75:90:08, reason: BLE_HCI_CONNECTION_TIMEOUT
    17:37:51.202    Connecting to device
    17:38:11.212    Connection to device timed out
    17:40:41.743    Connecting to device
    17:41:01.750    Connection to device timed out
    17:56:41.236    Scan started
    17:56:47.402    Connecting to device
    17:56:47.557    Connected to device E8:20:9F:75:90:08: interval: 7.5ms, timeout: 4000ms, latency: 0
    17:56:47.576    ATT MTU updated for device E8:20:9F:75:90:08, new value is 185
    17:56:47.600    Disconnected from device E8:20:9F:75:90:08, reason: BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION

  • After I restart nRF Connect, it can connect to nRF52832 device. How can I trigger nRF52832 device to enter DFU mode from nRF Connect?

    10> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
    10>
    10> <info> app: BLE_GAP_EVT_CONNECTED
    10>
    10>
    10> <debug> app: state=1
    10>
    10>
    10> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
    10>
    10> <info> app: BLE_GATTS_EVT_SYS_ATTR_MISSING

    10>

Reply
  • After I restart nRF Connect, it can connect to nRF52832 device. How can I trigger nRF52832 device to enter DFU mode from nRF Connect?

    10> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
    10>
    10> <info> app: BLE_GAP_EVT_CONNECTED
    10>
    10>
    10> <debug> app: state=1
    10>
    10>
    10> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
    10>
    10> <info> app: BLE_GATTS_EVT_SYS_ATTR_MISSING

    10>

Children
  • Hi, 

    It has the buttonless DFU service, so it doesn't need to trigger to get into DFU again. 

    -Amanda

  • Which event will be received in nRF52832 device when I press "Button DFU without bonds" soft key? I can't see any BLE_DFU_EVT_BOOTLOADER_xxx events in log messages. But ble_dfu_buttonless_init() return 0.:

    log messages:

    00> <info> app_timer: RTC: initialized.
    00>
    00> <info> app: Setting vector table to bootloader: 0x00072000
    00>
    00> <info> app: Setting vector table to main app: 0x00026000
    00> <debug> app:bleDfuInit() return 0
    00>
    00> <debug> app: NOR_DATA_PERIOD=819
    00>
    00>
    00> <debug> app: NOR_RECORD_PERIOD=8192
    00>
    00>
    00> <info> app: bsp_button_longkey_handler 0.
    00>
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
    00>
    00> <info> app: PM_EVT_BONDED_PEER_CONNECTED
    00>
    00>
    00> <info> app: BLE_GAP_EVT_CONNECTED
    00>
    00>
    00> <debug> app: state=1
    00>
    00>
    00> <info> app: PM_EVT_CONN_SEC_SUCCEEDED
    00>
    00>
    00> <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 0.
    00>
    00> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
    00>
    00> <debug> app: _securityRequestHandler
    00>
    00>
    00> <info> app: PM_EVT_CONN_SEC_CONFIG_REQ
    00>
    00>
    00> <info> app: BLE_GAP_EVT_SEC_PARAMS_REQUEST
    00>
    00>
    00> <info> app: PM_EVT_CONN_SEC_SUCCEEDED
    00>
    00>
    00> <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1.
    00>
    00> <info> app: BLE_GAP_EVT_AUTH_STATUS
    00>

    source code related to BLE_DFU_EVT_BOOTLOADER_xxx event handling.
    static void _bleDfuEvtHandler(ble_dfu_buttonless_evt_type_t event) {
        switch (event) {
            case BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE:
            {
                NRF_LOG_INFO("BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE");

                // Prevent device from advertising on disconnect.
                advertisingModesConfigSet();

                // Disconnect all other bonded devices that currently are connected.
                // This is required to receive a service changed indication
                // on bootup after a successful (or aborted) Device Firmware Update.
                uint32_t conn_count = ble_conn_state_for_each_connected(_bleDfuDisconnect, NULL);
                NRF_LOG_INFO("Disconnected %d links.", conn_count);            
            }
            break;

            case BLE_DFU_EVT_BOOTLOADER_ENTER:
            {
                // YOUR_JOB: Write app-specific unwritten data to FLASH, control finalization of this
                //           by delaying reset by reporting false in app_shutdown_handler
                NRF_LOG_INFO("BLE_DFU_EVT_BOOTLOADER_ENTER\n");
            }    
            break;

            case BLE_DFU_EVT_BOOTLOADER_ENTER_FAILED:
            {
                NRF_LOG_ERROR("BLE_DFU_EVT_BOOTLOADER_ENTER_FAILED\n");
                // YOUR_JOB: Take corrective measures to resolve the issue
                //           like calling APP_ERROR_CHECK to reset the device.
            }    
            break;

            case BLE_DFU_EVT_RESPONSE_SEND_ERROR:
            {
                NRF_LOG_ERROR("BLE_DFU_EVT_RESPONSE_SEND_ERROR\n");
                // YOUR_JOB: Take corrective measures to resolve the issue
                //           like calling APP_ERROR_CHECK to reset the device.
            }    
            break;

            default:
            {
                NRF_LOG_ERROR("Unknown event from ble_dfu_buttonless.");
            }    
            break;
        }
    }

    int bleDfuInit(void) {
        ret_code_t errCode = ble_dfu_buttonless_async_svci_init();
        if (errCode != NRF_SUCCESS) {
            NRF_LOG_WARNING("ble_dfu_buttonless_async_svci_init() failed, errCode=0x%x\n", errCode);
            return ERROR_OTA_INITIALIZE_FAIL;
        }

        ble_dfu_buttonless_init_t init = {0};
        init.evt_handler = _bleDfuEvtHandler;
        errCode = ble_dfu_buttonless_init(&init);
        if (errCode != NRF_SUCCESS) {
            NRF_LOG_WARNING("ble_dfu_buttonless_init() failed, errCode=0x%x\n", errCode);
            return ERROR_OTA_INITIALIZE_FAIL;
        }    

        NRF_LOG_DEBUG("bleDfuInit() return 0\n");
        return 0;
    }

  • Hi, 

    Do you write opcode 0x01 to get into DFU mode?

    Have a look at this Buttonless Secure DFU Service without bonds doc.

    -Amanda

  • I try to use iOS nRF Connect APP to perform DFU. But it failed with "scanning timeout returning no matching peripheral". Why no bootloader log messages after BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE event?

    The following is log messages of nRF52832 device.

    00> <info> app: Version 1.2.1
    00>
    00>
    00> <info> app: ========| flash info |========
    00>
    00> <info> app: erase unit:   4096 bytes
    00>
    00> <info> app: program unit: 4 bytes
    00>
    00> <info> app: end address: 0x72000
    00>
    00> <info> app: ==============================
    00>
    00> <info> app_timer: RTC: initialized.
    00>
    00> <info> app: Setting vector table to bootloader: 0x00072000
    00>
    00> <info> app: Setting vector table to main app: 0x00026000
    00>
    00> <debug> app: bleDfuInit() return 0
    00>
    00>
    00> <debug> app: NOR_DATA_PERIOD=819
    00>
    00>
    00> <debug> app: NOR_RECORD_PERIOD=8192
    00>
    00>
    00> <info> app: bsp_button_longkey_handler 0.
    00>
    00> <warning> app: Battery volage 0mV is too low
    00>
    00>
    00> <warning> app: Battery volage 3374mV is too low
    00>
    00>
    00> <info> app: POWER_ON.
    00>
    00> <info> app: External devices initializing start
    00> <info> app: External devices initializing finish
    00>
    00> <info> app: bsp_button_longkey_handler 1.
    00>
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
    00>
    00> <info> app: BLE_GAP_EVT_CONNECTED
    00>
    00>
    00> <debug> app: state=1
    00>
    00>
    00> <info> app: BLE_GAP_EVT_PHY_UPDATE_REQUEST
    00>
    00>
    00> <debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
    00>
    00> <debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
    00>
    00> <debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
    00>
    00> <debug> nrf_ble_gatt: max_rx_octets: 27
    00>
    00> <debug> nrf_ble_gatt: max_tx_octets: 27
    00>
    00> <debug> nrf_ble_gatt: max_rx_time: 2120
    00>
    00> <debug> nrf_ble_gatt: max_tx_time: 2120
    00>
    00> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
    00>
    00> <debug> app: _securityRequestHandler
    00>
    00>
    00> <info> app: BLE_GAP_EVT_SEC_PARAMS_REQUEST
    00>
    00>
    00> <info> app: PM_EVT_CONN_SEC_SUCCEEDED
    00>
    00>
    00> <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1.
    00>
    00> <info> app: BLE_GAP_EVT_AUTH_STATUS
    00>
    00>
    00> <info> app: BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE

Related