I'm trying to update my NRF52832 running s332 v5.0.0 and a stock SDK14.0 bootloader to S332 v6.1.1 with an SDK 15.3 bootloader.
I am including the flags --sd-req and --sd-id with the value of 0xBA,0x9B
Unfortunately, the update is failing when copying the SD. sd_mbr_command with the command SD_MBR_COMMAND_COPY_SD is returning NRF_ERROR_INTERNAL (0x03). According to the documentation that "indicates that the contents of the memory blocks where not verified correctly after copying. "
What is going wrong here? My debug log is shown below (I'm just showing the last bits). The lines " 0> <debug> app: sd_mbr_command 0x0" are printing out the return of the sd_mbr_command function. It seems to crash during the second copy operation, then restart and continue from where it left off but the next copy operation returns the error.
0> <debug> app: Received calculate CRC
0> <info> dfq_req_handling: Before OP crc
0> <debug> app: Sending CRC: [0x60, 0x03, 0x01, 0:x0003379C, CRC:0x5DCE3DE3]
0> <debug> nrf_dfu_flash: Flash write success: addr=0x00060780, pending 0
0> <debug> app: Received execute object
0> <info> dfq_req_handling: Before OP execute
0> <info> dfq_req_handling: Valid Data Execute
0> <debug> nrf_dfu_settings: Writing settings...
0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 2
0> <info> dfq_req_handling: Doing postvalidate
0> <info> dfq_req_handling: Current bank is bank 0
0> <info> dfq_req_handling: Running SD version check ==============
0> <warning> dfq_req_handling: SD major version numbers mismatch. Current app will be invalidated.Current: 5. New: 6.
0> <info> dfq_req_handling: Successfully ran the postvalidation check!
0> <debug> nrf_dfu_settings: Writing settings...
0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 3
0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 4
0> <debug> app: Sending Response: [0x4, 0x1]
0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 3
0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 2
0> <debug> dfq_req_handling: Response sent.
0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 1
0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
0> <debug> nrf_dfu_flash: This operation had a callback, calling back to 0x0007B099.
0> <debug> dfq_req_handling: All flash operations have completed.
0> <debug> dfq_req_handling: Starting reset timer.
0> <debug> dfq_req_handling: Attempting to reset the device.
0> <debug> app: In nrf_dfu_transports_close
0> <debug> app: num transports: 1
0> <debug> app: Shutting down BLE transport.
0> <debug> app: Disconnecting.
0> <debug> app: BLE transport shut down.
0> <debug> app: After nrf_dfu_transports_init
0> <debug> dfq_req_handling: Reset.
0>
0>
0> NRF52 BLE Bootloader (SDK14)
0> Version: 1.7
0> Built: 15:27:51, May 28 2019
0> <debug> app: In nrf_bootloader_init
0> <debug> app: in weak nrf_dfu_init_user
0> <debug> app: In real nrf_dfu_init
0> <debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
0> <debug> app: Initializing the clock.
0> <debug> app: Enter nrf_dfu_continue
0> <debug> app: Valid SD + BL
0> <debug> app: Enter nrf_dfu_sd_bl_continue
0> <debug> app: Enter nrf_bootloader_dfu_sd_continue
0> <debug> app: Updating SD. Old SD ver: 50, New ver: 60
0> <debug> app: Copying [0x0002D000-0x00039000] to [0x00001000-0x0000D000]: Len: 0x0000C000
0> <debug> app: sd_mbr_command 0x0
0> <debug> app: Finished copying [0x0002D000-0x00039000] to [0x00001000-0x0000D000]: Len: 0x0000C000
0> <debug> app: Validated 0x0002D000-0x00039000 to 0x00001000-0x0000D000: Size: 0x0000C000
0> <debug> app: Finished with the SD update.
0> <debug> nrf_dfu_settings: Writing settings...
0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 0
0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 1
0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
0> <debug> app: Copying [0x00039000-0x00045000] to [0x0000D000-0x00019000]: Len: 0x0000C000
0>
0>
0> NRF52 BLE Bootloader (SDK14)
0> Version: 1.7
0> Built: 15:27:51, May 28 2019
0> <debug> app: In nrf_bootloader_init
0> <debug> app: in weak nrf_dfu_init_user
0> <debug> app: In real nrf_dfu_init
0> <debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
0> <debug> app: Initializing the clock.
0> <debug> app: Enter nrf_dfu_continue
0> <debug> app: Valid SD + BL
0> <debug> app: Enter nrf_dfu_sd_bl_continue
0> <debug> app: Enter nrf_bootloader_dfu_sd_continue
0> <debug> app: Copying [0x0003BB34-0x00044B34] to [0x0000CB34-0x00015B34]: Len: 0x00009000
0> <debug> app: sd_mbr_command 0x3
0> <error> app: Failed to copy SD: target: 0x0000CB34, src: 0x0003BB34, len: 0x00009000
0> <error> app: SD+BL: SD copy failed
0> <debug> app: Could not continue DFU operation: 0x00000003
0> <debug> app: In nrf_dfu_transports_init
0> <debug> app: num transports: 1
0> <debug> app: Initializing BLE DFU transport
0> Hard fault