Hi all
I want to do a device firmware update via the bootloader, and I am unable to do so, as all attempts end with a disconnect from my Android phone (Pixel 4a). I can scan for the device, but when I try to use nRF Connect or nRF Toolbox, it either just times out and nothing happens or I get an attempt of an upload which takes around 30 seconds and then ends with "GATT error".
I am using the secure bootloader for SD s132 on SDK 17.0.2 and changed some things there using the CMSIS Configuration Wizard, e.g. advertising name and pin to my button. Everything runs on an nRF52832 on a custom board I designed. The application works as intended, it is just an issue with the DFU.
To troubleshoot the problem, I ran the debug version of the bootloader and got the following output:
00:00:00.000,000] <info> app: Inside main[0m [0m[00:00:00.000,000] <debug> app: In nrf_bootloader_init[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...[0m [0m[00:00:00.000,000] <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Using settings page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Copying forbidden parts from backup page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.[0m [0m[00:00:00.000,000] <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.[0m [0m[00:00:00.000,000] <debug> app: Enter nrf_bootloader_fw_activate[0m [0m[00:00:00.000,000] <info> app: No firmware to activate.[0m [0m[00:00:00.000,000] <debug> app: App is valid[0m [0m[00:00:00.000,000] <debug> app: DFU mode requested via button.[0m [0m[00:00:00.000,000] <info> nrf_bootloader_wdt: WDT is not enabled[0m [0m[00:00:00.000,000] <debug> app: in weak nrf_dfu_init_user[0m [0m[00:00:00.000,000] <debug> app: timer_stop (0x20005984)[0m [0m[00:00:00.000,000] <debug> app: timer_activate (0x20005984)[0m [0m[00:00:00.000,000] <info> app: Entering DFU mode.[0m [0m[00:00:00.000,000] <debug> app: Initializing transports (found: 1)[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Initializing BLE DFU transport[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Setting up vector table: 0x00071000[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Enabling SoftDevice.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Configuring BLE stack.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Enabling the BLE stack.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: No advertising name found[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Using default advertising name[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Advertising...[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: BLE DFU transport initialized.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.[0m [0m[00:00:00.000,000] <debug> app: Enter main loop[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Connected[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Advertising...[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Using settings page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Copying forbidden parts from backup page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Connected[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Advertising...[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Using settings page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Copying forbidden parts from backup page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Connected[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Advertising...[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Using settings page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Copying forbidden parts from backup page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Connected[0m [0m[00:00:00.000,000] <debug> nrf_dfu_ble: Advertising...[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Using settings page.[0m [0m[00:00:00.000,000] <debug> nrf_dfu_settings: Copying forbidden parts from backup page.[0m
Following that, I also installed Wireshark and ran a trace:
5246 98.249 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 299µs 0 ADV_IND 5247 98.249 5b:64:ce:90:3b:10 LE 1M LE LL 12 150µs 0 SCAN_REQ 5248 98.249 ff:1c:eb:33:1d:d8 LE 1M LE LL 6 149µs 0 SCAN_RSP 5249 100.324 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 2074537µs 0 ADV_IND 5250 100.325 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 497µs 0 ADV_IND 5251 100.325 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 497µs 0 ADV_IND 5252 103.066 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 2739598µs 0 ADV_IND 5253 103.066 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 497µs 0 ADV_IND 5254 103.067 5b:64:ce:90:3b:10 LE 1M LE LL 34 150µs 0 CONNECT_IND 5255 103.091 Master_0xb02608b7 LE 1M LE LL 9 23701µs 0 0 False 0 Control Opcode: LL_FEATURE_REQ 5256 103.136 Master_0xb02608b7 LE 1M LE LL 9 44849µs 0 0 False 1 Control Opcode: LL_FEATURE_REQ 5257 103.180 Master_0xb02608b7 LE 1M LE LL 9 44848µs 0 0 False 2 Control Opcode: LL_FEATURE_REQ 5258 103.225 Master_0xb02608b7 LE 1M LE LL 9 44849µs 0 0 False 3 Control Opcode: LL_FEATURE_REQ 5259 103.270 Master_0xb02608b7 LE 1M LE LL 9 44849µs 0 0 False 4 Control Opcode: LL_FEATURE_REQ 5260 103.315 Master_0xb02608b7 LE 1M LE LL 9 44848µs 0 0 False 5 Control Opcode: LL_FEATURE_REQ 5261 124.112 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 20796277µs 0 ADV_IND 5262 124.113 5b:64:ce:90:3b:10 LE 1M LE LL 34 150µs 0 CONNECT_IND 5263 124.151 Master_0x69a574da LE 1M LE LL 9 38072µs 0 0 False 0 Control Opcode: LL_FEATURE_REQ 5264 124.196 Master_0x69a574da LE 1M LE LL 9 44849µs 0 0 False 1 Control Opcode: LL_FEATURE_REQ 5265 124.241 Master_0x69a574da LE 1M LE LL 9 44848µs 0 0 False 2 Control Opcode: LL_FEATURE_REQ 5266 124.285 Master_0x69a574da LE 1M LE LL 9 44849µs 0 0 False 3 Control Opcode: LL_FEATURE_REQ 5267 124.330 Master_0x69a574da LE 1M LE LL 9 44849µs 0 0 False 4 Control Opcode: LL_FEATURE_REQ 5268 124.375 Master_0x69a574da LE 1M LE LL 9 44848µs 0 0 False 5 Control Opcode: LL_FEATURE_REQ 5269 144.099 ff:1c:eb:33:1d:d8 LE 1M LE LL 23 19723913µs 0 ADV_IND 5270 144.100 5b:64:ce:90:3b:10 LE 1M LE LL 34 150µs 0 CONNECT_IND 5271 144.130 Master_0xbdd8eb46 LE 1M LE LL 9 30421µs 0 0 False 0 Control Opcode: LL_FEATURE_REQ 5272 144.176 Master_0xbdd8eb46 LE 1M LE LL 9 44849µs 0 0 False 1 Control Opcode: LL_FEATURE_REQ 5273 144.221 Master_0xbdd8eb46 LE 1M LE LL 9 44849µs 0 0 False 2 Control Opcode: LL_FEATURE_REQ 5274 144.266 Master_0xbdd8eb46 LE 1M LE LL 9 44848µs 0 0 False 3 Control Opcode: LL_FEATURE_REQ 5275 144.311 Master_0xbdd8eb46 LE 1M LE LL 9 44849µs 0 0 False 4 Control Opcode: LL_FEATURE_REQ 5276 144.355 Master_0xbdd8eb46 LE 1M LE LL 9 44849µs 0 0 False 5 Control Opcode: LL_FEATURE_REQ
To me, there is nothing obvious here. The only error code I got was in the nRF Connect app, the aforementioned Error 133 / 0x85.
I did find some hints that the address might change when connecting to DFU and that confuses the nRF Connect on Android somehow. But I could not find a good explanation which confirms that this is indeed the problem and furthermore, I also could not find a solution for that which works.
After searching the forums and looking at many threads with no answers or solutions, I want to ask for help directly. The lack of error information is making this a really hard problem to troubleshoot. Does anyone know hot to prevent the immediate disconnect?
Thanks!