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 fails with "Cannot read property 'instanceId' of undefined"

running DFU example from <SDK 15.3>\examples\dfu\secure_dfu_test_images\ble\nrf52840, and attempting a DFU update of:

sd_s140_bootloader_buttonless_with_setting_page_dfu_secure_ble_debug_without_bonds.hex

to

hrs_application_s140.zip.

The DFU is performed on the nRF52840 DK, using this procedure:

  1. I burn the .hex image via the J-Link drive on a Windows PC, by copying it there.
  2. I connect to the device via nRF-Connect on the Windows PC, and start the DFU process, selecting the .zip image.

Mostly, the DFU is successful, and Nordic_HRM becomes the device' name.

Sometimes, the DFU fails with "Cannot read property 'instanceId' of undefined".

I have the failure logs, of both the RTT log of the device 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# SEGGER J-Link RTT Viewer V6.44f Terminal Log File
# Compiled: 17:18:21 on Apr 12 2019
# Logging started @ 17 Apr 2019 15:14:31
<00> info> app: Inside main
00>
<00> debug> app: In nrf_bootloader_init
00>
<00> debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
00>
<00> debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
00>
<00> debug> nrf_dfu_settings: Using settings page.
00>
<00> debug> nrf_dfu_settings: Copying forbidden parts from backup page.
00>
<00> debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
00>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

and the nRF Connect log:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2019-04-17T12:22:50.770Z DEBUG 10061/ 0 <- [02 32 00 00 00 0a 01 10 00 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:7 payload_length:b data_integrity:1 header_checksum:4a err_code:0
2019-04-17T12:22:50.770Z DEBUG 10063 -> []
type: ACK reliable: no seq#:0 ack#:1 payload_length:0 data_integrity:0 err_code:0
2019-04-17T12:22:50.770Z DEBUG GATTC_EVT_CHAR_DISC_RSP time:2019-04-17T12:22:50.771Z connHandle:0 gattStatus:266 gattStatusName:atterrAttributeNotFound errorHandle:16 count:0 chars:[]
2019-04-17T12:22:50.771Z DEBUG 10064 -> [00 97 00 00 01 11 00 ff ff ]
type: VENDOR_SPECIFIC reliable:yes seq#:7 ack#:1 payload_length:9 data_integrity:1 header_checksum:93 err_code:0
2019-04-17T12:22:50.774Z DEBUG 10062/ 0 <- []
type: ACK reliable: no seq#:0 ack#:0 payload_length:0 data_integrity:0 err_code:0
2019-04-17T12:22:50.774Z DEBUG 10063/ 0 <- [01 97 00 00 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:1 ack#:0 payload_length:6 data_integrity:1 header_checksum:d1 err_code:0
2019-04-17T12:22:50.774Z DEBUG 10065 -> []
type: ACK reliable: no seq#:0 ack#:2 payload_length:0 data_integrity:0 err_code:0
2019-04-17T12:22:50.972Z DEBUG 10064/ 0 <- [02 33 00 00 00 00 00 00 00 01 00 11 00 02 29 01 ]
type: VENDOR_SPECIFIC reliable:yes seq#:2 ack#:0 payload_length:10 data_integrity:1 header_checksum:2f err_code:0
2019-04-17T12:22:50.972Z DEBUG 10066 -> []
type: ACK reliable: no seq#:0 ack#:3 payload_length:0 data_integrity:0 err_code:0
2019-04-17T12:22:50.972Z DEBUG GATTC_EVT_DESC_DISC_RSP time:2019-04-17T12:22:50.972Z connHandle:0 gattStatus:0 gattStatusName:success errorHandle:0 count:1 descs:[[handle:17,uuid:[uuid:10498 type:1 typeString:bleUuidTypeBle]]]
2019-04-17T12:22:50.973Z DEBUG 10067 -> [00 97 00 00 01 12 00 ff ff ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:3 payload_length:9 data_integrity:1 header_checksum:8a err_code:0
2019-04-17T12:22:50.976Z DEBUG 10065/ 0 <- []
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After such a failure message, I can try to the DFU again, and sometimes it will succeed.