Buttonless DFU with bond forwarding failed : [callback] : Central Manager failed to connect to peripheral[timeout] . DFU failed with error : Device failed to connect

Hi,

I am trying to integrate Buttonless DFU in my application.  I have implemented all the steps mentioned in this tutorial.

Getting started with Nordic's Secure DFU bootloader, a step by step guide - Software Development Kit - nRF5 SDK guides - Nordic DevZone

 Initially I faced some error because I had, DIS, ANCS and NUS serivces while DFU buttonless services appliation in to my code.

 I have resolved some errors with this tutorials and ticket : ble_app_hrs + Buttonless DFU on NRF52DK(52832) + OTA update - Nordic Q&A - Nordic DevZone - Nordic DevZone

Now following steps I am following in order to test the DFU OTA with Bond Forwarding : 

1.  Pair and Bond with my device using nRF connect for Mobile app.

2. Click the Document picker and select the zip file created for DFU OTA

3. Click  start

After this in nrf Connect for Mobile app, I can see that DFU started but after few seconds it displays DFU failed with error as Device failed to connect to peripheral[Timeout].

2. I have tried the same with Android also, but there also it is failed to connect with error code ad (0x93).

I am using nRF5 SDK v 17.1.0_ddde560.

Kindly please let me know what is wrong in my implementations so that I can correct it and successfully complete the DFU OTA with Bond Forwarding.

Thanks in Advance!!!

Parents
  • Hi, 

    Does it work without bonding or disable bonding?

    Regards,
    Amanda H.

  • Hi Amanda,

    It works without bonding or when the bonding is disabled.

    But after that I have added ANCS service and related application in my application which requires bonding. 

    After that I am trying to do DFU OTA, but it is showing above error.

  • Hi,

    I have already enabled this config in bootloader and my application code respectively.

    After this, I have encountered these issues.

    Can you please tell me in what circumstances BLE DFU will fail to reconnect with timeout error?

  • Hi,

    The bond forwarding mechanism is to allow the application to share the bonding information with the bootloader so the connection in bootloader dfu mode can be encrypted as well (see Buttonless Secure DFU Service). But this is optional and it is not required for supporting bonding in the application.

    I suggest you revert back to the previous configuration you had where NRF_DFU_BLE_REQUIRES_BONDS (bootloader) and NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS (application) were disabled and try to debug the application again (enable debug logging, etc). For example, you can verify that the device enters Bootloader DFU mode when you send the "Enter DFU mode" command.

    Also make sure you are calling the function below at the beginning of your main()

     

    int main(void) 
    {
        ...
        log_init();
        
        // Initialize the async SVCI interface to bootloader before any interrupts are enabled.
        err_code = ble_dfu_buttonless_async_svci_init();
        APP_ERROR_CHECK(err_code);
        
        ...

  • nRF Connect, 2025-04-16
    Sensor_Demo_cd (D2:39:6F:B2:10:CD)
    D	15:30:22.665	gatt.close()
    D	15:30:22.671	wait(200)
    V	15:30:22.881	Connecting to D2:39:6F:B2:10:CD...
    D	15:30:22.881	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	15:30:23.110	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	15:30:23.110	Connected to D2:39:6F:B2:10:CD
    V	15:30:23.131	Discovering services...
    D	15:30:23.131	gatt.discoverServices()
    D	15:30:23.132	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	15:30:23.170	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDING (11)
    D	15:30:23.219	[Broadcast] Action received: android.bluetooth.device.extra.PAIRING_VARIANT, pairing variant: CONSENT
    I	15:30:23.700	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	15:30:24.180	[Callback] Services discovered with status: 0
    I	15:30:24.180	Services discovered
    V	15:30:24.187	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    Unknown Service (00001000-1112-1314-1516-171819202122)
    - Unknown Characteristic [N R W WNR] (00001003-1112-1314-1516-171819202122)
       Client Characteristic Configuration (0x2902)
    Battery Service (0x180F)
    - Battery Level [N R W WNR] (0x2A19)
       Client Characteristic Configuration (0x2902)
    Secure DFU Service (0xFE59)
    - Buttonless DFU [I W] (8ec90003-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    Device Information (0x180A)
    - Manufacturer Name String [R] (0x2A29)
    - Model Number String [R] (0x2A24)
    - Serial Number String [R] (0x2A25)
    - Hardware Revision String [R] (0x2A27)
    - Firmware Revision String [R] (0x2A26)
    D	15:30:24.187	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	15:30:24.191	gatt.setCharacteristicNotification(00001003-1112-1314-1516-171819202122, true)
    D	15:30:24.192	gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
    D	15:30:24.283	[Broadcast] Action received: android.bluetooth.device.extra.PAIRING_VARIANT, pairing variant: CONSENT
    I	15:30:24.427	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    D	15:30:25.783	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDED (12)
    I	15:30:25.783	Device bonded
    I	15:30:29.027	Connection parameters updated (interval: 47.5ms, latency: 0, timeout: 4000ms)
    V	15:30:34.628	Enabling notifications for 00002a19-0000-1000-8000-00805f9b34fb
    D	15:30:34.628	gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
    D	15:30:34.630	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
    I	15:30:34.728	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
    A	15:30:34.728	"Notifications enabled" sent
    V	15:30:34.733	Notifications enabled for 00002a19-0000-1000-8000-00805f9b34fb
    V	15:30:37.529	Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
    D	15:30:37.529	gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
    D	15:30:37.531	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0200)
    I	15:30:37.674	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 02-00
    A	15:30:37.674	"Indications enabled" sent
    V	15:30:37.679	Indications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
    V	15:30:39.543	Writing request to characteristic 8ec90003-f315-4f60-9fb8-838830daea50
    D	15:30:39.543	gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50, value=0x01)
    I	15:30:39.629	Indication received from 8ec90003-f315-4f60-9fb8-838830daea50, value: (0x) 20-01-01
    A	15:30:39.629	"Response for: Enter bootloader
    Status: Success" received
    I	15:30:39.629	Data written to 8ec90003-f315-4f60-9fb8-838830daea50, value: (0x) 20-01-01
    A	15:30:39.629	"Response for: Enter bootloader
    Status: Success" sent
    V	15:30:53.225	[DFU] DFU service started
    V	15:30:53.225	[DFU] Opening file...
    I	15:30:53.262	[DFU] Firmware file opened successfully
    V	15:30:53.262	[DFU] Connecting to DFU target...
    D	15:30:53.262	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    I	15:30:53.282	[DFU] Connected to D2:39:6F:B2:10:CD
    V	15:30:57.289	[DFU] Discovering services...
    D	15:30:57.289	[DFU] gatt.discoverServices()
    I	15:30:57.295	[DFU] Services discovered
    V	15:30:57.296	[DFU] Reading Service Changed CCCD value...
    D	15:30:57.296	[DFU] gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
    I	15:30:57.386	[DFU] Read Response received from descr.00002a05-0000-1000-8000-00805f9b34fb, value (0x): 02-00
    A	15:30:57.386	[DFU] Service Changed indications enabled
    W	15:30:57.399	[DFU] Application with buttonless update found
    V	15:30:57.400	[DFU] Jumping to the DFU Bootloader...
    V	15:30:57.400	[DFU] Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
    D	15:30:57.400	[DFU] gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
    D	15:30:57.402	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x02-00)
    I	15:30:57.481	[DFU] Data written to descr.8ec90003-f315-4f60-9fb8-838830daea50
    V	15:30:57.481	[DFU] Notifications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
    A	15:30:57.482	[DFU] Indications enabled
    V	15:30:57.484	[DFU] Writing to characteristic 8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 01
    D	15:30:57.484	[DFU] gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50, value=0x01, WRITE_TYPE_DEFAULT)
    A	15:31:27.563	[DFU] Enter bootloader sent (Op Code = 1)
    D	15:31:27.588	[Callback] Connection state changed with status: 22 and new state: DISCONNECTED (0)
    E	15:31:27.588	Error 22 (0x16): GATT CONN TERMINATE LOCAL HOST
    I	15:31:27.588	Disconnected
    D	15:31:27.651	[DFU] gatt.disconnect()
    D	15:31:27.651	[DFU] gatt.close()
    V	15:31:27.651	[DFU] Scanning for the DFU Bootloader... (timeout 5000 ms)
    D	15:31:27.678	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	15:31:27.698	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    I	15:31:32.668	[DFU] DFU Bootloader not found. Trying the same address...
    V	15:31:32.692	[DFU] DFU service started
    I	15:31:32.692	[DFU] Firmware file opened successfully
    V	15:31:32.692	[DFU] Connecting to DFU target...
    D	15:31:32.724	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	15:32:02.787	[DFU] Connection failed (0x93): GATT CONN TIMEOUT
    W	15:32:02.787	[DFU] Retrying... (attempt 2 / 3)
    D	15:32:02.787	[DFU] gatt.refresh() (hidden)
    D	15:32:02.790	[DFU] gatt.disconnect()
    D	15:32:02.797	[DFU] gatt.close()
    V	15:32:02.844	[DFU] DFU service started
    I	15:32:02.845	[DFU] Firmware file opened successfully
    V	15:32:02.845	[DFU] Connecting to DFU target...
    D	15:32:02.845	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	15:32:32.921	[DFU] Connection failed (0x93): GATT CONN TIMEOUT
    W	15:32:32.922	[DFU] Retrying... (attempt 3 / 3)
    D	15:32:32.922	[DFU] gatt.refresh() (hidden)
    D	15:32:32.927	[DFU] gatt.disconnect()
    D	15:32:32.935	[DFU] gatt.close()
    V	15:32:32.970	[DFU] DFU service started
    I	15:32:32.970	[DFU] Firmware file opened successfully
    V	15:32:32.970	[DFU] Connecting to DFU target...
    D	15:32:32.974	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	15:33:03.043	[DFU] Connection failed (0x93): GATT CONN TIMEOUT
    D	15:33:03.043	[DFU] gatt.disconnect()
    D	15:33:03.048	[DFU] gatt.close()
    D	15:33:03.051	[DFU] wait(600)
    D	15:33:03.654	gatt.close()
    D	15:33:03.660	wait(200)
    V	15:33:03.861	Connecting to D2:39:6F:B2:10:CD...
    D	15:33:03.861	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	15:33:33.920	[Callback] Connection state changed with status: 147 and new state: DISCONNECTED (0)
    E	15:33:33.920	Error 147 (0x93): GATT CONN TIMEOUT
    I	15:33:33.920	Disconnected
    

    Hi Vidar,

    I have tried your suggestions of disabling NRF_DFU_BLE_REQUIRES_BONDS (bootloader) and NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS (application).

    Now my application code has ANCS, NUS and one Custom service.
    1. I have generated the settings page using this command.
    "nrfutil settings generate --family NRF52 --application bme68x_sensor_demo_ble_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 bl_settings.hex"

    2. After that I have merged application,bootloader and softdevices using this command:
    "mergehex --merge bl_settings.hex secure_bootloader_ble_s132_pca10040.hex s132_nrf52_7.2.0_softdevice.hex bme68x_sensor_demo_ble_s132.hex --output bl_sd_settings_app.hex"

    3 After merging, I have programmed this code using nrfjprog as follows:
    ** Run the following commands from the DFU folder
    i. " nrfjprog --recover "

    // Output :
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.

    ii. " nrfjprog -f nrf52 --program bl_sd_settings_app.hex --verify"

    // Output
    Parsing image file.
    Verfying programming.
    Verified OK.

    iii. " nrfjprog --reset "

    // Output
    Applying system reset.
    Run.
    4. Now I have paired the device with bonding using nrf connect mobile app. (Pairing + Bonding as my application has ANCS).

    5. After this I am selecting DFU service and enabling the notification, then I send 0x01 to the service to enter to DFU mode.

    6. After that I am selecting DFU with zip file type and start the DFU OTA. But I am unable to see the OTA progress due to error code as 0x93.
    I am attaching the error logs from the nRF connect mobile app. Please check it also and let me know what else I should add or modify to complete the same.

Reply
  • nRF Connect, 2025-04-16
    Sensor_Demo_cd (D2:39:6F:B2:10:CD)
    D	15:30:22.665	gatt.close()
    D	15:30:22.671	wait(200)
    V	15:30:22.881	Connecting to D2:39:6F:B2:10:CD...
    D	15:30:22.881	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	15:30:23.110	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	15:30:23.110	Connected to D2:39:6F:B2:10:CD
    V	15:30:23.131	Discovering services...
    D	15:30:23.131	gatt.discoverServices()
    D	15:30:23.132	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	15:30:23.170	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDING (11)
    D	15:30:23.219	[Broadcast] Action received: android.bluetooth.device.extra.PAIRING_VARIANT, pairing variant: CONSENT
    I	15:30:23.700	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	15:30:24.180	[Callback] Services discovered with status: 0
    I	15:30:24.180	Services discovered
    V	15:30:24.187	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    Unknown Service (00001000-1112-1314-1516-171819202122)
    - Unknown Characteristic [N R W WNR] (00001003-1112-1314-1516-171819202122)
       Client Characteristic Configuration (0x2902)
    Battery Service (0x180F)
    - Battery Level [N R W WNR] (0x2A19)
       Client Characteristic Configuration (0x2902)
    Secure DFU Service (0xFE59)
    - Buttonless DFU [I W] (8ec90003-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    Device Information (0x180A)
    - Manufacturer Name String [R] (0x2A29)
    - Model Number String [R] (0x2A24)
    - Serial Number String [R] (0x2A25)
    - Hardware Revision String [R] (0x2A27)
    - Firmware Revision String [R] (0x2A26)
    D	15:30:24.187	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	15:30:24.191	gatt.setCharacteristicNotification(00001003-1112-1314-1516-171819202122, true)
    D	15:30:24.192	gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
    D	15:30:24.283	[Broadcast] Action received: android.bluetooth.device.extra.PAIRING_VARIANT, pairing variant: CONSENT
    I	15:30:24.427	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    D	15:30:25.783	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDED (12)
    I	15:30:25.783	Device bonded
    I	15:30:29.027	Connection parameters updated (interval: 47.5ms, latency: 0, timeout: 4000ms)
    V	15:30:34.628	Enabling notifications for 00002a19-0000-1000-8000-00805f9b34fb
    D	15:30:34.628	gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
    D	15:30:34.630	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
    I	15:30:34.728	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
    A	15:30:34.728	"Notifications enabled" sent
    V	15:30:34.733	Notifications enabled for 00002a19-0000-1000-8000-00805f9b34fb
    V	15:30:37.529	Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
    D	15:30:37.529	gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
    D	15:30:37.531	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0200)
    I	15:30:37.674	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 02-00
    A	15:30:37.674	"Indications enabled" sent
    V	15:30:37.679	Indications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
    V	15:30:39.543	Writing request to characteristic 8ec90003-f315-4f60-9fb8-838830daea50
    D	15:30:39.543	gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50, value=0x01)
    I	15:30:39.629	Indication received from 8ec90003-f315-4f60-9fb8-838830daea50, value: (0x) 20-01-01
    A	15:30:39.629	"Response for: Enter bootloader
    Status: Success" received
    I	15:30:39.629	Data written to 8ec90003-f315-4f60-9fb8-838830daea50, value: (0x) 20-01-01
    A	15:30:39.629	"Response for: Enter bootloader
    Status: Success" sent
    V	15:30:53.225	[DFU] DFU service started
    V	15:30:53.225	[DFU] Opening file...
    I	15:30:53.262	[DFU] Firmware file opened successfully
    V	15:30:53.262	[DFU] Connecting to DFU target...
    D	15:30:53.262	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    I	15:30:53.282	[DFU] Connected to D2:39:6F:B2:10:CD
    V	15:30:57.289	[DFU] Discovering services...
    D	15:30:57.289	[DFU] gatt.discoverServices()
    I	15:30:57.295	[DFU] Services discovered
    V	15:30:57.296	[DFU] Reading Service Changed CCCD value...
    D	15:30:57.296	[DFU] gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
    I	15:30:57.386	[DFU] Read Response received from descr.00002a05-0000-1000-8000-00805f9b34fb, value (0x): 02-00
    A	15:30:57.386	[DFU] Service Changed indications enabled
    W	15:30:57.399	[DFU] Application with buttonless update found
    V	15:30:57.400	[DFU] Jumping to the DFU Bootloader...
    V	15:30:57.400	[DFU] Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
    D	15:30:57.400	[DFU] gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
    D	15:30:57.402	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x02-00)
    I	15:30:57.481	[DFU] Data written to descr.8ec90003-f315-4f60-9fb8-838830daea50
    V	15:30:57.481	[DFU] Notifications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
    A	15:30:57.482	[DFU] Indications enabled
    V	15:30:57.484	[DFU] Writing to characteristic 8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 01
    D	15:30:57.484	[DFU] gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50, value=0x01, WRITE_TYPE_DEFAULT)
    A	15:31:27.563	[DFU] Enter bootloader sent (Op Code = 1)
    D	15:31:27.588	[Callback] Connection state changed with status: 22 and new state: DISCONNECTED (0)
    E	15:31:27.588	Error 22 (0x16): GATT CONN TERMINATE LOCAL HOST
    I	15:31:27.588	Disconnected
    D	15:31:27.651	[DFU] gatt.disconnect()
    D	15:31:27.651	[DFU] gatt.close()
    V	15:31:27.651	[DFU] Scanning for the DFU Bootloader... (timeout 5000 ms)
    D	15:31:27.678	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	15:31:27.698	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    I	15:31:32.668	[DFU] DFU Bootloader not found. Trying the same address...
    V	15:31:32.692	[DFU] DFU service started
    I	15:31:32.692	[DFU] Firmware file opened successfully
    V	15:31:32.692	[DFU] Connecting to DFU target...
    D	15:31:32.724	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	15:32:02.787	[DFU] Connection failed (0x93): GATT CONN TIMEOUT
    W	15:32:02.787	[DFU] Retrying... (attempt 2 / 3)
    D	15:32:02.787	[DFU] gatt.refresh() (hidden)
    D	15:32:02.790	[DFU] gatt.disconnect()
    D	15:32:02.797	[DFU] gatt.close()
    V	15:32:02.844	[DFU] DFU service started
    I	15:32:02.845	[DFU] Firmware file opened successfully
    V	15:32:02.845	[DFU] Connecting to DFU target...
    D	15:32:02.845	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	15:32:32.921	[DFU] Connection failed (0x93): GATT CONN TIMEOUT
    W	15:32:32.922	[DFU] Retrying... (attempt 3 / 3)
    D	15:32:32.922	[DFU] gatt.refresh() (hidden)
    D	15:32:32.927	[DFU] gatt.disconnect()
    D	15:32:32.935	[DFU] gatt.close()
    V	15:32:32.970	[DFU] DFU service started
    I	15:32:32.970	[DFU] Firmware file opened successfully
    V	15:32:32.970	[DFU] Connecting to DFU target...
    D	15:32:32.974	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	15:33:03.043	[DFU] Connection failed (0x93): GATT CONN TIMEOUT
    D	15:33:03.043	[DFU] gatt.disconnect()
    D	15:33:03.048	[DFU] gatt.close()
    D	15:33:03.051	[DFU] wait(600)
    D	15:33:03.654	gatt.close()
    D	15:33:03.660	wait(200)
    V	15:33:03.861	Connecting to D2:39:6F:B2:10:CD...
    D	15:33:03.861	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	15:33:33.920	[Callback] Connection state changed with status: 147 and new state: DISCONNECTED (0)
    E	15:33:33.920	Error 147 (0x93): GATT CONN TIMEOUT
    I	15:33:33.920	Disconnected
    

    Hi Vidar,

    I have tried your suggestions of disabling NRF_DFU_BLE_REQUIRES_BONDS (bootloader) and NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS (application).

    Now my application code has ANCS, NUS and one Custom service.
    1. I have generated the settings page using this command.
    "nrfutil settings generate --family NRF52 --application bme68x_sensor_demo_ble_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 bl_settings.hex"

    2. After that I have merged application,bootloader and softdevices using this command:
    "mergehex --merge bl_settings.hex secure_bootloader_ble_s132_pca10040.hex s132_nrf52_7.2.0_softdevice.hex bme68x_sensor_demo_ble_s132.hex --output bl_sd_settings_app.hex"

    3 After merging, I have programmed this code using nrfjprog as follows:
    ** Run the following commands from the DFU folder
    i. " nrfjprog --recover "

    // Output :
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.

    ii. " nrfjprog -f nrf52 --program bl_sd_settings_app.hex --verify"

    // Output
    Parsing image file.
    Verfying programming.
    Verified OK.

    iii. " nrfjprog --reset "

    // Output
    Applying system reset.
    Run.
    4. Now I have paired the device with bonding using nrf connect mobile app. (Pairing + Bonding as my application has ANCS).

    5. After this I am selecting DFU service and enabling the notification, then I send 0x01 to the service to enter to DFU mode.

    6. After that I am selecting DFU with zip file type and start the DFU OTA. But I am unable to see the OTA progress due to error code as 0x93.
    I am attaching the error logs from the nRF connect mobile app. Please check it also and let me know what else I should add or modify to complete the same.

Children
  • I see you are using Android now. After sending 0x1 on the control point, please go back to the scanner view in the app and see if your device is advertising in DFU mode ("something with DFU in the name" and the original address + 1), or if it is advertising normally (indicating that the bootloader did not enter DFU mode).

  • Hi Vidar,

    I have tested the DFU without bonds. It was working fine as expected.

    After sending 0x01 to the control point my device will get disconnected from nrf connect mobile app. Then it will advertise with new advertising name as  : "DFU_Targ".Then I connect to DFU_Targ and start the OTA, the OTA is successful in this case. In this case, I didn't had ANCS service in my appliation and my device was not bonded.

    Now, I have included ANCS and I have enabled bonding in my application. So after sending 0x01 to the control point, this bonded device does not get disconnected and therefore, I am not able to see the device advertising with new name "DFU_Targ". That's why I was trying to enable DFU with bonds. 

    Kinldy, let me know how can I resolve this issue.

Related