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

DFU works only when RTT logging is running

I am using the secure bootloader with DFU, and the buttonless DFU service. I extracted these applications from the Thingy SDK v2.1.0. This works perfectly fine as long as RTT logging is running. If I disconnect RTT logging the connection times out at some point. Please note that it is the same firmware running on the device, I am simply not catching the RTT log. I observe the same behavior if I disable RTT logging in firmware as well. I have experienced that the timeout occurs either just before file transfer commence, or after it is 10-20% complete.

This is the log from NRF Connect - Mobile as I attempt a FW update:

12:16:16.587	[DFU] DFU service started
12:16:16.588	[DFU] Opening file...
12:16:16.590	[DFU] Firmware file opened successfully
12:16:16.590	[DFU] Connecting to DFU target...
12:16:16.592	[DFU] gatt = device.connectGatt(autoConnect = false)
12:16:16.603	[DFU] Connected to F3:4A:B6:60:D4:E8
12:16:16.603	[DFU] Discovering services...
12:16:16.603	[DFU] gatt.discoverServices()
12:16:16.605	[DFU] Services discovered
12:16:16.613	[DFU] wait(1000)
12:16:17.608	[DFU] Application with buttonless update found
12:16:17.609	[DFU] Jumping to the DFU Bootloader...
12:16:17.609	[DFU] Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
12:16:17.609	[DFU] gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
12:16:17.611	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x02-00)
12:16:17.763	[DFU] Data written to descr.8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 02-00
12:16:17.763	[DFU] Notifications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
12:16:17.763	[DFU] Indications enabled
12:16:17.763	[DFU] wait(1000)
12:16:18.784	[DFU] Writing to characteristic 8ec90003-f315-4f60-9fb8-838830daea50
12:16:18.784	[DFU] gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50)
12:16:18.807	[DFU] Enter bootloader sent (Op Code = 1)
12:16:18.808	[DFU] Notification received from 8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 20-01-01
12:16:18.808	[DFU] Response received (Op Code = 1, Status = 1)
12:16:22.043	[Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
12:16:22.043	Error 8 (0x8): GATT CONN TIMEOUT
12:16:22.043	Disconnected
12:16:22.069	[DFU] Disconnected by the remote device
12:16:22.069	[DFU] gatt.refresh() (hidden)
12:16:22.069	[DFU] gatt.close()
12:16:22.069	[DFU] Scanning for the DFU Bootloader...
12:16:22.084	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
12:16:22.103	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
12:16:22.174	[DFU] DFU Bootloader found with address F3:4A:B6:60:D4:E9
12:16:22.178	[DFU] DFU service started
12:16:22.178	[DFU] Firmware file opened successfully
12:16:22.178	[DFU] wait(1000)
12:16:23.187	[DFU] wait(1000)
12:16:24.179	[DFU] Connecting to DFU target...
12:16:24.209	[DFU] gatt = device.connectGatt(autoConnect = false)
12:16:25.178	[DFU] Connected to F3:4A:B6:60:D4:E9
12:16:25.399	[DFU] Discovering services...
12:16:25.399	[DFU] gatt.discoverServices()
12:16:25.400	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
12:16:29.856	[DFU] Disconnected
12:16:29.856	[DFU] gatt.refresh() (hidden)
12:16:29.856	[DFU] gatt.close()
12:16:29.856	[DFU] wait(600)
12:16:29.862	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
12:16:30.432	gatt.close()

As it works when RTT logging is running I have not been able to see what happens on the device when the error occurs. I will attempt to enable UART logging to see if it makes a difference.

The only changes I have made in the bootloader is pinout, enabled RTT logging, and a minor adaptation of the error handlers in main.c.

The system setup:

Microcontroller: NRF528232
SDK Version: 13
Debugger: nRF52 DK

Parents Reply Children
No Data
Related