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.

  • 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.

  • Hi,

    Mushtakh Shaikh said:
    So after sending 0x01 to the control point, this bonded device does not get disconnected and therefore,

    What is the error response when you try to send this command? Also, just to confirm, you did not enable bond forwarding (NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS) at this point? 

    https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/service_dfu.html 

  • Hi Vidar,

    1. I have not enabled 

    NRF_DFU_BLE_REQUIRES_BONDS (bootloader) and NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS (application) after your suggestions in previous reply to this tread. 

    2. I am not able to see the debug log in my segger embedded studi, but I am sharing the logs in nrfconnect mobile app.

    After sending 0x01 to the control point my app gets disconnected with following errors: 

    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()

    Complete log:  

    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()

  • Hi,

    The nRF connect log shows that the connection is lost before the app responded to the "enter bootloader" command. It could indicate that the program is crashing.

    Mushtakh Shaikh said:
    I am not able to see the debug log in my segger embedded studi

    Have you tried to make it work? Are you enabling logging over UART or RTT?

Reply Children
  • Hi Vidar,
    1. Currently I have ANCS and peer management related functionality in my application.
    So when I connect with mobile app, it gets connected with bonding.
    2. Now as per your suggestion in previous reply to this thread, I have implemented DFU without bonding.
    3. As per DFU process, when device enters DFU mode,the current device gets disconnected and then it starts advertising with the name as "DFU_Targ"
    Then we go back to scanner and connect and then do the DFU OTA.
    4. Now when it comes to my application, the device gets disconnected so that it can be connected to new device name "DFU_Targ", but since the device is already bonded,
    it is not advertising agaain nor reconnecting back, then we are getting the timeout error.

    5. Yes I have enabled the logging over RTT. I am able to see the other logs but only when this error occures, I am not able to see the logs.

  • Hi,

    but since the device is already bonded,
    it is not advertising agaain nor reconnecting back, then we are getting the timeout error.

    It should be possible to debug the application here to determine why it is failing to enter bootloader DFU mode. Anyway, I tested buttonless dfu with the ANCS sample (modified to include buttonless service) and did not experience any problems. Please try the attached project and see if it works on your end as well.

    _build_nrf52832.zip

    ble_app_ancs_c_dfu.zip

Related