Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU works on ios, not android

Hello,

I am having a problem using DFU using the android NRF connect app.  I have two separate projects that use the OTA DFU. These two projects have the same DFU code. These two projects were exported with different versions of the NRF5 SDK.

NRF5 SDK version 15.2.0 - DFU works on Android and IOS

NRF5 SDK version 17.0.2 - DFU only works on IOS, not android

Is there a reason for why the DFU no longer works with the Android NRF Connect app? Is there some additional settings that need to be added? Thank you very much for your help!

Parents
  • Hi Joseph, 

    It should work both for  IOS, and android. 

    Could you elaborate on how it cannot work with android? Are you able to provide the log from NRF connect app and the debug log on the device by running debug version of the bootloader? If you could also sniffer log, that will benefit us more.  

    Do you use bond or pair in the DFU? Don't forget to erase the kit before programming the code. 

    -Amanda H.

  • It does not work when using the Android NRF Connect app. The process gets partway through, then a GATT error occurs. When using the IOS NRF Connect app, the firmware updates correctly. I have attached a log from NRF Connect here. I will work on getting a sniffer log as well.

    nRF Connect, 2021-07-26
    Shot Counter AB22C02A (C0:56:AB:22:C0:2A)
    V	08:17:50.563	Connecting to C0:56:AB:22:C0:2A...
    D	08:17:50.563	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	08:17:50.936	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	08:17:50.961	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	08:17:50.961	Connected to C0:56:AB:22:C0:2A
    V	08:17:50.962	Discovering services...
    D	08:17:50.962	gatt.discoverServices()
    I	08:17:51.274	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	08:17:52.028	[Callback] Services discovered with status: 0
    I	08:17:52.028	Services discovered
    V	08:17:52.042	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)
    Battery Service (0x180F)
    - Battery Level [N R] (0x2A19)
       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)
    - Software Revision String [R] (0x2A28)
    Secure DFU Service (0xFE59)
    - Unknown Characteristic [I W] (8ec90003-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    Unknown Service (32de6500-e5fe-4581-ee4d-ce409d5633d2)
    - Unknown Characteristic [N] (32de6501-e5fe-4581-ee4d-ce409d5633d2)
       Client Characteristic Configuration (0x2902)
    Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
    - RX Characteristic [W WNR] (6e400002-b5a3-f393-e0a9-e50e24dcca9e)
    - TX Characteristic [N] (6e400003-b5a3-f393-e0a9-e50e24dcca9e)
       Client Characteristic Configuration (0x2902)
    Unknown Service (32de6600-e5fe-4581-ee4d-ce409d5633d2)
    - Unknown Characteristic [N R] (32de0002-e5fe-4581-ee4d-ce409d5633d2)
       Client Characteristic Configuration (0x2902)
    D	08:17:52.042	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	08:17:52.044	gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
    D	08:17:52.046	gatt.setCharacteristicNotification(32de6501-e5fe-4581-ee4d-ce409d5633d2, true)
    D	08:17:52.047	gatt.setCharacteristicNotification(6e400003-b5a3-f393-e0a9-e50e24dcca9e, true)
    D	08:17:52.048	gatt.setCharacteristicNotification(32de0002-e5fe-4581-ee4d-ce409d5633d2, true)
    I	08:17:52.123	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    I	08:17:56.383	Connection parameters updated (interval: 18.75ms, latency: 0, timeout: 4000ms)
    V	08:18:20.855	[DFU] DFU service started
    V	08:18:20.855	[DFU] Opening file...
    I	08:18:20.855	[DFU] Firmware file opened successfully
    V	08:18:20.855	[DFU] Connecting to DFU target...
    D	08:18:20.855	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    I	08:18:20.857	[DFU] Connected to C0:56:AB:22:C0:2A
    V	08:18:20.857	[DFU] Discovering services...
    D	08:18:20.857	[DFU] gatt.discoverServices()
    I	08:18:20.869	[DFU] Services discovered
    D	08:18:20.869	[DFU] wait(1000)
    W	08:18:21.913	[DFU] Application with buttonless update found
    V	08:18:21.913	[DFU] Jumping to the DFU Bootloader...
    V	08:18:21.913	[DFU] Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
    D	08:18:21.913	[DFU] gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
    D	08:18:21.913	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x02-00)
    I	08:18:21.913	[DFU] Data written to descr.8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 02-00
    V	08:18:21.913	[DFU] Notifications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
    A	08:18:21.913	[DFU] Indications enabled
    D	08:18:21.913	[DFU] wait(1000)
    V	08:18:22.955	[DFU] Writing to characteristic 8ec90003-f315-4f60-9fb8-838830daea50
    D	08:18:22.955	[DFU] gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50)
    I	08:18:22.999	[DFU] Notification received from 8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 20-01-01
    A	08:18:22.999	[DFU] Enter bootloader sent (Op Code = 1)
    A	08:18:22.999	[DFU] Response received (Op Code = 1, Status = 1)
    D	08:18:27.026	[Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
    E	08:18:27.026	Error 8 (0x8): GATT CONN TIMEOUT
    I	08:18:27.026	Disconnected
    I	08:18:27.029	[DFU] Disconnected by the remote device
    D	08:18:27.029	[DFU] gatt.refresh() (hidden)
    D	08:18:27.087	[DFU] gatt.disconnect()
    D	08:18:27.087	[DFU] gatt.close()
    V	08:18:27.087	[DFU] Scanning for the DFU Bootloader...
    D	08:18:27.089	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	08:18:27.152	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    I	08:18:32.078	[DFU] DFU Bootloader not found. Trying the same address...
    V	08:18:32.087	[DFU] DFU service started
    I	08:18:32.087	[DFU] Firmware file opened successfully
    D	08:18:32.087	[DFU] wait(1000)
    D	08:18:33.102	[DFU] wait(1000)
    V	08:18:34.090	[DFU] Connecting to DFU target...
    D	08:18:34.115	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	08:18:39.149	[DFU] Connection failed (0x85): GATT ERROR
    W	08:18:39.149	[DFU] Retrying...
    D	08:18:39.149	[DFU] gatt.refresh() (hidden)
    D	08:18:39.151	[DFU] gatt.disconnect()
    D	08:18:39.164	[DFU] gatt.close()
    V	08:18:39.172	[DFU] DFU service started
    I	08:18:39.172	[DFU] Firmware file opened successfully
    D	08:18:39.172	[DFU] wait(1000)
    D	08:18:40.173	[DFU] wait(1000)
    V	08:18:41.198	[DFU] Connecting to DFU target...
    D	08:18:41.198	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	08:18:46.220	[DFU] Connection failed (0x85): GATT ERROR
    W	08:18:46.220	[DFU] Retrying...
    D	08:18:46.220	[DFU] gatt.refresh() (hidden)
    D	08:18:46.220	[DFU] gatt.disconnect()
    D	08:18:46.229	[DFU] gatt.close()
    V	08:18:46.243	[DFU] DFU service started
    I	08:18:46.243	[DFU] Firmware file opened successfully
    D	08:18:46.243	[DFU] wait(1000)
    D	08:18:47.244	[DFU] wait(1000)
    V	08:18:48.266	[DFU] Connecting to DFU target...
    D	08:18:48.266	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    E	08:18:53.288	[DFU] Connection failed (0x85): GATT ERROR
    D	08:18:53.289	[DFU] gatt.refresh() (hidden)
    D	08:18:53.290	[DFU] gatt.disconnect()
    D	08:18:53.297	[DFU] gatt.close()
    D	08:18:53.303	[DFU] wait(600)
    D	08:18:53.907	gatt.close()
    D	08:18:53.919	wait(200)
    V	08:18:54.121	Connecting to C0:56:AB:22:C0:2A...
    D	08:18:54.121	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	08:18:59.183	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	08:18:59.183	Error 133 (0x85): GATT ERROR
    I	08:18:59.183	Disconnected
    

  • Thanks. Also, need the debug log on the device.  

  • I am having problems with a release build, and cannot get a debug log from the device while the DFU is happening. I am having trouble installing the Wireshark Sniffer extension. I have attached a capture of the error message. I have tried using NRF Toolbox to do the DFU, and that fails as well.

  • If you have pip installed, you can install serial from the command line with:

    pip install pyserial
  • I resolved the problem. The 32k crystal had a cold soldered pad causing DFU issue.

Reply Children
No Data
Related