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

Trouble generating the proper bootloader DFU image

I am using the legacy bootloader, SDK 11.0 with SD 2.0, S132

The example Bootloader DFU images part of SDK 11.0 load just fine (I'm using nRF Connect Android app), however when I create my own package, I see "[DFU] Remote DFU error: OPERATION FAILED."

I used the following command: "$ nrfutil pkg generate --bootloader bootloader.hex --bootloader-version 0x11 --sd-req 0x81 bootloader.zip"

nRF Connect, 2019-08-01
DfuTarg (F4:60:EF:35:22:ED)
D	17:49:34.233	gatt.close()
D	17:49:34.237	wait(200)
V	17:49:34.443	Connecting to F4:60:EF:35:22:ED...
D	17:49:34.444	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	17:49:34.813	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
E	17:49:34.814	Error 133 (0x85): GATT ERROR
I	17:49:34.814	Disconnected
D	17:49:36.715	gatt.close()
D	17:49:36.717	wait(200)
V	17:49:36.924	Connecting to F4:60:EF:35:22:ED...
D	17:49:36.925	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	17:49:37.249	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D	17:49:37.249	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	17:49:37.262	Connected to F4:60:EF:35:22:ED
V	17:49:37.311	Discovering services...
D	17:49:37.311	gatt.discoverServices()
I	17:49:37.691	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 4000ms)
I	17:49:38.030	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D	17:49:38.169	[Callback] Services discovered with status: 0
I	17:49:38.169	Services discovered
V	17:49:38.203	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:49:38.204	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
I	17:49:38.234	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 4000ms)
I	17:49:38.818	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 4000ms)
V	17:49:40.141	[DFU] DFU service started
V	17:49:40.141	[DFU] Opening file...
I	17:49:40.158	[DFU] Firmware file opened successfully
V	17:49:40.158	[DFU] Connecting to DFU target...
D	17:49:40.161	[DFU] gatt = device.connectGatt(autoConnect = false)
I	17:49:40.171	[DFU] Connected to F4:60:EF:35:22:ED
V	17:49:40.171	[DFU] Discovering services...
D	17:49:40.171	[DFU] gatt.discoverServices()
I	17:49:40.176	[DFU] Services discovered
D	17:49:40.197	[DFU] wait(1000)
V	17:49:41.200	[DFU] Reading DFU version number...
D	17:49:41.200	[DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
I	17:49:41.243	[DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 08-00
A	17:49:41.244	[DFU] Version number read: 0.8
D	17:49:41.248	[DFU] wait(1000)
V	17:49:42.294	[DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
D	17:49:42.294	[DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
D	17:49:42.294	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
I	17:49:42.321	[DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
V	17:49:42.322	[DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
A	17:49:42.322	[DFU] Notifications enabled
D	17:49:42.322	[DFU] wait(1000)
V	17:49:43.325	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D	17:49:43.325	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I	17:49:43.388	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 01-02
A	17:49:43.389	[DFU] DFU Start sent (Op Code = 1, Upload Mode = 2)
V	17:49:43.389	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D	17:49:43.389	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I	17:49:43.389	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 00-00-00-00-24-3F-00-00-00-00-00-00
A	17:49:43.389	[DFU] Firmware image size sent (0b, 16164b, 0b)
I	17:49:44.365	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-01-01
A	17:49:44.365	[DFU] Response received (Op Code = 1 Status = 1)
A	17:49:44.365	[DFU] Writing Initialize DFU Parameters...
V	17:49:44.365	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D	17:49:44.365	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I	17:49:44.449	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-00
V	17:49:44.449	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D	17:49:44.449	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I	17:49:44.449	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 0A-48-08-01-12-44-08-A3-02-10-FF-FF-FF-FF-0F-1A-02-81-01-20
V	17:49:44.449	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D	17:49:44.449	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I	17:49:44.449	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 02-28-00-30-A4-7E-38-00-42-24-08-03-12-20-A6-A1-26-8B-39-E0
V	17:49:44.449	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D	17:49:44.449	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I	17:49:44.449	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): AF-69-07-0A-BF-37-81-C6-F1-CC-69-67-8E-DE-40-99-DF-1B-BD-EF
V	17:49:44.449	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D	17:49:44.449	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I	17:49:44.453	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 6C-43-A6-56-0C-FB-48-01-52-04-08-01-12-00
V	17:49:44.453	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D	17:49:44.453	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I	17:49:44.512	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-01
A	17:49:44.512	[DFU] Initialize DFU Parameters completed
I	17:49:44.513	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-02-06
A	17:49:44.514	[DFU] Response received (Op Code = 2, Status = 6)
E	17:49:44.515	[DFU] Remote DFU error: OPERATION FAILED
V	17:49:44.516	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D	17:49:44.516	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
D	17:49:48.557	[Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E	17:49:48.558	Error 8 (0x8): GATT CONN TIMEOUT
I	17:49:48.558	Disconnected
A	17:49:48.572	[DFU] Reset request sent
V	17:49:48.572	[DFU] Disconnecting...
D	17:49:48.614	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D	17:49:48.615	[DFU] gatt.disconnect()
I	17:49:48.615	[DFU] Disconnected
D	17:49:48.615	[DFU] gatt.refresh() (hidden)
D	17:49:48.615	[DFU] gatt.close()
D	17:49:48.615	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D	17:49:48.635	[DFU] wait(600)
D	17:49:49.224	gatt.close()
D	17:49:49.229	wait(200)
V	17:49:49.433	Connecting to F4:60:EF:35:22:ED...
D	17:49:49.433	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	17:49:49.757	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D	17:49:49.763	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	17:49:49.763	Connected to F4:60:EF:35:22:ED
V	17:49:49.794	Discovering services...
D	17:49:49.794	gatt.discoverServices()
I	17:49:50.206	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 4000ms)
I	17:49:50.548	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D	17:49:50.683	[Callback] Services discovered with status: 0
I	17:49:50.683	Services discovered
V	17:49:50.698	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:49:50.698	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
I	17:49:50.752	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 4000ms)
I	17:49:51.326	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 4000ms)

Not sure what I am doing incorrectly.

More info: 

I looked at the nrf_err_code_translate(...) in "dfu_transport_ble.c" and the err_code seen is "9" (NRF_ERROR_INVALID_LENGTH)

Related