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

dfu fails in nrf51822AC

Hi

I am using nrf51822 AC custom board and willing to program over dfu.

For dfu service setting I referred following links. Only change I did in pca10028 library because of custom pin configuration.

https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00087.html

https://devzone.nordicsemi.com/f/nordic-q-a/13879/dfu-ota-for-custom-application/53044#53044

I successfully added dfu service but failed to program the device over dfu using nrf connect app on android phone. 

I also shared nrf connect log. can anyone help me out with this problem.

nRF Connect, 2018-06-21
ngaige band_1 (DC:8E:75:B3:E8:F3)
I 17:54:58.901 [Server] Server started
V 17:54:58.908 Heart Rate (0x180D)
- Heart Rate Measurement [N] (0x2A37)
   Client Characteristic Configuration (0x2902)
- Body Sensor Location [R] (0x2A38)
- Heart Rate Control Point [W] (0x2A39)
Unknown Service (0000aaa0-0000-1000-8000-aabbccddeeff)
- Unknown Characteristic [N R] (0000aaa1-0000-1000-8000-aabbccddeeff)
   Client Characteristic Configuration (0x2902)
   Unknown Descriptor (0000aab0-0000-1000-8000-aabbccddeeff)
   Characteristic User Description (0x2901)
   Characteristic Presentation Format (0x2904)
- Unknown Characteristic [I W WNR] (0000aaa2-0000-1000-8000-aabbccddeeff)
   Client Characteristic Configuration (0x2902)
Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
- RX Characteristic [R W] (6e400002-b5a3-f393-e0a9-e50e24dcca9e)
V 17:54:59.233 Connecting to DC:8E:75:B3:E8:F3...
D 17:54:59.233 gatt = device.connectGatt(autoConnect = true, TRANSPORT_LE)
D 17:54:59.505 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 17:54:59.505 [Server] Device with address DC:8E:75:B3:E8:F3 connected
V 17:54:59.505 [Server] Creating server connection...
D 17:54:59.505 server.connect(device, autoConnect = true)
D 17:54:59.507 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 17:54:59.507 Connected to DC:8E:75:B3:E8:F3
D 17:54:59.526 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V 17:54:59.526 Discovering services...
D 17:54:59.526 gatt.discoverServices()
D 17:55:00.423 [Callback] Services discovered with status: 0
I 17:55:00.423 Services discovered
V 17:55:00.448 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
- TX Characteristic [N R] (6e400003-b5a3-f393-e0a9-e50e24dcca9e)
   Client Characteristic Configuration (0x2902)
- RX Characteristic [R W WNR] (6e400002-b5a3-f393-e0a9-e50e24dcca9e)
Device Firmware Update Service (00001530-1212-efde-1523-785feabcd123)
- DFU Packet [WNR] (00001532-1212-efde-1523-785feabcd123)
- DFU Control Point [N W] (00001531-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
- DFU Version [R] (00001534-1212-efde-1523-785feabcd123)
D 17:55:00.448 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 17:55:00.451 gatt.setCharacteristicNotification(6e400003-b5a3-f393-e0a9-e50e24dcca9e, true)
D 17:55:00.452 gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
V 17:55:02.271 Enabling notifications for 6e400003-b5a3-f393-e0a9-e50e24dcca9e
D 17:55:02.271 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
I 17:55:02.332 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 17:55:02.332 "Notifications enabled" sent
V 17:55:02.338 Notifications enabled for 6e400003-b5a3-f393-e0a9-e50e24dcca9e
I 17:55:02.430 Notification received from 6e400003-b5a3-f393-e0a9-e50e24dcca9e, value: (0x) 2A-45-5B-30-30-30-30-30-30-5D, "*E[000000]"
A 17:55:02.430 "*E[000000]" received
D 17:55:23.414 [Server callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I 17:55:23.414 [Server] Device disconnected
D 17:55:23.414 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 17:55:23.415 Error 8 (0x8): GATT CONN TIMEOUT
I 17:55:23.415 Disconnected
D 17:55:23.431 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 17:55:31.729 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 17:55:31.730 [Server] Device with address DC:8E:75:B3:E8:F3 connected
V 17:55:31.730 [Server] Creating server connection...
D 17:55:31.730 server.connect(device, autoConnect = true)
D 17:55:31.733 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 17:55:31.733 Connected to DC:8E:75:B3:E8:F3
D 17:55:31.734 gatt.connect()
D 17:55:31.738 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
D 17:55:31.752 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V 17:55:31.752 Discovering services...
D 17:55:31.752 gatt.discoverServices()
D 17:55:32.637 [Callback] Services discovered with status: 0
I 17:55:32.637 Services discovered
V 17:55:32.654 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
- TX Characteristic [N R] (6e400003-b5a3-f393-e0a9-e50e24dcca9e)
   Client Characteristic Configuration (0x2902)
- RX Characteristic [R W WNR] (6e400002-b5a3-f393-e0a9-e50e24dcca9e)
Device Firmware Update Service (00001530-1212-efde-1523-785feabcd123)
- DFU Packet [WNR] (00001532-1212-efde-1523-785feabcd123)
- DFU Control Point [N W] (00001531-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
- DFU Version [R] (00001534-1212-efde-1523-785feabcd123)
D 17:55:32.654 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 17:55:32.656 gatt.setCharacteristicNotification(6e400003-b5a3-f393-e0a9-e50e24dcca9e, true)
D 17:55:32.659 gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
V 17:55:43.090 [DFU] DFU service started
V 17:55:43.090 [DFU] Opening file...
I 17:55:43.137 [DFU] Firmware file opened successfully
V 17:55:43.137 [DFU] Connecting to DFU target...
D 17:55:43.138 [DFU] gatt = device.connectGatt(autoConnect = false)
I 17:55:43.154 [DFU] Connected to DC:8E:75:B3:E8:F3
V 17:55:43.154 [DFU] Discovering services...
D 17:55:43.155 [DFU] gatt.discoverServices()
I 17:55:50.065 [DFU] Services discovered
D 17:55:50.087 [DFU] wait(1000)
V 17:55:51.073 [DFU] Reading DFU version number...
D 17:55:51.073 [DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
I 17:55:53.054 [DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 01-00
A 17:55:53.055 [DFU] Version number read: 0.1
W 17:55:53.056 [DFU] Application with buttonless update found
V 17:55:53.056 [DFU] Jumping to the DFU Bootloader...
V 17:55:53.056 [DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
D 17:55:53.056 [DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
D 17:55:53.059 [DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
I 17:55:53.692 [DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
V 17:55:53.692 [DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
A 17:55:53.692 [DFU] Notifications enabled
D 17:55:53.692 [DFU] wait(1000)
V 17:55:54.722 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 17:55:54.723 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
A 17:55:58.209 [DFU] Jump to bootloader sent (Op Code = 1, Upload Mode = 4)
D 17:56:02.219 [Server callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I 17:56:02.219 [Server] Device disconnected
D 17:56:02.221 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 17:56:02.221 Error 8 (0x8): GATT CONN TIMEOUT
I 17:56:02.221 Disconnected
I 17:56:02.223 [DFU] Disconnected by the remote device
D 17:56:02.240 [DFU] gatt.refresh() (hidden)
D 17:56:02.240 [DFU] gatt.close()
D 17:56:02.240 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 17:56:02.258 [DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
V 17:56:02.258 [DFU] DFU service started
I 17:56:02.258 [DFU] Firmware file opened successfully
D 17:56:02.258 [DFU] wait(1000)
D 17:56:03.246 [DFU] wait(1000)
D 17:56:03.710 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 17:56:03.710 [Server] Device with address DC:8E:75:B3:E8:F3 connected
D 17:56:03.731 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D 17:56:03.731 [DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D 17:56:03.732 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 17:56:03.732 Connected to DC:8E:75:B3:E8:F3
V 17:56:03.746 Discovering services...
D 17:56:03.746 gatt.discoverServices()
V 17:56:04.249 [DFU] Connecting to DFU target...
D 17:56:04.271 [DFU] gatt = device.connectGatt(autoConnect = false)
I 17:56:04.271 [DFU] Connected to DC:8E:75:B3:E8:F3
V 17:56:04.271 [DFU] Discovering services...
D 17:56:04.272 [DFU] gatt.discoverServices()
D 17:56:04.929 [Callback] Services discovered with status: 0
I 17:56:04.929 Services discovered
I 17:56:04.932 [DFU] Services discovered
V 17:56:04.946 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Device Firmware Update Service (00001530-1212-efde-1523-785feabcd123)
- DFU Packet [WNR] (00001532-1212-efde-1523-785feabcd123)
- DFU Control Point [N W] (00001531-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
- DFU Version [R] (00001534-1212-efde-1523-785feabcd123)
D 17:56:04.946 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 17:56:04.948 gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
D 17:56:04.952 [DFU] wait(1000)
V 17:56:05.953 [DFU] Reading DFU version number...
D 17:56:05.953 [DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
I 17:56:06.015 [DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 08-00
A 17:56:06.016 [DFU] Version number read: 0.8
D 17:56:06.016 [DFU] wait(1000)
V 17:56:07.017 [DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
D 17:56:07.017 [DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
D 17:56:07.019 [DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
I 17:56:07.065 [DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
V 17:56:07.065 [DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
A 17:56:07.065 [DFU] Notifications enabled
D 17:56:07.065 [DFU] wait(1000)
V 17:56:08.093 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 17:56:08.093 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 17:56:08.115 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 01-04
A 17:56:08.115 [DFU] DFU Start sent (Op Code = 1, Upload Mode = 4)
V 17:56:08.116 [DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D 17:56:08.116 [DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I 17:56:08.119 [DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 00-00-00-00-00-00-00-00-DC-5D-00-00
A 17:56:08.120 [DFU] Firmware image size sent (0b, 0b, 24028b)
I 17:56:10.127 [DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-01-01
A 17:56:10.128 [DFU] Response received (Op Code = 1 Status = 1)
A 17:56:10.128 [DFU] Writing Initialize DFU Parameters...
V 17:56:10.129 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 17:56:10.129 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 17:56:10.188 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-00
V 17:56:10.189 [DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D 17:56:10.190 [DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I 17:56:10.194 [DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): FF-FF-FF-FF-FF-FF-FF-FF-01-00-FE-FF-D3-2A
V 17:56:10.195 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 17:56:10.195 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 17:56:10.225 Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-01-01
A 17:56:10.225 "Response for: Start DFU
Value: Success" received
I 17:56:10.245 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-01
I 17:56:10.245 Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-02-01
A 17:56:10.245 "Response for: Initialize DFU Parameters
Value: Success" received
I 17:56:10.245 [DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-02-01
A 17:56:10.245 [DFU] Initialize DFU Parameters completed
A 17:56:10.246 [DFU] Response received (Op Code = 2, Status = 1)
V 17:56:10.246 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 17:56:10.246 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 17:56:10.306 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 03
A 17:56:10.306 [DFU] Receive Firmware Image request sent
A 17:56:10.345 [DFU] Uploading firmware...
V 17:56:10.345 [DFU] Sending firmware to characteristic 00001532-1212-efde-1523-785feabcd123...
I 17:56:24.234 Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-03-06
A 17:56:24.234 "Response for: Receive firmware image
Value: Operation failed" received
I 17:56:24.248 [DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-03-06
A 17:56:24.248 [DFU] Response received (Op Code = 3, Status = 6)
E 17:56:24.248 [DFU] Remote DFU error: OPERATION FAILED
V 17:56:24.248 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 17:56:24.248 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 17:56:24.256 Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-03-06
A 17:56:24.256 "Response for: Receive firmware image
Value: Operation failed" received
I 17:56:24.315 Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-03-06
A 17:56:24.315 "Response for: Receive firmware image
Value: Operation failed" received

Related