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

Serial DFU Flash erase stuck

Hi,

Once in a while, the Serial DFU stuck in flash erase. Did I do something wrong?

Background: Currently I am unable to put breakpoint in the Bootloader component that I imported from SDK 15.3.0, but it's a separate issue that I posted in a separate post. So, I can only do black-box debugging with debug messages for now.

Please find the log from RTT channel below:

00> <debug> app: ***** Bootloader application Initialized *****
00> 
00> <debug> app: ENTER DFU FRAME Received
00> 
00> <debug> app: ***** ENTER DFU MODE *****
00> 
00> <debug> app: Enter DFU Ack
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> <warning> nrf_dfu_settings: Resetting bootloader settings since neither the settings page nor the backup are valid (CRC error).
00> 
00> <debug> nrf_dfu_settings: Writing settings...
00> 
00> <debug> nrf_dfu_settings: Erasing old settings at: 0x000EF000
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000EF000, len=1 pages), queue usage: 0
00> 
00> <debug> nrf_dfu_flash: Flash erase success: addr=0x000EF000, pending 0
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000EF000, src=0x20000918, len=896 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000EF000, pending 0
00> 
00> <info> nrf_dfu_settings: Backing up settings page to address 0xEE000.
00> 
00> <debug> nrf_dfu_settings: Writing settings...
00> 
00> <debug> nrf_dfu_settings: Erasing old settings at: 0x000EE000
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000EE000, len=1 pages), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash erase success: addr=0x000EE000, pending 0
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000EE000, src=0x20000C98, len=896 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000EE000, pending 0
00> 
00> <debug> app: Enter nrf_bootloader_fw_activate
00> 
00> <info> app: No firmware to activate.
00> 
00> <info> app: Boot validation failed. No valid app to boot.
00> 
00> <debug> app: DFU mode because app is not valid.
00> 
00> <info> nrf_bootloader_wdt: WDT is not enabled
00> 
00> <debug> app: in weak nrf_dfu_init_user
00> 
00> <debug> app: timer_stop (0x20000014)
00> 
00> <debug> app: timer_activate (0x20000014)
00> 
00> <info> app: Entering DFU mode.
00> 
00> <debug> app: Initializing transports (found: 1)
00> 
00> <debug> nrf_dfu_serial_uart: serial_dfu_transport_init()
00> 
00> <debug> nrf_dfu_serial_uart: serial_dfu_transport_init() completed
00> 
00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
00> 
00> <debug> app: Enter main loop
00> 
00> <debug> nrf_dfu_serial: Received ping 1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_PING
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x9, 0x1]
00> 
00> <debug> nrf_dfu_serial: Set receipt notif target: 0
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_RECEIPT_NOTIF_SET
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x2, 0x1]
00> 
00> <debug> nrf_dfu_serial: Received serial mtu
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_MTU_GET
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x7, 0x1]
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (command)
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x6, 0x1]
00> 
00> <debug> app: Shutting down transports (found: 1)
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
00> 
00> <debug> app: timer_stop (0x20000014)
00> 
00> <debug> app: timer_activate (0x20000014)
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x1, 0x1]
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x3, 0x1]
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
00> 
00> <debug> nrf_dfu_validation: PB: Init packet data len: 64
00> 
00> <info> nrf_dfu_validation: Signature required. Checking signature.
00> 
00> <info> nrf_dfu_validation: Calculating hash (len: 64)
00> 
00> <info> nrf_dfu_validation: Verify signature
00> 
00> <info> nrf_dfu_validation: Image verified
00> 
00> <debug> app: Enter nrf_dfu_cache_prepare()
00> 
00> <debug> app: required_size: 0x37790.
00> 
00> <debug> app: single_bank: false.
00> 
00> <debug> app: keep_app: false.
00> 
00> <debug> app: keep_softdevice: true.
00> 
00> <debug> app: SD_PRESENT: false.
00> 
00> <debug> app: Bank contents:
00> 
00> <debug> app: Bank 0 code: 0x00: Size: 0x0
00> 
00> <debug> app: Bank 1 code: 0x00: Size: 0x0
00> 
00> <debug> app: pass: 0.
00> 
00> <debug> app: cache_address: 0x1000.
00> 
00> <debug> app: cache_too_small: false.
00> 
00> <debug> app: keep_firmware: false.
00> 
00> <debug> app: delete_more: false.
00> 
00> <debug> nrf_dfu_validation: Write address set to 0x00001000
00> 
00> <debug> nrf_dfu_settings: Writing settings...
00> 
00> <debug> nrf_dfu_settings: Erasing old settings at: 0x000EF000
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000EF000, len=1 pages), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash erase success: addr=0x000EF000, pending 0
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000EF000, src=0x20000918, len=896 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000EF000, pending 0
00> 
00> <info> nrf_dfu_settings: Backing up settings page to address 0xEE000.
00> 
00> <debug> nrf_dfu_settings: Writing settings...
00> 
00> <debug> nrf_dfu_settings: Erasing old settings at: 0x000EE000
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000EE000, len=1 pages), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash erase success: addr=0x000EE000, pending 0
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000EE000, src=0x20000C98, len=896 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000EE000, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Writing valid init command to flash.
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x4, 0x1]
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (data)
00> 
00> <debug> nrf_dfu_req_handler: crc = 0x0, offset = 0x0, max_size = 0x1000
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x6, 0x1]
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x00001000, len=1 pages), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash erase success: addr=0x00001000, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Creating object with size: 4096. Offset: 0x00000000, CRC: 0x00000000
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x1, 0x1]
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001000, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001000, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001040, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001040, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001080, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001080, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000010C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000010C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001100, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001100, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001140, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001140, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001180, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001180, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000011C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000011C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001200, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001200, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001240, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001240, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001280, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001280, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000012C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000012C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001300, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001300, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001340, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001340, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001380, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001380, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000013C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000013C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001400, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001400, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001440, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001440, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001480, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001480, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000014C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000014C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001500, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001500, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001540, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001540, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001580, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001580, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000015C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000015C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001600, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001600, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001640, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001640, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001680, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001680, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000016C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000016C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001700, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001700, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001740, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001740, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001780, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001780, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000017C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000017C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001800, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001800, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001840, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001840, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001880, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001880, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000018C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000018C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001900, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001900, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001940, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001940, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001980, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001980, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000019C0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x000019C0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001A00, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001A00, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001A40, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001A40, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001A80, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001A80, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001AC0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001AC0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001B00, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001B00, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001B40, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001B40, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001B80, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001B80, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001BC0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001BC0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001C00, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001C00, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001C40, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001C40, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001C80, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001C80, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001CC0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001CC0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001D00, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001D00, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001D40, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001D40, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001D80, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001D80, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001DC0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001DC0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001E00, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001E00, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001E40, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001E40, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001E80, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001E80, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001EC0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001EC0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001F00, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001F00, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001F40, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001F40, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 2000140C
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001F80, src=0x20001494, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001F80, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00001FC0, src=0x20001410, len=64 bytes), queue usage: 1
00> 
00> <debug> nrf_dfu_flash: Flash write success: addr=0x00001FC0, pending 0
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (data)
00> 
00> <debug> nrf_dfu_req_handler: Offset:4096, CRC:0x8CD0844C
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x3, 0x1]
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (data)
00> 
00> <debug> nrf_dfu_serial: Sending Response: [0x4, 0x1]
00> 
00> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
00> 
00> <debug> app: timer_stop (0x20000014)
00> 
00> <debug> app: timer_activate (0x20000014)
00> 
00> <info> nrf_dfu_serial_uart: Allocated buffer 20001490
00> 
00> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (data)
00> 
00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x00002000, len=1 pages), queue usage: 1
00> 

  • Hello,

    This is not a known issue, but I suspect it may have something to do with the integration or implementation of the bootloader since it doesn't fail consistently every time. As a start, please run 'nrfjprog --readregs' to get a CPU register readout when it's stuck and post the result here. Or look up the PC value to find out where in the program it gets stuck.

    Background: Currently I am unable to put breakpoint in the Bootloader component that I imported from SDK 15.3.0, but it's a separate issue that I posted in a separate post. So, I can only do black-box debugging with debug messages for now.

     This is often a sign of missing debug symbols in the output executable (*.elf, *.out,..). Which IDE/toolchain are you using to build the bootloader?

  • Hi Vidar, the IDE/toolchain that I used is Keil uVision.

    Btw, a side note, I put the Bootloader at address 0xD6000, and I have MBR.

    I noticed that some registers are different, comparing the values I got from nrfjprog and from Keil IDE. I run it via J-Link. Or perhaps do I need to run it without J-Link?

    Please find below is the CPU register readout, as well as the screenshot from:

    R0:   0x00000000
    R1:   0x20002774
    R2:   0x00000040
    R3:   0x0000B635
    R4:   0x200257D4
    R5:   0x00000040
    R6:   0x0000006E
    R7:   0x00000000
    R8:   0x20002774
    R9:   0x00000000
    R10:  0x200257D4
    R11:  0x00000000
    R12:  0x00000000
    SP:   0x20025670
    LR:   0xFFFFFFE9
    PC:   0x000003CE
    xPSR: 0x61000003
    MSP:  0x20025670
    PSP:  0x00000000

    A separate update, regarding setting the breakpoints on Bootloader components from SDK, I added the reference to the libraries, I can put breakpoint but only before I start debugging. It seems to hit them, but they're not visible (no red dot - only yellow arrow). Please see the screenshot below from Keil uVision:

  • Hi,

    Thanks for the updates. The first register readout shows the program being in the Hardfault interrupt context somewhere inside the MBR. So something is causing a fault exception to occur during DFU. Although I'm a bit surprised to see that the program counter (PC) is inside the MBRs memory range as all interrupts shall be forwarded to the bootlaoder. Maybe the device has gone into a boot loop, and the program just happened to be inside the MBR when you ran --readregs? Or does the device seem to recover if you perform a reset after getting stuck?

    I'm also wondering if you have defined your own Hardfault handler in your bootloader? The weakly declared hardfault in arm_startup_nrf52840.s will make the program hang until it's reset. Either way, it can be very helpful to use the SDK's HardFault handling library to find out what triggered the exception.

    As for the second readout from Keil, it appears to be taken while the CPU executes code from the main application. It's not inside any interrupt context either. Could it be that it's different because Keil, by default, re-loads the app image resets the target when attaching the debugger?

    A separate update, regarding setting the breakpoints on Bootloader components from SDK, I added the reference to the libraries, I can put breakpoint but only before I start debugging. It seems to hit them, but they're not visible (no red dot - only yellow arrow). Please see the screenshot below from Keil uVision:

    Does the main project enable debug information for the output file as shown below? This is one thing that could explain why you're unable to place breakpoints.

    The bootloader is usually built using the project files provided by the SDK. So just for my understanding, and please correct me if I'm wrong, but it sounds like in your case that the bootloader components are being pre-compiled into a library and then imported to another existing Keil project?

  • Hi Vidar,

    Maybe the device has gone into a boot loop, and the program just happened to be inside the MBR when you ran --readregs? Or does the device seem to recover if you perform a reset after getting stuck?

    I am not quite sure regarding the difference. Btw, I run it using the debugger, on both register readouts. I captured the screenshot first actually, from Keil IDE. And then I used nrfjprog.

    I'm also wondering if you have defined your own Hardfault handler in your bootloader? The weakly declared hardfault in arm_startup_nrf52840.s will make the program hang until it's reset. Either way, it can be very helpful to use the SDK's HardFault handling library to find out what triggered the exception.

    Thanks for your suggestion, I added HardFault library, now I saw it stopped at the Bootloader, not in MBR anymore. Please see the register readout below:

    R0:   0x00008DF4
    R1:   0x40002000
    R2:   0x00000008
    R3:   0x2000A85A
    R4:   0x00000001
    R5:   0x000003E8
    R6:   0x0000FA00
    R7:   0x000E3FF1
    R8:   0x00000000
    R9:   0x00000000
    R10:  0x000E4D5C
    R11:  0x00000000
    R12:  0x80000000
    SP:   0x2002B7E0
    LR:   0x000DC3EF
    PC:   0x000E3FF0
    xPSR: 0x21000000
    MSP:  0x2002B7E0
    PSP:  0x00000000

    Does the main project enable debug information for the output file as shown below? This is one thing that could explain why you're unable to place breakpoints

    Yes, I already checked that. Btw, I found that after merging the Keil uVision project (from the Bootloader example and mine), I can set breakpoints now. The other problem I have is, the error is different when I run it from debugger vs. freerun. I still need to rely on debug messages to find the root cause.

    So just for my understanding, and please correct me if I'm wrong, but it sounds like in your case that the bootloader components are being pre-compiled into a library and then imported to another existing Keil project?

    You are absolutely correct. I have a thin layer of application (handshaking) and then it calls the Bootloader SDK. SO, the Bootloader SDK is part of the project.

    Regarding pre-compiled, I don't think so. I inherited this project from another team member, and as far as I can tell, the make file includes the source code (*.c files) as well as the library path, and refer to those libraries as *.ext files. Does it mean it's pre-compiled? My understanding is if it's pre-compiled, then they will be in *.a files format. (I'm not super familiar with Nordic yet).

    Are you saying if it's pre-compiled, then I won't be able to set breakpoint?

    P.S.: The MBR I used is version 2.4.1. The SDK is 15.3.0.

  • Hi,

    Harry said:
    I am not quite sure regarding the difference. Btw, I run it using the debugger, on both register readouts. I captured the screenshot first actually, from Keil IDE. And then I used nrfjprog.

    There is no valid application to boot according to the RTT log, which is why I'm not expecting the CPU to execute code from the application region as the register readout shows. The registers must be read while the bootloader is stuck. Any unintentional reset before doing the readout will likely be enough to recover the device back into a normal state. Anyway, I think we can move on from this troubleshooting step now as you have managed to resolve the issue with the breakpoints.

    Harry said:
    Thanks for your suggestion, I added HardFault library, now I saw it stopped at the Bootloader, not in MBR anymore. Please see the register readout below:

    To be sure the correct hard fault handler is included, please make sure hardfault_handler_keil.c and hardfault_implementation.c are both included in the build and also enabled in sdk_config ( the handler should not appear greyed out in the Keil editor).  Once this is done you can place a breakpoint at the end of HardFault_c_handler() and see if you can replicate the problem where the bootloader gets stuck after a flash erase. I'm still suspecting it's a hard fault. I hope is that the HardFault_c_handler() will log more information about what's triggering the fault exception.

    Harry said:
    Are you saying if it's pre-compiled, then I won't be able to set breakpoint?

    I haven't tried it myself, but I think it should be possible. I guess one potential problem is that a pre-compile library may use different source paths, though it should be possible to edit those in Keil.

Related