Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to flash SAM chip with bootloader #507

Open
henrikssn opened this issue Dec 23, 2020 · 27 comments
Open

Unable to flash SAM chip with bootloader #507

henrikssn opened this issue Dec 23, 2020 · 27 comments

Comments

@henrikssn
Copy link
Contributor

henrikssn commented Dec 23, 2020

Describe the bug
When trying to flash a Feather M0 (SAMD21G18AU) with 8K bootloader, the command fails (see log output below).

To Reproduce
Steps to reproduce the behavior:

  1. cargo generate --git https://github.com/rust-embedded/cortex-m-quickstart
  2. Edit memory.x to make space for bootloader:
MEMORY
{
  FLASH : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K
  RAM : ORIGIN = 0x20000000, LENGTH = 32K
}
  1. Edit .cargo/config:
[build]
target = "thumbv6m-none-eabi" 
  1. Run cargo flash --chip atsamd21g18au

Expected behavior
The program is flashed to the MCU.

Stacktrace

DEBUG probe_rs_cli_util > Running '/home/erik/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo' in directory /code/bug-reproduce-samd-bootprot
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
    Flashing /code/bug-reproduce-samd-bootprot/target/thumbv6m-none-eabi/debug/bug-reproduce-samd-bootprot
       DEBUG jaylink           > libusb 1.0.22.11312
       DEBUG jaylink           > libusb has capability API: true
       DEBUG jaylink           > libusb has HID access: true
       DEBUG jaylink           > libusb has hotplug support: true
       DEBUG jaylink           > libusb can detach kernel driver: true
       DEBUG jaylink           > open_usb: device descriptor: DeviceDescriptor {
    bLength: 0x12,
    bDescriptorType: 0x1,
    bcdUSB: 0x200,
    bDeviceClass: 0x0,
    bDeviceSubClass: 0x0,
    bDeviceProtocol: 0x0,
    bMaxPacketSize: 0x40,
    idVendor: 0x1366,
    idProduct: 0x101,
    bcdDevice: 0x100,
    iManufacturer: 0x1,
    iProduct: 0x2,
    iSerialNumber: 0x3,
    bNumConfigurations: 0x1,
}
       DEBUG jaylink           > scanning 1 interfaces
       DEBUG jaylink           > J-Link interface is #0
       DEBUG probe_rs::probe::daplink::tools > Device Bus 002 Device 001: ID 1d6b:0003
       DEBUG probe_rs::probe::daplink::tools > Device open error Access
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 005: ID 1366:0101
       DEBUG probe_rs::probe::daplink::tools > No device matches
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 007: ID 0483:3748
       DEBUG probe_rs::probe::daplink::tools > No device matches
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 006: ID 0403:6001
       DEBUG probe_rs::probe::daplink::tools > No device matches
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 002: ID 8087:0a2b
       DEBUG probe_rs::probe::daplink::tools > Device open error Access
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 001: ID 1d6b:0002
       DEBUG probe_rs::probe::daplink::tools > Device open error Access
       DEBUG probe_rs::probe::daplink::tools > Attempting to open 1366:0101 in CMSIS-DAP v1 mode
       DEBUG probe_rs::probe::stlink::usb_interface > Acquired libusb context.
       DEBUG jaylink                                > open_usb: device descriptor: DeviceDescriptor {
    bLength: 0x12,
    bDescriptorType: 0x1,
    bcdUSB: 0x200,
    bDeviceClass: 0x0,
    bDeviceSubClass: 0x0,
    bDeviceProtocol: 0x0,
    bMaxPacketSize: 0x40,
    idVendor: 0x1366,
    idProduct: 0x101,
    bcdDevice: 0x100,
    iManufacturer: 0x1,
    iProduct: 0x2,
    iSerialNumber: 0x3,
    bNumConfigurations: 0x1,
}
       DEBUG jaylink                                > scanning 1 interfaces
       DEBUG jaylink                                > J-Link interface is #0
       DEBUG jaylink                                > legacy caps: GET_HW_VERSION | READ_CONFIG | WRITE_CONFIG | SPEED_INFO | GET_MAX_BLOCK_SIZE | GET_HW_INFO | RESET_STOP_TIMED | SELECT_IF | GET_COUNTERS | GET_CPU_CAPS | EXEC_CPU_CMD | SWO | REGISTER | INDICATORS | TEST_NET_SPEED | GET_CAPS_EX
       DEBUG jaylink                                > extended caps: GET_HW_VERSION | READ_CONFIG | WRITE_CONFIG | SPEED_INFO | GET_MAX_BLOCK_SIZE | GET_HW_INFO | RESET_STOP_TIMED | SELECT_IF | GET_COUNTERS | GET_CPU_CAPS | EXEC_CPU_CMD | SWO | REGISTER | INDICATORS | TEST_NET_SPEED | GET_CAPS_EX
        INFO cargo_flash                            > Protocol speed 0 kHz
       DEBUG probe_rs::probe::jlink                 > Attaching to J-Link
       DEBUG probe_rs::probe::jlink                 > Attaching with protocol 'SWD'
        INFO probe_rs::probe::jlink                 > J-Link: S/N: 801020640
       DEBUG probe_rs::probe::jlink                 > J-Link: Capabilities: GET_HW_VERSION | READ_CONFIG | WRITE_CONFIG | SPEED_INFO | GET_MAX_BLOCK_SIZE | GET_HW_INFO | RESET_STOP_TIMED | SELECT_IF | GET_COUNTERS | GET_CPU_CAPS | EXEC_CPU_CMD | SWO | REGISTER | INDICATORS | TEST_NET_SPEED | GET_CAPS_EX
        INFO probe_rs::probe::jlink                 > J-Link: Firmware version: J-Link EDU Mini V1 compiled Jul 17 2020 16:25:21
        INFO probe_rs::probe::jlink                 > J-Link: Hardware version: JLink 1.0.0
        INFO probe_rs::probe::jlink                 > J-Link: Target voltage: 3.30 V
       DEBUG probe_rs::probe::jlink                 > Sucessfully switched to SWD
       DEBUG probe_rs::probe::jlink                 > Attached succesfully
       DEBUG probe_rs::config::registry             > Searching registry for chip with name atsamd21g18au
       DEBUG probe_rs::architecture::arm::communication_interface > Debug Port version: DPv1
       DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register DPIDR
       DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register DPIDR, value=0x0bc11477
       DEBUG probe_rs::architecture::arm::communication_interface > DebugPort ID:  DebugPortId {
    revision: 0x0,
    part_no: 0xbc,
    version: DPv1,
    min_dp_support: Implemented,
    designer: JEP106Code({ cc: 0x04, id: 0x3b } => Some("ARM Ltd")),
}
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register ABORT, value=0x0000001e
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Requesting debug power
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register CTRL/STAT, value=0x50000000
       DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register CTRL/STAT
       DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register CTRL/STAT, value=0xf0000040
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register IDR
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 0, AP_BANK_SEL to 15
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0x000000f0
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    IDR, value=0x04770031
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register IDR
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 1, AP_BANK_SEL to 15
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0x010000f0
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    IDR, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register CTRL/STAT
       DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register CTRL/STAT, value=0xf0000040
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register IDR
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 0, AP_BANK_SEL to 15
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0x000000f0
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    IDR, value=0x04770031
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register BASE
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    BASE, value=0x41003003
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register BASE2
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    BASE2, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000010
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 0, AP_BANK_SEL to 0
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register CSW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    CSW, value=0x03000050
       DEBUG probe_rs::architecture::arm::communication_interface > AP 0: MemoryAp { port_number: 0, only_32bit_data_size: false, debug_base_address: 1090531328 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000ED30
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x0000001F
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0xA05F0001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE0002000
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x00000040
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE0002008
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000200C
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE0002010
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE0002014
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::flashing::download                         > Found loadable segment.
       DEBUG probe_rs::flashing::download                         > Found loadable segment.
       DEBUG probe_rs::flashing::download                         > Found loadable segment.
        INFO probe_rs::flashing::download                         > Found 3 loadable sections:
        INFO probe_rs::flashing::download                         >     .vector_table at 00002000 (192 byte0)
        INFO probe_rs::flashing::download                         >     .text at 000020C0 (960 byte0)
        INFO probe_rs::flashing::download                         >     .rodata at 00002480 (376 byte0)
       DEBUG probe_rs::flashing::loader                           > Using builder for region (0x00000000..0x00040000)
       DEBUG probe_rs::flashing::loader                           > Algorithm atsamd21_256 - start: 0x000000 - size: 0x040000
       DEBUG probe_rs::flashing::loader                           > Algorithms: [RawFlashAlgorithm { name: "atsamd21_256", description: "atsamd21 256kb flash", default: true, instructions: [65, 33, 9, 6, 10, 104, 82, 7, 1, 213, 4, 34, 10, 96, 45, 74, 43, 73, 81, 96, 44, 73, 73, 68, 8, 96, 0, 32, 112, 71, 0, 32, 112, 71, 15, 33, 137, 3, 1, 64, 66, 8, 15, 32, 64, 3, 2, 64, 16, 181, 36, 72, 194, 97, 37, 74, 2, 128, 2, 125, 210, 7, 252, 208, 34, 76, 1, 34, 63, 60, 146, 3, 139, 24, 12, 224, 74, 8, 194, 97, 4, 128, 2, 125, 210, 7, 252, 208, 2, 125, 146, 7, 1, 213, 1, 32, 16, 189, 255, 49, 1, 49, 153, 66, 240, 211, 0, 32, 16, 189, 240, 181, 201, 28, 137, 8, 21, 75, 137, 0, 18, 77, 219, 28, 43, 128, 43, 125, 219, 7, 252, 208, 17, 78, 61, 62, 0, 41, 22, 208, 3, 70, 64, 41, 1, 217, 64, 36, 5, 224, 12, 70, 3, 224, 128, 202, 9, 31, 128, 195, 36, 31, 0, 44, 249, 209, 46, 128, 64, 48, 43, 125, 219, 7, 252, 208, 43, 125, 155, 7, 232, 213, 1, 32, 240, 189, 0, 32, 240, 189, 0, 0, 158, 0, 4, 0, 0, 64, 0, 65, 4, 0, 0, 0, 65, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], pc_init: Some(1), pc_uninit: Some(31), pc_program_page: 111, pc_erase_sector: 35, pc_erase_all: None, data_section_offset: 208, flash_properties: FlashProperties { address_range: 0..262144, page_size: 1024, erased_byte_value: 255, program_page_timeout: 100, erase_sector_timeout: 1000, sectors: [SectorDescription { size: 16384, address: 0 }] } }]
       DEBUG probe_rs::flashing::flasher                          > Full Chip Erase enabled: false
       DEBUG probe_rs::flashing::flasher                          > Double Buffering enabled: false
       DEBUG probe_rs::flashing::flasher                          > Initializing the flash algorithm.
       DEBUG probe_rs::flashing::flasher                          > Halting core.
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0xA05F0003
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x02000001
     Erasing sectors ✔ [00:00:00] [------------------------------------------------------------------------]       0B/ 16.00KB @       0B/s (eta 0s )
 Programming pages   ✔ [00:00:00] [------------------------------------------------------------------------]       0B/  2.00KB @       0B/s (eta 0s )
       Error failed to flash /code/bug-reproduce-samd-bootprot/target/thumbv6m-none-eabi/debug/bug-reproduce-samd-bootprot

Caused by:
    0: Error while flashing
    1: Something during the interaction with the core went wrong
    2: An error with the usage of the probe occured
    3: Operation timed out

Desktop (please complete the following information):

  • Linux (Debian Buster)

Additional context

  • The board has a 8K bootloader which I am trying to preserve.
  • The first flash pages are protected by BOOTPROT.
  • Flashing the board directly with JFlash starting at address 0x2000 works fine, so does bossac.
  • I am trying to use probe-rs instead of the bootloader due to the RTT integration, but would like to keep the option of later flashing with bootloader.
@henrikssn henrikssn added the bug label Dec 23, 2020
@Yatekii
Copy link
Member

Yatekii commented Dec 23, 2020

Ohhh I think I know what's the issue! Could you try and pass --nmagic to the linker?

@henrikssn
Copy link
Contributor Author

--nmagic was already set. As suggested in the Matrix room I added the --connect-under-reset flag to cargo flash which gave the following error message:

$ cargo flash --chip atsamd21g18au --log debug
       DEBUG probe_rs_cli_util > Running '/home/erik/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo' in directory /code/bug-reproduce-samd-bootprot
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
    Flashing /code/bug-reproduce-samd-bootprot/target/thumbv6m-none-eabi/debug/bug-reproduce-samd-bootprot
       DEBUG jaylink           > libusb 1.0.22.11312
       DEBUG jaylink           > libusb has capability API: true
       DEBUG jaylink           > libusb has HID access: true
       DEBUG jaylink           > libusb has hotplug support: true
       DEBUG jaylink           > libusb can detach kernel driver: true
       DEBUG jaylink           > open_usb: device descriptor: DeviceDescriptor {
    bLength: 0x12,
    bDescriptorType: 0x1,
    bcdUSB: 0x200,
    bDeviceClass: 0x0,
    bDeviceSubClass: 0x0,
    bDeviceProtocol: 0x0,
    bMaxPacketSize: 0x40,
    idVendor: 0x1366,
    idProduct: 0x101,
    bcdDevice: 0x100,
    iManufacturer: 0x1,
    iProduct: 0x2,
    iSerialNumber: 0x3,
    bNumConfigurations: 0x1,
}
       DEBUG jaylink           > scanning 1 interfaces
       DEBUG jaylink           > J-Link interface is #0
       DEBUG probe_rs::probe::daplink::tools > Device Bus 002 Device 001: ID 1d6b:0003
       DEBUG probe_rs::probe::daplink::tools > Device open error Access
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 011: ID 1366:0101
       DEBUG probe_rs::probe::daplink::tools > No device matches
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 007: ID 0483:3748
       DEBUG probe_rs::probe::daplink::tools > No device matches
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 010: ID 0403:6001
       DEBUG probe_rs::probe::daplink::tools > No device matches
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 002: ID 8087:0a2b
       DEBUG probe_rs::probe::daplink::tools > Device open error Access
       DEBUG probe_rs::probe::daplink::tools > Device Bus 001 Device 001: ID 1d6b:0002
       DEBUG probe_rs::probe::daplink::tools > Device open error Access
       DEBUG probe_rs::probe::daplink::tools > Attempting to open 1366:0101 in CMSIS-DAP v1 mode
       DEBUG probe_rs::probe::stlink::usb_interface > Acquired libusb context.
       DEBUG jaylink                                > open_usb: device descriptor: DeviceDescriptor {
    bLength: 0x12,
    bDescriptorType: 0x1,
    bcdUSB: 0x200,
    bDeviceClass: 0x0,
    bDeviceSubClass: 0x0,
    bDeviceProtocol: 0x0,
    bMaxPacketSize: 0x40,
    idVendor: 0x1366,
    idProduct: 0x101,
    bcdDevice: 0x100,
    iManufacturer: 0x1,
    iProduct: 0x2,
    iSerialNumber: 0x3,
    bNumConfigurations: 0x1,
}
       DEBUG jaylink                                > scanning 1 interfaces
       DEBUG jaylink                                > J-Link interface is #0
       DEBUG jaylink                                > legacy caps: GET_HW_VERSION | READ_CONFIG | WRITE_CONFIG | SPEED_INFO | GET_MAX_BLOCK_SIZE | GET_HW_INFO | RESET_STOP_TIMED | SELECT_IF | GET_COUNTERS | GET_CPU_CAPS | EXEC_CPU_CMD | SWO | REGISTER | INDICATORS | TEST_NET_SPEED | GET_CAPS_EX
       DEBUG jaylink                                > extended caps: GET_HW_VERSION | READ_CONFIG | WRITE_CONFIG | SPEED_INFO | GET_MAX_BLOCK_SIZE | GET_HW_INFO | RESET_STOP_TIMED | SELECT_IF | GET_COUNTERS | GET_CPU_CAPS | EXEC_CPU_CMD | SWO | REGISTER | INDICATORS | TEST_NET_SPEED | GET_CAPS_EX
        INFO cargo_flash                            > Protocol speed 0 kHz
       DEBUG probe_rs::probe::jlink                 > Attaching to J-Link
       DEBUG probe_rs::probe::jlink                 > Attaching with protocol 'SWD'
        INFO probe_rs::probe::jlink                 > J-Link: S/N: 801020640
       DEBUG probe_rs::probe::jlink                 > J-Link: Capabilities: GET_HW_VERSION | READ_CONFIG | WRITE_CONFIG | SPEED_INFO | GET_MAX_BLOCK_SIZE | GET_HW_INFO | RESET_STOP_TIMED | SELECT_IF | GET_COUNTERS | GET_CPU_CAPS | EXEC_CPU_CMD | SWO | REGISTER | INDICATORS | TEST_NET_SPEED | GET_CAPS_EX
        INFO probe_rs::probe::jlink                 > J-Link: Firmware version: J-Link EDU Mini V1 compiled Jul 17 2020 16:25:21
        INFO probe_rs::probe::jlink                 > J-Link: Hardware version: JLink 1.0.0
        INFO probe_rs::probe::jlink                 > J-Link: Target voltage: 3.30 V
       DEBUG probe_rs::probe::jlink                 > Performing line reset!
       DEBUG probe_rs::probe::jlink                 > line reset ack: [true, false, false]
       DEBUG probe_rs::probe::jlink                 > Sucessfully switched to SWD
       DEBUG probe_rs::probe::jlink                 > Attached succesfully
       DEBUG probe_rs::config::registry             > Searching registry for chip with name atsamd21g18au
       DEBUG probe_rs::architecture::arm::communication_interface > Debug Port version: DPv1
       DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register DPIDR
       DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register DPIDR, value=0xDPIDR { .0: bc11477, revision: 0, part_no: bc, min: true, version: 1, designer: 23b, jep_cc: 4, jep_id: 3b }
       DEBUG probe_rs::architecture::arm::communication_interface > DebugPort ID:  DebugPortId {
    revision: 0x0,
    part_no: 0xbc,
    version: DPv1,
    min_dp_support: Implemented,
    designer: JEP106Code({ cc: 0x04, id: 0x3b } => Some("ARM Ltd")),
}
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register ABORT, value=0xAbort { .0: 1e }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0xSelect { .0: 0, ap_sel: 0, ap_bank_sel: 0, dp_bank_sel: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Requesting debug power
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register CTRL/STAT, value=0xCtrl { .0: 50000001, csyspwrupack: false, csyspwrupreq: true, cdbgpwrupack: false, cdbgpwrupreq: true, cdbgrstack: false, c_dbg_rst_req: false, trn_cnt: 0, mask_lane: 0, w_data_err: false, read_ok: false, sticky_err: false, stick_cmp: false, trn_mode: 0, sticky_orun: false, orun_detect: true }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register CTRL/STAT
       DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register CTRL/STAT, value=0xCtrl { .0: f0000041, csyspwrupack: true, csyspwrupreq: true, cdbgpwrupack: true, cdbgpwrupreq: true, cdbgrstack: false, c_dbg_rst_req: false, trn_cnt: 0, mask_lane: 0, w_data_err: false, read_ok: true, sticky_err: false, stick_cmp: false, trn_mode: 0, sticky_orun: false, orun_detect: true }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register IDR
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 0, AP_BANK_SEL to 15
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0xSelect { .0: f0, ap_sel: 0, ap_bank_sel: f, dp_bank_sel: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    IDR, value=0xIDR { REVISION: 0, DESIGNER: 23b, CLASS: MEMAP, _RES0: 0, VARIANT: 3, TYPE: AMBA_AHB3 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register IDR
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 1, AP_BANK_SEL to 15
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0xSelect { .0: 10000f0, ap_sel: 1, ap_bank_sel: f, dp_bank_sel: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    IDR, value=0xIDR { REVISION: 0, DESIGNER: 0, CLASS: Undefined, _RES0: 0, VARIANT: 0, TYPE: JTAG_COM_AP }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register IDR
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 0, AP_BANK_SEL to 15
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0xSelect { .0: f0, ap_sel: 0, ap_bank_sel: f, dp_bank_sel: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    IDR, value=0xIDR { REVISION: 0, DESIGNER: 23b, CLASS: MEMAP, _RES0: 0, VARIANT: 3, TYPE: AMBA_AHB3 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register BASE
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    BASE, value=0xBASE { BASEADDR: 41003, _RES0: 0, Format: ADIv5, present: true }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register BASE2
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    BASE2, value=0xBASE2 { BASEADDR: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 1, HNONSEC: 1, PROT: 6, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U8 }
       DEBUG probe_rs::architecture::arm::communication_interface > Changing AP to 0, AP_BANK_SEL to 0
       DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0xSelect { .0: 0, ap_sel: 0, ap_bank_sel: 0, dp_bank_sel: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register CSW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    CSW, value=0xCSW { DbgSwEnable: 0, HNONSEC: 0, PROT: 0, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 1, AddrInc: Single, _RES1: 0, SIZE: U8 }
       DEBUG probe_rs::architecture::arm::communication_interface > HNONSEC supported: false
       DEBUG probe_rs::architecture::arm::communication_interface > AP 0: MemoryAp(MemoryApInformation { port_number: 0, only_32bit_data_size: false, debug_base_address: 1090531328, supports_hnonsec: false })
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 30003 }
       DEBUG probe_rs::architecture::arm::core::m0                > Core was halted when connecting
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000ed30 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: b }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000ed30 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 1f }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: a05f0001 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e0002000 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 40 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e0002008 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000200c }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e0002010 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e0002014 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
        INFO probe_rs::flashing::download                         > Found loadable segment, address: 0x00002000
        INFO probe_rs::flashing::download                         > Matching section: ".vector_table"
        INFO probe_rs::flashing::download                         > Found loadable segment, address: 0x000020c0
        INFO probe_rs::flashing::download                         > Matching section: ".text"
        INFO probe_rs::flashing::download                         > Found loadable segment, address: 0x00002480
        INFO probe_rs::flashing::download                         > Matching section: ".rodata"
        INFO probe_rs::flashing::download                         > Found 3 loadable sections:
        INFO probe_rs::flashing::download                         >     .vector_table at 00002000 (192 byte0)
        INFO probe_rs::flashing::download                         >     .text at 000020C0 (960 byte0)
        INFO probe_rs::flashing::download                         >     .rodata at 00002480 (376 byte0)
       DEBUG probe_rs::flashing::loader                           > Using builder for region (0x00000000..0x00040000)
       DEBUG probe_rs::flashing::loader                           > Algorithm atsamd21_256 - start: 0x000000 - size: 0x040000
       DEBUG probe_rs::flashing::loader                           > Algorithms: [RawFlashAlgorithm { name: "atsamd21_256", description: "atsamd21 256kb flash", default: true, instructions: [65, 33, 9, 6, 10, 104, 82, 7, 1, 213, 4, 34, 10, 96, 45, 74, 43, 73, 81, 96, 44, 73, 73, 68, 8, 96, 0, 32, 112, 71, 0, 32, 112, 71, 15, 33, 137, 3, 1, 64, 66, 8, 15, 32, 64, 3, 2, 64, 16, 181, 36, 72, 194, 97, 37, 74, 2, 128, 2, 125, 210, 7, 252, 208, 34, 76, 1, 34, 63, 60, 146, 3, 139, 24, 12, 224, 74, 8, 194, 97, 4, 128, 2, 125, 210, 7, 252, 208, 2, 125, 146, 7, 1, 213, 1, 32, 16, 189, 255, 49, 1, 49, 153, 66, 240, 211, 0, 32, 16, 189, 240, 181, 201, 28, 137, 8, 21, 75, 137, 0, 18, 77, 219, 28, 43, 128, 43, 125, 219, 7, 252, 208, 17, 78, 61, 62, 0, 41, 22, 208, 3, 70, 64, 41, 1, 217, 64, 36, 5, 224, 12, 70, 3, 224, 128, 202, 9, 31, 128, 195, 36, 31, 0, 44, 249, 209, 46, 128, 64, 48, 43, 125, 219, 7, 252, 208, 43, 125, 155, 7, 232, 213, 1, 32, 240, 189, 0, 32, 240, 189, 0, 0, 158, 0, 4, 0, 0, 64, 0, 65, 4, 0, 0, 0, 65, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], pc_init: Some(1), pc_uninit: Some(31), pc_program_page: 111, pc_erase_sector: 35, pc_erase_all: None, data_section_offset: 208, flash_properties: FlashProperties { address_range: 0..262144, page_size: 1024, erased_byte_value: 255, program_page_timeout: 100, erase_sector_timeout: 1000, sectors: [SectorDescription { size: 16384, address: 0 }] } }]
       DEBUG probe_rs::flashing::flasher                          > Full Chip Erase enabled: false
       DEBUG probe_rs::flashing::flasher                          > Double Buffering enabled: false
       DEBUG probe_rs::flashing::flasher                          > Initializing the flash algorithm.
       DEBUG probe_rs::flashing::flasher                          > Halting core.
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: a05f0003 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: f }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 20000200 }
       DEBUG probe_rs::flashing::flasher                          > PC = 0x20000200
       DEBUG probe_rs::flashing::flasher                          > Reset and halt
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edfc }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edfc }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 1 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 30003 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000ed0c }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 5fa0004 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 3030003 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 10 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 1000000 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edfc }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 1 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edfc }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=DRW { data: f }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xDRW { data: 294 }
       DEBUG probe_rs::flashing::flasher                          > Loading algorithm into RAM at address 0x20000200
       DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Write block with total size 248 bytes to address 0x20000200
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: 20000200 }
       DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Write first block with len 248 at address 0x20000200
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, block with len=62 words
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Finished writing block
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: 20000200 }
       DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Read first block with len 248 at address 0x20000200
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW, block with len=62 words
       DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Finished reading block
       DEBUG probe_rs::flashing::flasher                                  > RAM contents match flashing algo blob.
       DEBUG probe_rs::flashing::flasher                                  > Preparing Flasher for region:
       DEBUG probe_rs::flashing::flasher                                  > NvmRegion {
    range: 0..262144,
    is_boot_memory: true,
}
       DEBUG probe_rs::flashing::flasher                                  > Double buffering enabled: false
       DEBUG probe_rs::flashing::flasher                                  > Running init routine.
       DEBUG probe_rs::flashing::flasher                                  > Calling routine 20000221(Some(0), Some(0), Some(1), None, init=true)
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 20000221 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 1000f }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: f }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 20000220 }
       DEBUG probe_rs::flashing::flasher                                  > content of PC 0xf: 0x20000220 should be: 0x20000221
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 10000 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 0 }
       DEBUG probe_rs::flashing::flasher                                  > content of a1 0x0: 0x00000000 should be: 0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 10001 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 1 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 0 }
       DEBUG probe_rs::flashing::flasher                                  > content of a2 0x1: 0x00000000 should be: 0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 1 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 10002 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 2 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1 }
       DEBUG probe_rs::flashing::flasher                                  > content of a3 0x2: 0x00000001 should be: 0x00000001
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 200002f0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 10009 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 9 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 200002f0 }
       DEBUG probe_rs::flashing::flasher                                  > content of R9 0x9: 0x200002f0 should be: 0x200002f0
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 20000200 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 1000d }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: d }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 20000200 }
       DEBUG probe_rs::flashing::flasher                                  > content of SP 0xd: 0x20000200 should be: 0x20000200
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 20000201 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 1000e }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: e }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 20000201 }
       DEBUG probe_rs::flashing::flasher                                  > content of LR 0xe: 0x20000201 should be: 0x20000201
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: a05f0001 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::flashing::flasher                                  > Waiting for routine call completion.
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 0 }
        INFO probe_rs::flashing::flasher                                  > Erasing sector at address 0x00000000
       DEBUG probe_rs::flashing::flasher                                  > Calling routine 20000243(Some(0), None, None, None, init=false)
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 20000243 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 1000f }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: f }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 20000242 }
       DEBUG probe_rs::flashing::flasher                                  > content of PC 0xf: 0x20000242 should be: 0x20000243
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 10000 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 0 }
       DEBUG probe_rs::flashing::flasher                                  > content of a1 0x0: 0x00000000 should be: 0x00000000
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 20000201 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 1000e }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: e }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 20000201 }
       DEBUG probe_rs::flashing::flasher                                  > content of LR 0xe: 0x20000201 should be: 0x20000201
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: a05f0001 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::flashing::flasher                                  > Waiting for routine call completion.
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf4 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, value=DRW { data: 0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf0 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1030003 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=CSW { DbgSwEnable: 0, HNONSEC: 1, PROT: 2, CACHE: 3, SPIDEN: 0, _RES0: 0, MTE: 0, Type: 0, Mode: 0, TrinProg: 0, DeviceEn: 0, AddrInc: Single, _RES1: 0, SIZE: U32 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=TAR { address: e000edf8 }
       DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW
       DEBUG probe_rs::architecture::arm::communication_interface         > Read register    DRW, value=0xDRW { data: 1 }
        INFO probe_rs::flashing::flasher                                  > Done erasing sector. Result is 1. This took 23.618991ms
     Erasing sectors ✔ [00:00:00] [------------------------------------------------------------------------]       0B/ 16.00KB @       0B/s (eta 0s )
 Programming pages   ✔ [00:00:00] [------------------------------------------------------------------------]       0B/  2.00KB @       0B/s (eta 0s )
       Error failed to flash /code/bug-reproduce-samd-bootprot/target/thumbv6m-none-eabi/debug/bug-reproduce-samd-bootprot

Caused by:
    0: Error while flashing
    1: The execution of 'erase_sector' failed with code 1. Perhaps your chip has write protected sectors that need to be cleared? Perhaps you need the --nmagic linker arg https://github.com/rust-embedded/cortex-m-quickstart/pull/95

@henrikssn
Copy link
Contributor Author

I cloned probe-rs and cargo-embed, and edited the SAM D.yaml flash properties to set sector size to 2K (IIUC, it should really be 256b but page size is already set to 1K).

New error message:

cargo flash --probe 1366:0101 --chip atsamd21g18au --log info
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
    Flashing /code/bug-reproduce-samd-bootprot/target/thumbv6m-none-eabi/debug/bug-reproduce-samd-bootprot
        INFO cargo_flash > Protocol speed 0 kHz
        INFO probe_rs::probe::jlink > J-Link: S/N: 801020640
        INFO probe_rs::probe::jlink > J-Link: Firmware version: J-Link EDU Mini V1 compiled Jul 17 2020 16:25:21
        INFO probe_rs::probe::jlink > J-Link: Hardware version: JLink 1.0.0
        INFO probe_rs::probe::jlink > J-Link: Target voltage: 3.30 V
        INFO probe_rs::flashing::download > Found loadable segment, address: 0x00002000
        INFO probe_rs::flashing::download > Matching section: ".vector_table"
        INFO probe_rs::flashing::download > Found loadable segment, address: 0x000020c0
        INFO probe_rs::flashing::download > Matching section: ".text"
        INFO probe_rs::flashing::download > Found loadable segment, address: 0x00002480
        INFO probe_rs::flashing::download > Matching section: ".rodata"
        INFO probe_rs::flashing::download > Found 3 loadable sections:
        INFO probe_rs::flashing::download >     .vector_table at 00002000 (192 byte0)
        INFO probe_rs::flashing::download >     .text at 000020C0 (960 byte0)
        INFO probe_rs::flashing::download >     .rodata at 00002480 (376 byte0)
     Erasing sectors ⠁ [00:00:00] [########################################################################]       0B/      0B @       0B/s (eta 0s )
       Error failed to flash /code/bug-reproduce-samd-bootprot/target/thumbv6m-none-eabi/debug/bug-reproduce-samd-bootprot

Caused by:
    0: Error while flashing
        INFO cargo_flash                  > Metadata {
    chip: Some(
        "Unspecified(\"atsamd21g18au\")",
    ),
    probe: None,
    speed: Some(
        "0",
    ),
    release: "0.10.2",
    commit: "b0a02d9-modified",
}
     Erasing sectors ⠁ [00:00:00] [########################################################################]       0B/      0B @       0B/s (eta 0s )

@LongLiveCHIEF
Copy link

I was reviewing @henrikssn 's updates via #542, and testing them against atsamd21g18au, and have come up with the following error:

Target /home/chief/code/led-backlighting-controller/target/thumbv6m-none-eabi/release/led-backlighting-controller
        WARN probe_rs::flashing::flasher > Chip erase was the selected method to erase the sectors but this chip does not support chip erases (yet).
        WARN probe_rs::flashing::flasher > A manual sector erase will be performed.
     Reading flash   ✔ [00:01:52] [###########################################################################################################################################]  21.35KB/ 21.35KB @     193B/s (eta 0s )
     Erasing sectors ✔ [00:00:00] [-------------------------------------------------------------------------------------------------------------------------------------------]       0B/ 32.00KB @       0B/s (eta 0s )
 Programming pages   ✔ [00:01:53] [-------------------------------------------------------------------------------------------------------------------------------------------]       0B/ 32.00KB @       0B/s (eta 0s )
       Error failed to flash /home/chief/code/led-backlighting-controller/target/thumbv6m-none-eabi/release/led-backlighting-controller
             
             Caused by:
                 0: Error while flashing
                 1: Failed to erase flash sector at address 0x00000000.
                 2: The execution of 'erase_sector' failed with code 1. This might indicate a problem with the flash algorithm.

I took a look, and I think this may be caused by invalid flash_properties in the atsamd21_128 algo at

atsamd21_128:
name: atsamd21_128
description: ATSAMD21 128kB Flash
default: true
instructions: QSEJBgpoUgcB1QQiCmAtSitJUWAsSUlECGAAIHBHACBwRw8hSQMBQEIIDyAAAwJAELUkSMJhJUoCgAJ90gf80CJMASI/PFIDixgM4EoIwmEEgAJ90gf80AJ9kgcB1QEgEL3/MQExmULw0wAgEL3wtckciQgVS4kAEk3bHCuAK33bB/zQEU49PgApFtADRkApAdlAJAXgDEYD4IDKCR+AwyQfACz50S6AQDArfdsH/NArfZsH6NUBIPC9ACDwvQAAngAEAABAAEEEAAAAQaUAAAAAAAAAAAAA
pc_init: 1
pc_uninit: 31
pc_program_page: 111
pc_erase_sector: 35
pc_erase_all: ~
data_section_offset: 208
flash_properties:
address_range:
start: 0
end: 131072
page_size: 1024
erased_byte_value: 255
program_page_timeout: 100
erase_sector_timeout: 1000
sectors:
- size: 8192
address: 0

@LongLiveCHIEF
Copy link

so, strangely enough, even though I'm fairly sure my chip is a atsamd21g18au, if I change my chip in .embed.toml and probe-run commands to atsamd21e17a, everything works flawlessly... but only if I use my stlinkv2-1 probe (jlink edu mini still has issues).

I am currently testing on a seeeduino xiao, which the manufacturer states is a "ARM Cortex-M0+ CPU(SAMD21G18)" (seeeduino xiao specs.

The actual chip on the xiao board is shielded, so I cant verify the chip without destroying the board, but I have some new boards coming in a few days that supposedly also have the atsamd21g18au (and not shielded), and I'll re-run some of these tests with those boards as well to see what results I can replicate.

If things go strangely at that point, I'll rip the shielding off one of these seeeduino's to verify the chip.

@LongLiveCHIEF
Copy link

LongLiveCHIEF commented Apr 25, 2021

btw, my mistake earlier, the flash aglo is 2556 not 128, at least according to the CMSIS pack. (this matches what is currently in the targets spec of probe-rs for the chip.)

@wjbuys
Copy link

wjbuys commented Nov 13, 2021

I'm running into the same issue while trying to flash an ATSAMD21G18AU (Adafruit Feather M0 Express); probe-run tries to erase flash at address 0x0000, even though memory.x reserves 8k for the bootloader and --nmagic is passed to the linker:

   Flashing atsamd/boards/feather_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic
        INFO probe_rs::flashing::download > Found loadable segment, physical address: 0x00002000, virtual address: 0x00002000, flags: 0x4
        INFO probe_rs::flashing::download > Matching section: ".vector_table"
        INFO probe_rs::flashing::download > Found loadable segment, physical address: 0x000020b0, virtual address: 0x000020b0, flags: 0x5
        INFO probe_rs::flashing::download > Matching section: ".text"
        INFO probe_rs::flashing::download > Found loadable segment, physical address: 0x00005ba0, virtual address: 0x00005ba0, flags: 0x4
        INFO probe_rs::flashing::download > Matching section: ".rodata"
        INFO probe_rs::flashing::loader   > Found 3 loadable sections:
        INFO probe_rs::flashing::loader   >     .vector_table at 00002000 (176 bytes)
        INFO probe_rs::flashing::loader   >     .text at 000020B0 (15088 bytes)
        INFO probe_rs::flashing::loader   >     .rodata at 00005BA0 (1716 bytes)
        INFO cargo_flash                  > Protocol speed 0 kHz
        INFO probe_rs::probe::jlink       > J-Link: S/N: 801038796
        INFO probe_rs::probe::jlink       > J-Link: Firmware version: J-Link EDU Mini V1 compiled Nov  2 2021 11:12:01
        INFO probe_rs::probe::jlink       > J-Link: Hardware version: J-Link 1.0.0
        INFO probe_rs::probe::jlink       > J-Link: Target voltage: 3.30 V
        INFO probe_rs::flashing::flasher  > Erasing sector at address 0x00000000
        INFO probe_rs::flashing::flasher  > Done erasing sector. Result is 1. This took 15.732822ms
     Erasing sectors ✔ [00:00:00] [-------------------------------------------------------------------------------------------------------------]       0B/32.00KiB @       0B/s (eta 0s )
 Programming pages   ✔ [00:00:00] [-------------------------------------------------------------------------------------------------------------]       0B/16.62KiB @       0B/s (eta 0s )
       Error Failed to erase flash sector at address 0x00000000.

This is trying to flash the unmodified blinky_basic example from here

@kaidokert
Copy link

Was also playing with Feather-M0 just now and passing atsamd21e17a made it magically work.

@Yatekii
Copy link
Member

Yatekii commented May 29, 2022

So to clarify: You intentinally passed the wrong chip to make it work? Could you specify what Chip you have?

We should diff the config files against eachother and see what the differences are :)

@LongLiveCHIEF
Copy link

@Yatekii this is only happening when the board uses the ATSAMD21G18AU chip. I've tested on both the feather M0 and the seeeduino xiao. The only way to flash the chips on these boards is to use the atsamd21e17a.

I did some digging a little over a year ago, and determined that it came down to the flash region size being incorrect for the CMSIS pack for the 21G18au. I compared the flash algo's for that chip and the 21e17a, and the only differences were the flash region size. The region size for the 21e17a seems to be right size for 21d18au, so that why I flashed it using the "wrong chip" so long ago.

Since then I've seen a few dozen people with the same problem for these 2 chips, and this fix always works for them.

I think there's another issue thread in one of the probe-rs repos where I had an even more detailed description and analysis, but can't remember where that is.

@Yatekii
Copy link
Member

Yatekii commented May 29, 2022

Hmm then we should fix the target description file :/ Or see if there is an updated CMSIS-Pack :/

@LongLiveCHIEF
Copy link

If I get a chance, I'll look into whether or not the CMSIS-Pack has been updated this weekend. If not, I can submit a PR to update the target description file for the g18au.

@ianrrees
Copy link
Contributor

I went ahead and ran target-gen on the current SAMD21 dev pack - here- it looks like the tool now generates decimal rather than hex values, so the diff isn't particularly enlightening, but the spot checking I did doesn't indicate any changes including to the ATSAMD21G18AU flash algorithm.

The ATSAMD HAL has made a PR or two to the dev packs before, but I'm not actually sure what exactly the error is. Per the SAMD21 datasheet 22.6.3 "Region Lock Bits", the region size is determined by the total flash size - ATSAMD21G18AU has 256kB flash so should have 16kB region size, ATSAMD21E17A is 128kB/8kB. Those look to be the same as the "sector" values in the generated yaml.

I do notice the page size for all these parts is 64B per the datasheet table 10-3, and the flash algos differ between these two parts: ATSAMD21G18AU uses flash algo atsamd21_256 and that uses 64B page size, The ATSAMD21E17A uses algo atsamd21_128, 1024B page size. However, I don't understand how that would relate to the bootloader specifically...

@LongLiveCHIEF
Copy link

yeah, i was stumped as well. what's more interesting, when I flash this chip with platformio, which uses the same derived algos from the cmsis packs, it works fine.

@ianrrees
Copy link
Contributor

ianrrees commented Oct 13, 2023

After some time away from SAMD and Rust firmware, this has tripped me up again so I've dug in to the cause:

probe-rs has a concept of flash "sectors", and before programming it erases any sectors that will later be programmed. The sector boundaries are calculated based on the flash algorithm, in this case from SAMD21.yaml which is generated from the Microchip dev pack. ATSAMD21G18AU sectors start at 0x0 with size 0x4000 (16kB), while ATSAMD21E17A sectors start at 0x0 and have size 0x2000 (8kB).

When probe-rs attempts to program a SAMD21G18AU that has an 8kB bootloader (as is typical for Adafruit boards, at least), it decides to erase the sector that goes from 0x0 to 0x4000-1 because the program starts halfway through that sector. But, the chip has the bootloader protection enabled for the lower 8kB (this setting can be queried).

The naive fix of turning down the sector size in SAMD21.yaml fails, I presume because the loader can't handle the finer grained sector addresses.

@Yatekii do you have any thoughts on the best approach to resolve this?

@Yatekii
Copy link
Member

Yatekii commented Oct 13, 2023

The erase always happens per sector. The only way is to erase the bootloader and write it again (there is a flag for it). Maybe the chip has a weird finer grained sector set that can be enabled with some commands; in that case we can fix it with a new flashloader. But thats a rather rare thing afaik. Bootloaders are typically the size of N sectors for this reason.

Are you sure the program is linked correctly and the program should not actually be placed at the sector boundary?

@ianrrees
Copy link
Contributor

ianrrees commented Oct 13, 2023

From a look at the datasheet tonight, I believe the SAMD21 flash can be erased in units called "rows" which are 256 bytes, each row is four 64 byte "pages". SAMD21 has two flash protection schemes which relate to this issue, one via BOOTPROT and another via "Region Lock Bits":

BOOTPROT is meant to protect a bootloader at the beginning of flash, it's a 3-bit value which maps on to the same set of sizes for all flash size parts, either 0B, 512B, 1024B, 2048B, ... 32768B.

The Region Lock Bits provide a more general-purpose protection scheme, which divides the flash in to 16 equally-sized regions and allows disabling writes per-region. I believe these regions are what we're treating as "sectors", but they are substantially larger (16kB, in the chip discussed here) than the 256B rows that the flash can be erased in.

@Yatekii
Copy link
Member

Yatekii commented Oct 14, 2023

What if you try to make the sector size 256 bytes?

I mean best would be if there was a dynamic sector erase size in our flashing code, but for now we can do it with a smaller sector maybe. It will take much longer to erase like this tho.

@ianrrees
Copy link
Contributor

ianrrees commented Oct 16, 2023

What if you try to make the sector size 256 bytes?

Changing the sector size to 0x10 in SAMD21.yaml fails (that's what I did in this comment). My guess is that the loader program doesn't handle finer grained erases, but that is just a guess - is that program provided by the pack?

I also tried setting the sector size to 0x800, which is the same used for ATSAMD21E15A - that fails similarly to 0x10, but setting the device to ATSAMD21E15A succeeds.

I mean best would be if there was a dynamic sector erase size in our flashing code, but for now we can do it with a smaller sector maybe. It will take much longer to erase like this tho.

Understood; I'm happy to look at concatenating adjacent sectors if that would help.

@ianrrees
Copy link
Contributor

ianrrees commented Oct 21, 2023

I've decompiled the EraseSector and ProgramPage functions for the loaders used for ATSAMD21E15A and ATSAMD21G18AU (added comments to this EraseSector). In short - EraseSector provided in the dev_packs works in terms of the regions (and unlocks the region lock bits accordingly), and internally does the erases per 256B row. I don't see a more appropriate function to use for finer-grained erase.

It seems like there are a couple options to proceed:

A) Take the bootloader protection in to account in probe-rs, which would look something like

  1. Save existing bootloader protection value
  2. Disable bootloader protection
  3. Use existing flash algo to program (erasing the bootloader and writing it back, as necessary)
  4. Restore the bootloader protection value

B) Create a new erase function, that can work per-row. If we went this route, I presume that target-gen would need to have some exception for SAMD21 parts - is there prior art for this sort of exception? Ideally, the new erase function would take both start address and size parameters, so we don't need to make separate transactions for each row erase - but that might require more extensive changes to probe-rs.

@ianrrees
Copy link
Contributor

After a bit more thought about this - there's an option in-between those two:

C) Modify the flash algorithm to backup, disable, and re-enable the bootloader protection.

I tend to think that A) is the best option, because it would give the user more visibility and control over the state of the chip. Automatically turning off a protection feature seems a bit surprising too.

@ianrrees
Copy link
Contributor

what's more interesting, when I flash this chip with platformio, which uses the same derived algos from the cmsis packs, it works fine.

I replicated this using platformio and a J-Link - from the logs it appears that pio uses Segger's software to drive the flashing process, and it doesn't seem to suffer the same problem as here. With the chip's bootloader protection set to 8kB, the Segger tool flashes the application, and if I set the bootloader protection to 16kB, it fails with an error ((sector is locked)). So, it's not fiddling with the bootloader protection, and I guess it isn't using the loader from Microchip's dev_packs.

@LongLiveCHIEF - what probe are you using?

@LongLiveCHIEF
Copy link

LongLiveCHIEF commented Oct 26, 2023 via email

@Yatekii
Copy link
Member

Yatekii commented Nov 5, 2023

@ianrrees Did we want to still come up with a fix for this or do we require a chip erase? Maybe we can at least fix the diagnostics on this so it tells us what's wrong.

@ianrrees
Copy link
Contributor

ianrrees commented Nov 6, 2023

Yes, I think this is still a significant issue. With #1855, probe-rs now does have a chip erase for ATSAM, however that doesn't really help here since the chip erase functionality leaves the "user row" intact, and that includes the bootloader protection setting...

With a wider view, I think we need a generic reading/writing functionality for field like the BOOTPROT, where there's more to it than simply reading/writing a register, and there are also good reasons for developers to want to access just that specific field. For another instance, in a recent project with i.MX8 (not-Rust and proprietary), I've encountered similar need for programming crypto keys.

I totally agree that better diagnostics messages would be great - in this case it would be difficult to make the diagnostic very helpful without the ability to read the BOOTPROT setting. The logs in the attached bugs do start with the same failure to erase sector 0x0000, however in other combinations of flash size and BOOTPROT setting, those erasing errors will manifest at different addresses.

@ianrrees
Copy link
Contributor

@Yatekii - apologies for digging this up after so long away! I've got some time for OSS again, and am curious whether there have been developments on this?

@9names
Copy link
Contributor

9names commented Aug 11, 2024

@ianrrees as long as the memory is addressable this should be resolved by #2654

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants