Openocd SWD acknowledge problem with XIAO

I am having trouble with using openocd with the XIAO platform.

I have read through the other openocd-related posts on this forum and they don’t address this particular issue.

First, here is my openocd configuration file (openocd.cfg) for use with a Segger J-Link debugger:

The openocd.cfg file was modified with one line to change the interface:

source [find interface/jlink.cfg]
transport select "swd"

# chip name
set CHIPNAME at91samd51g18
set _CPUTAPID 0x0bc11477

debug_level 4
set telnet_port 0

source [find target/at91samdXX.cfg]

Here is a log of what I get when I run “openocd -f openocd.cfg”.

Open On-Chip Debugger 0.10.0+dev-01340-ga0e8edc4e (2020-03-12-18:07)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Debug: 14 1 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/at91samdXX.cfg
Debug: 15 1 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/swj-dp.tcl
Debug: 16 1 command.c:143 script_debug(): command - transport transport select
Debug: 17 1 command.c:143 script_debug(): command - transport transport select
Debug: 18 1 command.c:143 script_debug(): command - transport transport select
Debug: 19 1 command.c:143 script_debug(): command - transport transport select
Debug: 20 1 command.c:143 script_debug(): command - swd swd newdap at91samd51g18 cpu -irlen 4 -expected-id 0x4ba00477
Debug: 21 1 tcl.c:567 jim_newtap_cmd(): Creating New Tap, Chip: at91samd51g18, Tap: cpu, Dotted: at91samd51g18.cpu, 4 params
Debug: 22 1 core.c:1487 jtag_tap_init(): Created Tap: at91samd51g18.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 23 1 command.c:143 script_debug(): command - dap dap create at91samd51g18.dap -chain-position at91samd51g18.cpu
Debug: 24 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 25 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 26 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 27 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 28 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 29 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 30 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 31 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 32 1 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 33 1 command.c:143 script_debug(): command - target target create at91samd51g18.cpu cortex_m -endian little -dap at91samd51g18.dap
Debug: 34 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 35 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 36 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 37 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 38 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 39 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 40 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 41 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 42 1 command.c:354 register_command_handler(): registering 'arm'...
Debug: 43 1 command.c:354 register_command_handler(): registering 'tpiu'...
Debug: 44 1 command.c:354 register_command_handler(): registering 'itm'...
Debug: 45 1 command.c:354 register_command_handler(): registering 'itm'...
Debug: 46 1 command.c:354 register_command_handler(): registering 'cortex_m'...
Debug: 47 1 command.c:354 register_command_handler(): registering 'cortex_m'...
Debug: 48 1 command.c:354 register_command_handler(): registering 'cortex_m'...
Debug: 49 1 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 50 1 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 51 1 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 52 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 53 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 54 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 55 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 56 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 57 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 58 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 59 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 60 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 61 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 62 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 63 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 64 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 65 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 66 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 67 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 68 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 69 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 70 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 71 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 72 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 73 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 74 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 75 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 76 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 77 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 78 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 79 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 80 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 81 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 82 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 83 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 84 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 85 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 86 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 87 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 88 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 89 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 90 2 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 91 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -work-area-phys 0x20000000 -work-area-size 0x800 -work-area-backup 0
Debug: 92 2 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 93 2 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 94 2 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 95 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event reset-deassert-post 
        at91samd dsu_reset_deassert

Debug: 96 2 command.c:143 script_debug(): command - reset_config reset_config srst_gates_jtag
Debug: 98 2 command.c:143 script_debug(): command - adapter_khz adapter_khz 400
Debug: 100 2 core.c:1821 jtag_config_khz(): handle jtag khz
Debug: 101 2 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 102 2 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 103 2 command.c:143 script_debug(): command - transport transport select
Debug: 104 2 command.c:143 script_debug(): command - cortex_m cortex_m reset_config sysresetreq
Debug: 106 2 command.c:143 script_debug(): command - flash flash bank at91samd51g18.flash at91samd 0x00000000 0 1 1 at91samd51g18.cpu
Debug: 108 2 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 109 2 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 110 2 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 111 2 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 112 2 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 113 2 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 114 2 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 115 2 tcl.c:1156 handle_flash_bank_command(): 'at91samd' driver usage field missing
Info : 116 2 server.c:311 add_service(): Listening on port 6666 for tcl connections
Info : 117 2 server.c:311 add_service(): Listening on port 4444 for telnet connections
Debug: 118 2 command.c:143 script_debug(): command - init init
Debug: 120 2 command.c:143 script_debug(): command - target target init
Debug: 122 2 command.c:143 script_debug(): command - target target names
Debug: 123 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu cget -event gdb-flash-erase-start
Debug: 124 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event gdb-flash-erase-start reset init
Debug: 125 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu cget -event gdb-flash-write-end
Debug: 126 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event gdb-flash-write-end reset halt
Debug: 127 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu cget -event gdb-attach
Debug: 128 2 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event gdb-attach halt
Debug: 129 2 target.c:1431 handle_target_init_command(): Initializing targets...
Debug: 130 2 semihosting_common.c:97 semihosting_common_init():  
Debug: 131 2 command.c:354 register_command_handler(): registering 'target_request'...
Debug: 132 2 command.c:354 register_command_handler(): registering 'trace'...
Debug: 133 3 command.c:354 register_command_handler(): registering 'trace'...
Debug: 134 3 command.c:354 register_command_handler(): registering 'fast_load_image'...
Debug: 135 3 command.c:354 register_command_handler(): registering 'fast_load'...
Debug: 136 3 command.c:354 register_command_handler(): registering 'profile'...
Debug: 137 3 command.c:354 register_command_handler(): registering 'virt2phys'...
Debug: 138 3 command.c:354 register_command_handler(): registering 'reg'...
Debug: 139 3 command.c:354 register_command_handler(): registering 'poll'...
Debug: 140 3 command.c:354 register_command_handler(): registering 'wait_halt'...
Debug: 141 3 command.c:354 register_command_handler(): registering 'halt'...
Debug: 142 3 command.c:354 register_command_handler(): registering 'resume'...
Debug: 143 3 command.c:354 register_command_handler(): registering 'reset'...
Debug: 144 3 command.c:354 register_command_handler(): registering 'soft_reset_halt'...
Debug: 145 3 command.c:354 register_command_handler(): registering 'step'...
Debug: 146 3 command.c:354 register_command_handler(): registering 'mdd'...
Debug: 147 3 command.c:354 register_command_handler(): registering 'mdw'...
Debug: 148 3 command.c:354 register_command_handler(): registering 'mdh'...
Debug: 149 3 command.c:354 register_command_handler(): registering 'mdb'...
Debug: 150 3 command.c:354 register_command_handler(): registering 'mwd'...
Debug: 151 3 command.c:354 register_command_handler(): registering 'mww'...
Debug: 152 3 command.c:354 register_command_handler(): registering 'mwh'...
Debug: 153 3 command.c:354 register_command_handler(): registering 'mwb'...
Debug: 154 3 command.c:354 register_command_handler(): registering 'bp'...
Debug: 155 3 command.c:354 register_command_handler(): registering 'rbp'...
Debug: 156 3 command.c:354 register_command_handler(): registering 'wp'...
Debug: 157 3 command.c:354 register_command_handler(): registering 'rwp'...
Debug: 158 3 command.c:354 register_command_handler(): registering 'load_image'...
Debug: 159 3 command.c:354 register_command_handler(): registering 'dump_image'...
Debug: 160 3 command.c:354 register_command_handler(): registering 'verify_image_checksum'...
Debug: 161 3 command.c:354 register_command_handler(): registering 'verify_image'...
Debug: 162 3 command.c:354 register_command_handler(): registering 'test_image'...
Debug: 163 3 command.c:354 register_command_handler(): registering 'reset_nag'...
Debug: 164 3 command.c:354 register_command_handler(): registering 'ps'...
Debug: 165 3 command.c:354 register_command_handler(): registering 'test_mem_access'...
Debug: 166 3 jlink.c:572 jlink_init(): Using libjaylink 0.2.0-git-f73ad5e (compiled with 0.2.0-git-f73ad5e).
Debug: 167 6 jlink.c:526 jaylink_log_handler(): Found device (VID:PID = 1366:0101, bus:address = 001:028).
Debug: 168 7 jlink.c:526 jaylink_log_handler(): Device: USB address = 0.
Debug: 169 7 jlink.c:526 jaylink_log_handler(): Device: Serial number = 260102401.
Debug: 170 7 jlink.c:526 jaylink_log_handler(): Allocating new device instance.
Debug: 171 7 jlink.c:526 jaylink_log_handler(): Found 1 USB device(s).
Debug: 172 7 jlink.c:526 jaylink_log_handler(): Trying to open device (bus:address = 001:028).
Debug: 173 7 jlink.c:526 jaylink_log_handler(): Using endpoint 81 (IN) and 01 (OUT).
Debug: 174 8 jlink.c:526 jaylink_log_handler(): Device opened successfully.
Debug: 175 8 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 2 bytes).
Debug: 176 8 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 177 9 jlink.c:526 jaylink_log_handler(): Received 2 bytes from device.
Debug: 178 9 jlink.c:526 jaylink_log_handler(): Read 2 bytes from buffer.
Debug: 179 9 jlink.c:526 jaylink_log_handler(): Starting read operation (length = 112 bytes).
Debug: 180 9 jlink.c:526 jaylink_log_handler(): Received 112 bytes from device.
Debug: 181 9 jlink.c:526 jaylink_log_handler(): Read 112 bytes from buffer.
Info : 182 9 jlink.c:696 jlink_init(): J-Link V10 compiled Mar 21 2019 15:43:57
Debug: 183 9 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 4 bytes).
Debug: 184 10 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 185 10 jlink.c:526 jaylink_log_handler(): Received 4 bytes from device.
Debug: 186 10 jlink.c:526 jaylink_log_handler(): Read 4 bytes from buffer.
Debug: 187 10 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 32 bytes).
Debug: 188 11 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 189 11 jlink.c:526 jaylink_log_handler(): Received 32 bytes from device.
Debug: 190 11 jlink.c:526 jaylink_log_handler(): Read 32 bytes from buffer.
Debug: 191 11 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 4 bytes).
Debug: 192 12 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 193 12 jlink.c:526 jaylink_log_handler(): Received 4 bytes from device.
Debug: 194 12 jlink.c:526 jaylink_log_handler(): Read 4 bytes from buffer.
Info : 195 12 jlink.c:737 jlink_init(): Hardware version: 10.10
Debug: 196 12 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 4 bytes).
Debug: 197 12 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 198 13 jlink.c:526 jaylink_log_handler(): Received 4 bytes from device.
Debug: 199 13 jlink.c:526 jaylink_log_handler(): Read 4 bytes from buffer.
Debug: 200 13 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 256 bytes).
Debug: 201 13 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 202 14 jlink.c:526 jaylink_log_handler(): Received 256 bytes from device.
Debug: 203 14 jlink.c:526 jaylink_log_handler(): Read 256 bytes from buffer.
Debug: 204 14 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 8 bytes).
Debug: 205 14 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 206 15 jlink.c:526 jaylink_log_handler(): Received 8 bytes from device.
Debug: 207 15 jlink.c:526 jaylink_log_handler(): Read 8 bytes from buffer.
Info : 208 15 jlink.c:779 jlink_init(): VTarget = 3.296 V
Debug: 209 15 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 14 / 76 bytes).
Debug: 210 15 jlink.c:526 jaylink_log_handler(): Sent 14 bytes to device.
Debug: 211 16 jlink.c:526 jaylink_log_handler(): Received 92 bytes from device.
Debug: 212 16 jlink.c:526 jaylink_log_handler(): Read 76 bytes from buffer.
Debug: 213 16 jlink.c:526 jaylink_log_handler(): Starting read operation (length = 16 bytes).
Debug: 214 16 jlink.c:526 jaylink_log_handler(): Last read operation left 16 bytes in the buffer.
Debug: 215 16 jlink.c:526 jaylink_log_handler(): Read 16 bytes from buffer.
Debug: 216 16 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 2 / 4 bytes).
Debug: 217 16 jlink.c:526 jaylink_log_handler(): Sent 2 bytes to device.
Debug: 218 16 jlink.c:526 jaylink_log_handler(): Received 4 bytes from device.
Debug: 219 16 jlink.c:526 jaylink_log_handler(): Read 4 bytes from buffer.
Debug: 220 16 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 2 / 4 bytes).
Debug: 221 17 jlink.c:526 jaylink_log_handler(): Sent 2 bytes to device.
Debug: 222 17 jlink.c:526 jaylink_log_handler(): Received 4 bytes from device.
Debug: 223 17 jlink.c:526 jaylink_log_handler(): Read 4 bytes from buffer.
Debug: 224 17 jlink.c:931 jlink_reset(): TRST: 0, SRST: 0.
Debug: 225 17 jlink.c:526 jaylink_log_handler(): Starting write operation (length = 1 bytes).
Debug: 226 17 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 227 17 jlink.c:526 jaylink_log_handler(): Starting write operation (length = 1 bytes).
Debug: 228 18 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 229 21 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 6 bytes).
Debug: 230 21 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 231 22 jlink.c:526 jaylink_log_handler(): Received 6 bytes from device.
Debug: 232 22 jlink.c:526 jaylink_log_handler(): Read 6 bytes from buffer.
Debug: 233 22 jlink.c:526 jaylink_log_handler(): Starting write operation (length = 3 bytes).
Debug: 234 22 jlink.c:526 jaylink_log_handler(): Sent 3 bytes to device.
Debug: 235 22 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 236 22 core.c:1788 adapter_khz_to_speed(): have interface set up
Debug: 237 22 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 1 / 6 bytes).
Debug: 238 22 jlink.c:526 jaylink_log_handler(): Sent 1 bytes to device.
Debug: 239 23 jlink.c:526 jaylink_log_handler(): Received 6 bytes from device.
Debug: 240 23 jlink.c:526 jaylink_log_handler(): Read 6 bytes from buffer.
Debug: 241 23 jlink.c:526 jaylink_log_handler(): Starting write operation (length = 3 bytes).
Debug: 242 23 jlink.c:526 jaylink_log_handler(): Sent 3 bytes to device.
Debug: 243 23 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 244 23 core.c:1788 adapter_khz_to_speed(): have interface set up
Info : 245 23 core.c:1564 adapter_init(): clock speed 400 kHz
Debug: 246 23 openocd.c:141 handle_init_command(): Debug Adapter init complete
Debug: 247 23 command.c:143 script_debug(): command - transport transport init
Debug: 249 23 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 250 23 command.c:143 script_debug(): command - dap dap init
Debug: 252 23 arm_dap.c:106 dap_init_all(): Initializing all DAPs ...
Debug: 253 23 jlink.c:2143 jlink_swd_switch_seq(): JTAG-to-SWD
Debug: 254 23 jlink.c:2167 jlink_swd_run_queue(): Executing 2 queued transactions.
Debug: 255 23 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 64 / 31 bytes).
Debug: 256 23 jlink.c:526 jaylink_log_handler(): Wrote 4 bytes into buffer.
Debug: 257 23 jlink.c:526 jaylink_log_handler(): Wrote 30 bytes into buffer.
Debug: 258 23 jlink.c:526 jaylink_log_handler(): Buffer filled up with 30 bytes.
Debug: 259 24 jlink.c:526 jaylink_log_handler(): Sent 64 bytes to device.
Debug: 260 24 jlink.c:526 jaylink_log_handler(): Received 30 bytes from device.
Debug: 261 24 jlink.c:526 jaylink_log_handler(): Read 30 bytes from buffer.
Debug: 262 25 jlink.c:526 jaylink_log_handler(): Received 1 bytes from device.
Debug: 263 25 jlink.c:526 jaylink_log_handler(): Read 1 bytes from buffer.
Debug: 264 25 jlink.c:2192 jlink_swd_run_queue(): SWD ack not OK: 0 JUNK
Debug: 265 25 command.c:629 run_command(): Command 'dap init' failed with error code -4
User : 266 25 command.c:694 command_run_line(): 
Debug: 267 25 command.c:629 run_command(): Command 'init' failed with error code -4
User : 268 25 command.c:694 command_run_line(): 
Debug: 269 25 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 270 25 jlink.c:2148 jlink_swd_switch_seq(): SWD-to-JTAG
Debug: 271 25 jlink.c:2167 jlink_swd_run_queue(): Executing 0 queued transactions.
Debug: 272 25 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 26 / 12 bytes).
Debug: 273 25 jlink.c:526 jaylink_log_handler(): Wrote 4 bytes into buffer.
Debug: 274 25 jlink.c:526 jaylink_log_handler(): Wrote 11 bytes into buffer.
Debug: 275 25 jlink.c:526 jaylink_log_handler(): Buffer filled up with 11 bytes.
Debug: 276 25 jlink.c:526 jaylink_log_handler(): Sent 26 bytes to device.
Debug: 277 25 jlink.c:526 jaylink_log_handler(): Received 11 bytes from device.
Debug: 278 25 jlink.c:526 jaylink_log_handler(): Read 11 bytes from buffer.
Debug: 279 26 jlink.c:526 jaylink_log_handler(): Received 1 bytes from device.
Debug: 280 26 jlink.c:526 jaylink_log_handler(): Read 1 bytes from buffer.
Debug: 281 26 jlink.c:526 jaylink_log_handler(): Starting write / read operation (length = 14 / 76 bytes).
Debug: 282 26 jlink.c:526 jaylink_log_handler(): Sent 14 bytes to device.
Debug: 283 26 jlink.c:526 jaylink_log_handler(): Received 92 bytes from device.
Debug: 284 26 jlink.c:526 jaylink_log_handler(): Read 76 bytes from buffer.
Debug: 285 26 jlink.c:526 jaylink_log_handler(): Starting read operation (length = 16 bytes).
Debug: 286 26 jlink.c:526 jaylink_log_handler(): Last read operation left 16 bytes in the buffer.
Debug: 287 26 jlink.c:526 jaylink_log_handler(): Read 16 bytes from buffer.
Debug: 288 26 jlink.c:526 jaylink_log_handler(): Closing device (bus:address = 001:028).
Debug: 289 26 jlink.c:526 jaylink_log_handler(): Device closed successfully.
Debug: 290 26 jlink.c:526 jaylink_log_handler(): Device destroyed (bus:address = 001:028).

Notice that there is apparently one command that the target does not respond to with an ACK, after responding with ACKs to a lot of previous commands.

I have tried a number of different configurations, but I keep getting blocked by this.

I have also tried using a CMSIS-DAP debugger instead of the J-Link.

I have tried this on three different XIAOs, right out of the box, and I get the same result. Meanwhile, I can access other SAMD21 target boards using the same setup with no problem.

Any ideas?

Thanks.

–ken

Hi kalauffenburger,
I only have ST-LINK, so I don’t know if it will be helpful,.
I can connect to XIAO in debug mode with the following config file.

#source [find interface/jlink.cfg]
source [find interface/stlink.cfg]

#transport select "swd"
transport select hla_swd

# chip name
#set CHIPNAME at91samd51g18
set CHIPNAME at91samd21g18

#set _CPUTAPID 0x0bc11477
set CPUTAPID 0x0bc11477

debug_level 4
set telnet_port 0

source [find target/at91samdXX.cfg]

msfujino,

Thanks for the response. I didn’t think about trying my ST-Link probe.

I tried it just now but unfortunately it didn’t work either. Here is a log (can you send back to me how your log differs?):

Open On-Chip Debugger 0.10.0+dev-01340-ga0e8edc4e (2020-03-12-18:07)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Debug: 17 8 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/at91samdXX.cfg
Debug: 18 8 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/swj-dp.tcl
Debug: 19 9 command.c:143 script_debug(): command - transport transport select
Debug: 20 9 command.c:143 script_debug(): command - transport transport select
Debug: 21 9 command.c:143 script_debug(): command - transport transport select
Debug: 22 9 command.c:143 script_debug(): command - transport transport select
Debug: 23 9 command.c:143 script_debug(): command - hla hla newtap at91samd21g18 cpu -irlen 4 -expected-id 0x0bc11477
Debug: 24 9 hla_tcl.c:111 jim_hl_newtap_cmd(): Creating New Tap, Chip: at91samd21g18, Tap: cpu, Dotted: at91samd21g18.cpu, 4 params
Debug: 25 9 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -irlen
Debug: 26 9 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -expected-id
Debug: 27 9 core.c:1487 jtag_tap_init(): Created Tap: at91samd21g18.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 28 9 command.c:143 script_debug(): command - dap dap create at91samd21g18.dap -chain-position at91samd21g18.cpu
Debug: 29 9 command.c:143 script_debug(): command - target target create at91samd21g18.cpu cortex_m -endian little -dap at91samd21g18.dap
Info : 30 9 target.c:5424 target_create(): The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Debug: 31 9 hla_target.c:369 adapter_target_create(): adapter_target_create
Debug: 32 9 hla_target.c:339 adapter_init_arch_info(): adapter_init_arch_info
Debug: 33 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 34 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 35 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 36 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 37 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 38 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 39 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 40 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 41 10 command.c:354 register_command_handler(): registering 'arm'...
Debug: 42 10 command.c:354 register_command_handler(): registering 'tpiu'...
Debug: 43 10 command.c:354 register_command_handler(): registering 'itm'...
Debug: 44 10 command.c:354 register_command_handler(): registering 'itm'...
Debug: 45 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 46 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 47 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 48 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 49 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 50 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 51 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 52 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 53 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 54 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 55 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 56 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 57 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 58 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 59 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 60 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 61 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 62 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 63 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 64 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 65 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 66 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 67 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 68 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 69 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 70 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 71 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 72 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 73 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 74 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 75 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 76 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 77 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 78 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 79 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 80 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 81 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 82 10 command.c:354 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 83 10 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu configure -work-area-phys 0x20000000 -work-area-size 0x800 -work-area-backup 0
Debug: 84 10 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 85 10 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 86 10 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 87 10 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu configure -event reset-deassert-post 
        at91samd dsu_reset_deassert

Debug: 88 10 command.c:143 script_debug(): command - reset_config reset_config srst_gates_jtag
Debug: 90 10 command.c:143 script_debug(): command - adapter_khz adapter_khz 400
Debug: 92 10 core.c:1821 jtag_config_khz(): handle jtag khz
Debug: 93 10 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 94 10 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 95 10 command.c:143 script_debug(): command - transport transport select
Debug: 96 10 command.c:143 script_debug(): command - flash flash bank at91samd21g18.flash at91samd 0x00000000 0 1 1 at91samd21g18.cpu
Debug: 98 11 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 99 11 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 100 11 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 101 11 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 102 11 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 103 11 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 104 11 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 105 12 tcl.c:1156 handle_flash_bank_command(): 'at91samd' driver usage field missing
Info : 106 12 server.c:311 add_service(): Listening on port 6666 for tcl connections
Info : 107 12 server.c:311 add_service(): Listening on port 4444 for telnet connections
Debug: 108 12 command.c:143 script_debug(): command - init init
Debug: 110 12 command.c:143 script_debug(): command - target target init
Debug: 112 12 command.c:143 script_debug(): command - target target names
Debug: 113 12 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu cget -event gdb-flash-erase-start
Debug: 114 12 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu configure -event gdb-flash-erase-start reset init
Debug: 115 12 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu cget -event gdb-flash-write-end
Debug: 116 12 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu configure -event gdb-flash-write-end reset halt
Debug: 117 12 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu cget -event gdb-attach
Debug: 118 12 command.c:143 script_debug(): command - at91samd21g18.cpu at91samd21g18.cpu configure -event gdb-attach halt
Debug: 119 12 target.c:1431 handle_target_init_command(): Initializing targets...
Debug: 120 12 hla_target.c:359 adapter_init_target(): adapter_init_target
Debug: 121 12 semihosting_common.c:97 semihosting_common_init():  
Debug: 122 12 command.c:354 register_command_handler(): registering 'target_request'...
Debug: 123 12 command.c:354 register_command_handler(): registering 'trace'...
Debug: 124 12 command.c:354 register_command_handler(): registering 'trace'...
Debug: 125 12 command.c:354 register_command_handler(): registering 'fast_load_image'...
Debug: 126 12 command.c:354 register_command_handler(): registering 'fast_load'...
Debug: 127 12 command.c:354 register_command_handler(): registering 'profile'...
Debug: 128 12 command.c:354 register_command_handler(): registering 'virt2phys'...
Debug: 129 12 command.c:354 register_command_handler(): registering 'reg'...
Debug: 130 12 command.c:354 register_command_handler(): registering 'poll'...
Debug: 131 12 command.c:354 register_command_handler(): registering 'wait_halt'...
Debug: 132 12 command.c:354 register_command_handler(): registering 'halt'...
Debug: 133 12 command.c:354 register_command_handler(): registering 'resume'...
Debug: 134 12 command.c:354 register_command_handler(): registering 'reset'...
Debug: 135 12 command.c:354 register_command_handler(): registering 'soft_reset_halt'...
Debug: 136 12 command.c:354 register_command_handler(): registering 'step'...
Debug: 137 12 command.c:354 register_command_handler(): registering 'mdd'...
Debug: 138 12 command.c:354 register_command_handler(): registering 'mdw'...
Debug: 139 12 command.c:354 register_command_handler(): registering 'mdh'...
Debug: 140 12 command.c:354 register_command_handler(): registering 'mdb'...
Debug: 141 12 command.c:354 register_command_handler(): registering 'mwd'...
Debug: 142 12 command.c:354 register_command_handler(): registering 'mww'...
Debug: 143 12 command.c:354 register_command_handler(): registering 'mwh'...
Debug: 144 12 command.c:354 register_command_handler(): registering 'mwb'...
Debug: 145 12 command.c:354 register_command_handler(): registering 'bp'...
Debug: 146 12 command.c:354 register_command_handler(): registering 'rbp'...
Debug: 147 12 command.c:354 register_command_handler(): registering 'wp'...
Debug: 148 12 command.c:354 register_command_handler(): registering 'rwp'...
Debug: 149 12 command.c:354 register_command_handler(): registering 'load_image'...
Debug: 150 12 command.c:354 register_command_handler(): registering 'dump_image'...
Debug: 151 12 command.c:354 register_command_handler(): registering 'verify_image_checksum'...
Debug: 152 12 command.c:354 register_command_handler(): registering 'verify_image'...
Debug: 153 12 command.c:354 register_command_handler(): registering 'test_image'...
Debug: 154 12 command.c:354 register_command_handler(): registering 'reset_nag'...
Debug: 155 12 command.c:354 register_command_handler(): registering 'ps'...
Debug: 156 12 command.c:354 register_command_handler(): registering 'test_mem_access'...
Debug: 157 12 hla_interface.c:109 hl_interface_init(): hl_interface_init
Debug: 158 12 hla_layout.c:83 hl_layout_init(): hl_layout_init
Debug: 159 12 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 160 12 core.c:1788 adapter_khz_to_speed(): have interface set up
Debug: 161 13 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 162 13 core.c:1788 adapter_khz_to_speed(): have interface set up
Info : 163 13 core.c:1564 adapter_init(): clock speed 400 kHz
Debug: 164 13 openocd.c:141 handle_init_command(): Debug Adapter init complete
Debug: 165 13 command.c:143 script_debug(): command - transport transport init
Debug: 167 13 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 168 13 hla_transport.c:152 hl_transport_init(): hl_transport_init
Debug: 169 13 hla_transport.c:169 hl_transport_init(): current transport hla_swd
Debug: 170 13 hla_interface.c:42 hl_interface_open(): hl_interface_open
Debug: 171 13 hla_layout.c:40 hl_layout_open(): hl_layout_open
Debug: 172 13 stlink_usb.c:2749 stlink_usb_open(): stlink_usb_open
Debug: 173 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3744 serial: 
Debug: 174 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial: 
Debug: 175 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374b serial: 
Debug: 176 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374d serial: 
Debug: 177 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374e serial: 
Debug: 178 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374f serial: 
Debug: 179 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3752 serial: 
Debug: 180 13 stlink_usb.c:2763 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3753 serial: 
Info : 181 17 stlink_usb.c:1084 stlink_usb_version(): STLINK V2J29S7 (API v2) VID:PID 0483:3748
Debug: 182 17 stlink_usb.c:1308 stlink_usb_init_mode(): MODE: 0x00
Info : 183 71 stlink_usb.c:1116 stlink_usb_check_voltage(): Target voltage: 3.209430
Debug: 184 71 stlink_usb.c:1363 stlink_usb_init_mode(): MODE: 0x01
Debug: 185 71 stlink_usb.c:2583 stlink_dump_speed_map(): Supported clock speeds are:
Debug: 186 71 stlink_usb.c:2586 stlink_dump_speed_map(): 4000 kHz
Debug: 187 71 stlink_usb.c:2586 stlink_dump_speed_map(): 1800 kHz
Debug: 188 71 stlink_usb.c:2586 stlink_dump_speed_map(): 1200 kHz
Debug: 189 71 stlink_usb.c:2586 stlink_dump_speed_map(): 950 kHz
Debug: 190 71 stlink_usb.c:2586 stlink_dump_speed_map(): 480 kHz
Debug: 191 71 stlink_usb.c:2586 stlink_dump_speed_map(): 240 kHz
Debug: 192 71 stlink_usb.c:2586 stlink_dump_speed_map(): 125 kHz
Debug: 193 71 stlink_usb.c:2586 stlink_dump_speed_map(): 100 kHz
Debug: 194 71 stlink_usb.c:2586 stlink_dump_speed_map(): 50 kHz
Debug: 195 71 stlink_usb.c:2586 stlink_dump_speed_map(): 25 kHz
Debug: 196 71 stlink_usb.c:2586 stlink_dump_speed_map(): 15 kHz
Debug: 197 71 stlink_usb.c:2586 stlink_dump_speed_map(): 5 kHz
Debug: 198 76 stlink_usb.c:741 stlink_usb_error_check(): STLINK_JTAG_GET_IDCODE_ERROR
Error: 199 76 stlink_usb.c:2888 stlink_usb_open(): init mode failed (unable to connect to the target)
Debug: 200 77 hla_layout.c:47 hl_layout_open(): failed
Debug: 201 77 command.c:629 run_command(): Command 'transport init' failed with error code -4
User : 202 77 command.c:694 command_run_line(): 
Debug: 203 77 command.c:629 run_command(): Command 'init' failed with error code -4
User : 204 77 command.c:694 command_run_line(): 
Debug: 205 77 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 206 77 hla_interface.c:117 hl_interface_quit(): hl_interface_quit

Thanks.

–ken

BTW, Here is what the log looks like when using a CMSIS-DAP probe:

Open On-Chip Debugger 0.10.0+dev-01340-ga0e8edc4e (2020-03-12-18:07)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Debug: 14 3 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/at91samdXX.cfg
Debug: 15 3 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/swj-dp.tcl
Debug: 16 3 command.c:143 script_debug(): command - transport transport select
Debug: 17 3 command.c:143 script_debug(): command - transport transport select
Debug: 18 4 command.c:143 script_debug(): command - transport transport select
Debug: 19 4 command.c:143 script_debug(): command - transport transport select
Debug: 20 4 command.c:143 script_debug(): command - swd swd newdap at91samd51g18 cpu -irlen 4 -expected-id 0x4ba00477
Debug: 21 4 tcl.c:567 jim_newtap_cmd(): Creating New Tap, Chip: at91samd51g18, Tap: cpu, Dotted: at91samd51g18.cpu, 4 params
Debug: 22 4 core.c:1487 jtag_tap_init(): Created Tap: at91samd51g18.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 23 4 command.c:143 script_debug(): command - dap dap create at91samd51g18.dap -chain-position at91samd51g18.cpu
Debug: 24 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 25 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 26 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 27 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 28 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 29 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 30 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 31 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 32 4 command.c:354 register_command_handler(): registering 'at91samd51g18.dap'...
Debug: 33 4 command.c:143 script_debug(): command - target target create at91samd51g18.cpu cortex_m -endian little -dap at91samd51g18.dap
Debug: 34 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 35 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 36 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 37 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 38 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 39 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 40 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 41 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 42 4 command.c:354 register_command_handler(): registering 'arm'...
Debug: 43 4 command.c:354 register_command_handler(): registering 'tpiu'...
Debug: 44 4 command.c:354 register_command_handler(): registering 'itm'...
Debug: 45 4 command.c:354 register_command_handler(): registering 'itm'...
Debug: 46 4 command.c:354 register_command_handler(): registering 'cortex_m'...
Debug: 47 4 command.c:354 register_command_handler(): registering 'cortex_m'...
Debug: 48 4 command.c:354 register_command_handler(): registering 'cortex_m'...
Debug: 49 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 50 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 51 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 52 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 53 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 54 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 55 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 56 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 57 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 58 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 59 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 60 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 61 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 62 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 63 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 64 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 65 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 66 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 67 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 68 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 69 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 70 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 71 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 72 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 73 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 74 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 75 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 76 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 77 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 78 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 79 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 80 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 81 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 82 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 83 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 84 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 85 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 86 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 87 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 88 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 89 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 90 4 command.c:354 register_command_handler(): registering 'at91samd51g18.cpu'...
Debug: 91 4 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -work-area-phys 0x20000000 -work-area-size 0x800 -work-area-backup 0
Debug: 92 4 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 93 5 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 94 5 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 95 5 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event reset-deassert-post 
        at91samd dsu_reset_deassert

Debug: 96 5 command.c:143 script_debug(): command - reset_config reset_config srst_gates_jtag
Debug: 98 5 command.c:143 script_debug(): command - adapter_khz adapter_khz 400
Debug: 100 5 core.c:1821 jtag_config_khz(): handle jtag khz
Debug: 101 5 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 102 5 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 103 5 command.c:143 script_debug(): command - transport transport select
Debug: 104 5 command.c:143 script_debug(): command - cortex_m cortex_m reset_config sysresetreq
Debug: 106 5 command.c:143 script_debug(): command - flash flash bank at91samd51g18.flash at91samd 0x00000000 0 1 1 at91samd51g18.cpu
Debug: 108 5 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 109 5 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 110 5 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 111 5 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 112 5 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 113 5 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 114 5 command.c:354 register_command_handler(): registering 'at91samd'...
Debug: 115 5 tcl.c:1156 handle_flash_bank_command(): 'at91samd' driver usage field missing
Info : 116 5 server.c:311 add_service(): Listening on port 6666 for tcl connections
Info : 117 5 server.c:311 add_service(): Listening on port 4444 for telnet connections
Debug: 118 5 command.c:143 script_debug(): command - init init
Debug: 120 5 command.c:143 script_debug(): command - target target init
Debug: 122 5 command.c:143 script_debug(): command - target target names
Debug: 123 5 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu cget -event gdb-flash-erase-start
Debug: 124 5 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event gdb-flash-erase-start reset init
Debug: 125 5 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu cget -event gdb-flash-write-end
Debug: 126 5 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event gdb-flash-write-end reset halt
Debug: 127 5 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu cget -event gdb-attach
Debug: 128 5 command.c:143 script_debug(): command - at91samd51g18.cpu at91samd51g18.cpu configure -event gdb-attach halt
Debug: 129 5 target.c:1431 handle_target_init_command(): Initializing targets...
Debug: 130 5 semihosting_common.c:97 semihosting_common_init():  
Debug: 131 5 command.c:354 register_command_handler(): registering 'target_request'...
Debug: 132 5 command.c:354 register_command_handler(): registering 'trace'...
Debug: 133 5 command.c:354 register_command_handler(): registering 'trace'...
Debug: 134 5 command.c:354 register_command_handler(): registering 'fast_load_image'...
Debug: 135 5 command.c:354 register_command_handler(): registering 'fast_load'...
Debug: 136 5 command.c:354 register_command_handler(): registering 'profile'...
Debug: 137 5 command.c:354 register_command_handler(): registering 'virt2phys'...
Debug: 138 5 command.c:354 register_command_handler(): registering 'reg'...
Debug: 139 5 command.c:354 register_command_handler(): registering 'poll'...
Debug: 140 5 command.c:354 register_command_handler(): registering 'wait_halt'...
Debug: 141 5 command.c:354 register_command_handler(): registering 'halt'...
Debug: 142 5 command.c:354 register_command_handler(): registering 'resume'...
Debug: 143 5 command.c:354 register_command_handler(): registering 'reset'...
Debug: 144 5 command.c:354 register_command_handler(): registering 'soft_reset_halt'...
Debug: 145 5 command.c:354 register_command_handler(): registering 'step'...
Debug: 146 5 command.c:354 register_command_handler(): registering 'mdd'...
Debug: 147 5 command.c:354 register_command_handler(): registering 'mdw'...
Debug: 148 5 command.c:354 register_command_handler(): registering 'mdh'...
Debug: 149 5 command.c:354 register_command_handler(): registering 'mdb'...
Debug: 150 5 command.c:354 register_command_handler(): registering 'mwd'...
Debug: 151 5 command.c:354 register_command_handler(): registering 'mww'...
Debug: 152 5 command.c:354 register_command_handler(): registering 'mwh'...
Debug: 153 5 command.c:354 register_command_handler(): registering 'mwb'...
Debug: 154 5 command.c:354 register_command_handler(): registering 'bp'...
Debug: 155 5 command.c:354 register_command_handler(): registering 'rbp'...
Debug: 156 5 command.c:354 register_command_handler(): registering 'wp'...
Debug: 157 5 command.c:354 register_command_handler(): registering 'rwp'...
Debug: 158 5 command.c:354 register_command_handler(): registering 'load_image'...
Debug: 159 5 command.c:354 register_command_handler(): registering 'dump_image'...
Debug: 160 5 command.c:354 register_command_handler(): registering 'verify_image_checksum'...
Debug: 161 5 command.c:354 register_command_handler(): registering 'verify_image'...
Debug: 162 5 command.c:354 register_command_handler(): registering 'test_image'...
Debug: 163 5 command.c:354 register_command_handler(): registering 'reset_nag'...
Debug: 164 6 command.c:354 register_command_handler(): registering 'ps'...
Debug: 165 6 command.c:354 register_command_handler(): registering 'test_mem_access'...
Info : 166 66 cmsis_dap_usb.c:874 cmsis_dap_get_caps_info(): CMSIS-DAP: SWD  Supported
Info : 167 69 cmsis_dap_usb.c:854 cmsis_dap_get_version_info(): CMSIS-DAP: FW Version = v0.1
Info : 168 72 cmsis_dap_usb.c:839 cmsis_dap_get_serial_info(): CMSIS-DAP: Serial# = 123456
Info : 169 75 cmsis_dap_usb.c:967 cmsis_dap_swd_open(): CMSIS-DAP: Interface Initialised (SWD)
Debug: 170 78 cmsis_dap_usb.c:1039 cmsis_dap_init(): CMSIS-DAP: Packet Size = 64
Debug: 171 80 cmsis_dap_usb.c:1052 cmsis_dap_init(): CMSIS-DAP: Packet Count = 1
Debug: 172 80 cmsis_dap_usb.c:1055 cmsis_dap_init(): Allocating FIFO for 1 pending HID requests
Info : 173 83 cmsis_dap_usb.c:895 cmsis_dap_get_status(): SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 1 nRESET = 1
Info : 174 94 cmsis_dap_usb.c:1108 cmsis_dap_init(): CMSIS-DAP: Interface ready
Debug: 175 94 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 176 94 core.c:1788 adapter_khz_to_speed(): have interface set up
Debug: 177 97 core.c:1784 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 178 97 core.c:1788 adapter_khz_to_speed(): have interface set up
Info : 179 97 core.c:1564 adapter_init(): clock speed 400 kHz
Debug: 180 97 openocd.c:141 handle_init_command(): Debug Adapter init complete
Debug: 181 97 command.c:143 script_debug(): command - transport transport init
Debug: 183 97 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 184 97 command.c:143 script_debug(): command - dap dap init
Debug: 186 97 arm_dap.c:106 dap_init_all(): Initializing all DAPs ...
Debug: 187 102 cmsis_dap_usb.c:929 cmsis_dap_swd_switch_seq(): JTAG-to-SWD
Debug: 188 106 cmsis_dap_usb.c:637 cmsis_dap_swd_write_from_queue(): Executing 2 queued transactions from FIFO index 0
Debug: 189 106 cmsis_dap_usb.c:661 cmsis_dap_swd_write_from_queue(): DP read reg 0 0
Debug: 190 106 cmsis_dap_usb.c:661 cmsis_dap_swd_write_from_queue(): DP write reg 0 1e
Debug: 191 108 cmsis_dap_usb.c:733 cmsis_dap_swd_read_process(): SWD ack not OK @ 0 JUNK
Debug: 192 108 command.c:629 run_command(): Command 'dap init' failed with error code -4
User : 193 108 command.c:694 command_run_line(): 
Debug: 194 108 command.c:629 run_command(): Command 'init' failed with error code -4
User : 195 108 command.c:694 command_run_line(): 
Debug: 196 108 target.c:1969 target_free_all_working_areas_restore(): freeing all working areas
Debug: 197 113 cmsis_dap_usb.c:934 cmsis_dap_swd_switch_seq(): SWD-to-JTAG
Debug: 198 118 cmsis_dap_usb.c:637 cmsis_dap_swd_write_from_queue(): Executing 0 queued transactions from FIFO index 0

–ken

kalauffenburger,

Bellow is my logfile. The last 5 lines are the logs when connecting the terminal on port 4444.
In my case
_CPUTAPID ----> CPUTAPID
use a terminal port 4444
was the points of success.

C:\XIAO_bootloader>C:/openocd/bin/openocd -f debug_openocd.cfg
Open On-Chip Debugger 0.10.0 (2020-07-29) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Debug: 18 207 configuration.c:97 find_file(): found C:/openocd/bin/../share/openocd/scripts/target/at91samdXX.cfg
Debug: 19 261 configuration.c:97 find_file(): found C:/openocd/bin/../share/openocd/scripts/target/swj-dp.tcl
Debug: 20 289 command.c:146 script_debug(): command - transport select
Debug: 21 293 command.c:146 script_debug(): command - transport select
Debug: 22 297 command.c:146 script_debug(): command - transport select
Debug: 23 301 command.c:146 script_debug(): command - transport select
Debug: 24 304 command.c:146 script_debug(): command - hla newtap at91samd21g18 cpu -irlen 4 -expected-id 0x0bc11477
Debug: 25 310 hla_tcl.c:111 jim_hl_newtap_cmd(): Creating New Tap, Chip: at91samd21g18, Tap: cpu, Dotted: at91samd21g18.cpu, 4 params
Debug: 26 317 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -irlen
Debug: 27 321 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -expected-id
Debug: 28 325 core.c:1488 jtag_tap_init(): Created Tap: at91samd21g18.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 29 332 command.c:146 script_debug(): command - dap create at91samd21g18.dap -chain-position at91samd21g18.cpu
Debug: 30 339 command.c:146 script_debug(): command - target create at91samd21g18.cpu cortex_m -endian little -dap at91samd21g18.dap
Info : 31 345 target.c:5553 target_create(): The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Debug: 32 356 hla_target.c:369 adapter_target_create(): adapter_target_create
Debug: 33 360 hla_target.c:339 adapter_init_arch_info(): adapter_init_arch_info
Debug: 34 365 command.c:352 register_command_handler(): registering 'arm'...
Debug: 35 369 command.c:352 register_command_handler(): registering 'arm'...
Debug: 36 373 command.c:352 register_command_handler(): registering 'arm'...
Debug: 37 377 command.c:352 register_command_handler(): registering 'arm'...
Debug: 38 383 command.c:352 register_command_handler(): registering 'arm'...
Debug: 39 388 command.c:352 register_command_handler(): registering 'arm'...
Debug: 40 392 command.c:352 register_command_handler(): registering 'arm'...
Debug: 41 396 command.c:352 register_command_handler(): registering 'arm'...
Debug: 42 401 command.c:352 register_command_handler(): registering 'arm'...
Debug: 43 405 command.c:352 register_command_handler(): registering 'tpiu'...
Debug: 44 410 command.c:352 register_command_handler(): registering 'itm'...
Debug: 45 415 command.c:352 register_command_handler(): registering 'itm'...
Debug: 46 420 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 47 425 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 48 430 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 49 435 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 50 441 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 51 446 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 52 451 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 53 457 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 54 463 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 55 468 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 56 474 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 57 480 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 58 484 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 59 490 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 60 494 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 61 499 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 62 505 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 63 510 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 64 516 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 65 521 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 66 526 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 67 531 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 68 536 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 69 541 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 70 546 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 71 551 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 72 556 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 73 562 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 74 567 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 75 572 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 76 577 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 77 582 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 78 587 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 79 592 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 80 597 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 81 602 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 82 607 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 83 613 command.c:352 register_command_handler(): registering 'at91samd21g18.cpu'...
Debug: 84 618 command.c:146 script_debug(): command - at91samd21g18.cpu configure -work-area-phys 0x20000000 -work-area-size 0x800 -work-area-backup 0
Debug: 85 627 target.c:1988 target_free_all_working_areas_restore(): freeing all working areas
Debug: 86 633 target.c:1988 target_free_all_working_areas_restore(): freeing all working areas
Debug: 87 638 target.c:1988 target_free_all_working_areas_restore(): freeing all working areas
Debug: 88 643 command.c:146 script_debug(): command - at91samd21g18.cpu configure -event reset-deassert-post
        at91samd dsu_reset_deassert

Debug: 89 653 command.c:146 script_debug(): command - reset_config srst_gates_jtag
Debug: 92 657 command.c:146 script_debug(): command - adapter speed 400
Debug: 94 662 core.c:1822 jtag_config_khz(): handle jtag khz
Debug: 95 665 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 96 671 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 97 676 command.c:146 script_debug(): command - transport select
Debug: 98 681 command.c:146 script_debug(): command - flash bank at91samd21g18.flash at91samd 0x00000000 0 1 1 at91samd21g18.cpu
Debug: 100 688 command.c:352 register_command_handler(): registering 'at91samd'...
Debug: 101 693 command.c:352 register_command_handler(): registering 'at91samd'...
Debug: 102 698 command.c:352 register_command_handler(): registering 'at91samd'...
Debug: 103 703 command.c:352 register_command_handler(): registering 'at91samd'...
Debug: 104 708 command.c:352 register_command_handler(): registering 'at91samd'...
Debug: 105 713 command.c:352 register_command_handler(): registering 'at91samd'...
Debug: 106 718 command.c:352 register_command_handler(): registering 'at91samd'...
Debug: 107 722 tcl.c:1259 handle_flash_bank_command(): 'at91samd' driver usage field missing
Info : 108 765 server.c:311 add_service(): Listening on port 6666 for tcl connections
Info : 109 771 server.c:311 add_service(): Listening on port 4444 for telnet connections
Debug: 110 776 command.c:146 script_debug(): command - init
Debug: 112 779 command.c:146 script_debug(): command - target init
Debug: 114 783 command.c:146 script_debug(): command - target names
Debug: 115 788 command.c:146 script_debug(): command - at91samd21g18.cpu cget -event gdb-flash-erase-start
Debug: 116 793 command.c:146 script_debug(): command - at91samd21g18.cpu configure -event gdb-flash-erase-start reset init
Debug: 117 801 command.c:146 script_debug(): command - at91samd21g18.cpu cget -event gdb-flash-write-end
Debug: 118 807 command.c:146 script_debug(): command - at91samd21g18.cpu configure -event gdb-flash-write-end reset halt
Debug: 119 815 command.c:146 script_debug(): command - at91samd21g18.cpu cget -event gdb-attach
Debug: 120 821 command.c:146 script_debug(): command - at91samd21g18.cpu configure -event gdb-attach halt
Debug: 121 828 target.c:1450 handle_target_init_command(): Initializing targets...
Debug: 122 832 hla_target.c:359 adapter_init_target(): adapter_init_target
Debug: 123 837 semihosting_common.c:97 semihosting_common_init():
Debug: 124 841 command.c:352 register_command_handler(): registering 'target_request'...
Debug: 125 846 command.c:352 register_command_handler(): registering 'trace'...
Debug: 126 852 command.c:352 register_command_handler(): registering 'trace'...
Debug: 127 857 command.c:352 register_command_handler(): registering 'fast_load_image'...
Debug: 128 862 command.c:352 register_command_handler(): registering 'fast_load'...
Debug: 129 866 command.c:352 register_command_handler(): registering 'profile'...
Debug: 130 872 command.c:352 register_command_handler(): registering 'virt2phys'...
Debug: 131 877 command.c:352 register_command_handler(): registering 'reg'...
Debug: 132 882 command.c:352 register_command_handler(): registering 'poll'...
Debug: 133 886 command.c:352 register_command_handler(): registering 'wait_halt'...
Debug: 134 891 command.c:352 register_command_handler(): registering 'halt'...
Debug: 135 896 command.c:352 register_command_handler(): registering 'resume'...
Debug: 136 901 command.c:352 register_command_handler(): registering 'reset'...
Debug: 137 905 command.c:352 register_command_handler(): registering 'soft_reset_halt'...
Debug: 138 911 command.c:352 register_command_handler(): registering 'step'...
Debug: 139 916 command.c:352 register_command_handler(): registering 'mdd'...
Debug: 140 920 command.c:352 register_command_handler(): registering 'mdw'...
Debug: 141 925 command.c:352 register_command_handler(): registering 'mdh'...
Debug: 142 929 command.c:352 register_command_handler(): registering 'mdb'...
Debug: 143 934 command.c:352 register_command_handler(): registering 'mwd'...
Debug: 144 939 command.c:352 register_command_handler(): registering 'mww'...
Debug: 145 944 command.c:352 register_command_handler(): registering 'mwh'...
Debug: 146 949 command.c:352 register_command_handler(): registering 'mwb'...
Debug: 147 953 command.c:352 register_command_handler(): registering 'mbatch'...
Debug: 148 958 command.c:352 register_command_handler(): registering 'bp'...
Debug: 149 963 command.c:352 register_command_handler(): registering 'rbp'...
Debug: 150 968 command.c:352 register_command_handler(): registering 'wp'...
Debug: 151 972 command.c:352 register_command_handler(): registering 'rwp'...
Debug: 152 977 command.c:352 register_command_handler(): registering 'load_image'...
Debug: 153 983 command.c:352 register_command_handler(): registering 'dump_image'...
Debug: 154 988 command.c:352 register_command_handler(): registering 'verify_image_checksum'...
Debug: 155 994 command.c:352 register_command_handler(): registering 'verify_image'...
Debug: 156 999 command.c:352 register_command_handler(): registering 'test_image'...
Debug: 157 1004 command.c:352 register_command_handler(): registering 'reset_nag'...
Debug: 158 1009 command.c:352 register_command_handler(): registering 'ps'...
Debug: 159 1014 command.c:352 register_command_handler(): registering 'test_mem_access'...
Debug: 160 1019 command.c:352 register_command_handler(): registering 'report_flash_progress'...
Debug: 161 1025 command.c:352 register_command_handler(): registering 'run_until_stop_fast'...
Debug: 162 1031 command.c:352 register_command_handler(): registering 'wait_for_stop'...
Debug: 163 1037 hla_interface.c:109 hl_interface_init(): hl_interface_init
Debug: 164 1041 hla_layout.c:87 hl_layout_init(): hl_layout_init
Debug: 165 1044 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 166 1049 core.c:1789 adapter_khz_to_speed(): have interface set up
Debug: 167 1055 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 168 1060 core.c:1789 adapter_khz_to_speed(): have interface set up
Info : 169 1065 core.c:1565 adapter_init(): clock speed 400 kHz
Debug: 170 1068 openocd.c:141 handle_init_command(): Debug Adapter init complete
Debug: 171 1074 command.c:146 script_debug(): command - transport init
Debug: 173 1078 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 174 1082 hla_transport.c:152 hl_transport_init(): hl_transport_init
Debug: 175 1087 hla_transport.c:169 hl_transport_init(): current transport hla_swd
Debug: 176 1091 hla_interface.c:42 hl_interface_open(): hl_interface_open
Debug: 177 1096 hla_layout.c:40 hl_layout_open(): hl_layout_open
Debug: 178 1100 stlink_usb.c:2797 stlink_usb_open(): stlink_usb_open
Debug: 179 1105 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3744 serial:
Debug: 180 1110 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3748 serial:
Debug: 181 1116 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374b serial:
Debug: 182 1122 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374d serial:
Debug: 183 1127 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374e serial:
Debug: 184 1134 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374f serial:
Debug: 185 1140 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3752 serial:
Debug: 186 1146 stlink_usb.c:2811 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3753 serial:
Info : 187 1285 stlink_usb.c:1098 stlink_usb_version(): STLINK V2J37S7 (API v2) VID:PID 0483:3748
Debug: 188 1291 stlink_usb.c:1319 stlink_usb_exit_mode(): MODE: 0x02
Info : 189 1298 stlink_usb.c:1130 stlink_usb_check_voltage(): Target voltage: 3.116142
Debug: 190 1304 stlink_usb.c:1387 stlink_usb_init_mode(): MODE: 0x01
Debug: 191 1308 stlink_usb.c:2584 stlink_dump_speed_map(): Supported clock speeds are:
Debug: 192 1314 stlink_usb.c:2587 stlink_dump_speed_map(): 4000 kHz
Debug: 193 1317 stlink_usb.c:2587 stlink_dump_speed_map(): 1800 kHz
Debug: 194 1322 stlink_usb.c:2587 stlink_dump_speed_map(): 1200 kHz
Debug: 195 1326 stlink_usb.c:2587 stlink_dump_speed_map(): 950 kHz
Debug: 196 1330 stlink_usb.c:2587 stlink_dump_speed_map(): 480 kHz
Debug: 197 1334 stlink_usb.c:2587 stlink_dump_speed_map(): 240 kHz
Debug: 198 1338 stlink_usb.c:2587 stlink_dump_speed_map(): 125 kHz
Debug: 199 1343 stlink_usb.c:2587 stlink_dump_speed_map(): 100 kHz
Debug: 200 1347 stlink_usb.c:2587 stlink_dump_speed_map(): 50 kHz
Debug: 201 1351 stlink_usb.c:2587 stlink_dump_speed_map(): 25 kHz
Debug: 202 1355 stlink_usb.c:2587 stlink_dump_speed_map(): 15 kHz
Debug: 203 1359 stlink_usb.c:2587 stlink_dump_speed_map(): 5 kHz
Debug: 204 1371 stlink_usb.c:1446 stlink_usb_init_mode(): MODE: 0x02
Debug: 205 1375 stlink_usb.c:3042 stlink_usb_init_access_port(): init ap_num = 0
Debug: 206 1386 stlink_usb.c:3209 stlink_usb_open_ap(): AP 0 enabled
Debug: 207 1396 stlink_usb.c:2968 stlink_usb_open(): Using TAR autoincrement: 1024
Debug: 208 1403 core.c:640 adapter_system_reset(): SRST line released
Debug: 209 1407 hla_interface.c:67 hl_interface_init_target(): hl_interface_init_target
Debug: 210 1415 stlink_usb.c:1679 stlink_usb_idcode(): IDCODE: 0x0BC11477
Debug: 211 1420 command.c:146 script_debug(): command - dap init
Debug: 214 1424 arm_dap.c:106 dap_init_all(): Initializing all DAPs ...
Debug: 215 1428 openocd.c:158 handle_init_command(): Examining targets...
Debug: 216 1432 target.c:1638 target_call_event_callbacks(): target event 19 (examine-start) for core at91samd21g18.cpu
Debug: 217 1440 hla_target.c:769 adapter_read_memory(): adapter_read_memory 0xe000ed00 4 1
Debug: 218 1450 target.c:2406 target_read_u32(): address: 0xe000ed00, value: 0x410cc601
Debug: 219 1456 cortex_m.c:2222 cortex_m_examine(): Cortex-M0 r0p1 processor detected
Debug: 220 1462 cortex_m.c:2233 cortex_m_examine(): cpuid: 0x410cc601
Debug: 221 1466 hla_target.c:769 adapter_read_memory(): adapter_read_memory 0xe000edf0 4 1
Debug: 222 1492 target.c:2406 target_read_u32(): address: 0xe000edf0, value: 0x02000001
Debug: 223 1497 target.c:2494 target_write_u32(): address: 0xe000edfc, value: 0x01000000
Debug: 224 1503 hla_target.c:784 adapter_write_memory(): adapter_write_memory 0xe000edfc 4 1
Debug: 225 1515 hla_target.c:769 adapter_read_memory(): adapter_read_memory 0xe0002000 4 1
Debug: 226 1527 target.c:2406 target_read_u32(): address: 0xe0002000, value: 0x00000040
Debug: 227 1533 target.c:2494 target_write_u32(): address: 0xe0002008, value: 0x00000000
Debug: 228 1538 hla_target.c:784 adapter_write_memory(): adapter_write_memory 0xe0002008 4 1
Debug: 229 1550 target.c:2494 target_write_u32(): address: 0xe000200c, value: 0x00000000
Debug: 230 1556 hla_target.c:784 adapter_write_memory(): adapter_write_memory 0xe000200c 4 1
Debug: 231 1569 target.c:2494 target_write_u32(): address: 0xe0002010, value: 0x00000000
Debug: 232 1575 hla_target.c:784 adapter_write_memory(): adapter_write_memory 0xe0002010 4 1
Debug: 233 1587 target.c:2494 target_write_u32(): address: 0xe0002014, value: 0x00000000
Debug: 234 1592 hla_target.c:784 adapter_write_memory(): adapter_write_memory 0xe0002014 4 1
Debug: 235 1603 cortex_m.c:2338 cortex_m_examine(): FPB fpcr 0x40, numcode 4, numlit 0
Debug: 236 1609 hla_target.c:769 adapter_read_memory(): adapter_read_memory 0xe0001000 4 1
Debug: 237 1620 target.c:2406 target_read_u32(): address: 0xe0001000, value: 0x20000000
Debug: 238 1625 cortex_m.c:2059 cortex_m_dwt_setup(): DWT_CTRL: 0x20000000
Debug: 239 1630 hla_target.c:769 adapter_read_memory(): adapter_read_memory 0xe0001fbc 4 1
Debug: 240 1641 target.c:2406 target_read_u32(): address: 0xe0001fbc, value: 0x00000000
Debug: 241 1646 cortex_m.c:2066 cortex_m_dwt_setup(): DWT_DEVARCH: 0x0
Debug: 242 1650 target.c:2494 target_write_u32(): address: 0xe0001028, value: 0x00000000
Debug: 243 1655 hla_target.c:784 adapter_write_memory(): adapter_write_memory 0xe0001028 4 1
Debug: 244 1668 target.c:2494 target_write_u32(): address: 0xe0001038, value: 0x00000000
Debug: 245 1674 hla_target.c:784 adapter_write_memory(): adapter_write_memory 0xe0001038 4 1
Debug: 246 1685 cortex_m.c:2115 cortex_m_dwt_setup(): DWT dwtcr 0x20000000, comp 2, watch/trigger
Info : 247 1692 cortex_m.c:2348 cortex_m_examine(): at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Debug: 248 1699 target.c:1638 target_call_event_callbacks(): target event 21 (examine-end) for core at91samd21g18.cpu
Debug: 249 1707 command.c:146 script_debug(): command - flash init
Debug: 251 1713 tcl.c:1325 handle_flash_init_command(): Initializing flash devices...
Debug: 252 1717 command.c:352 register_command_handler(): registering 'flash'...
Debug: 253 1724 command.c:352 register_command_handler(): registering 'flash'...
Debug: 254 1728 command.c:352 register_command_handler(): registering 'flash'...
Debug: 255 1733 command.c:352 register_command_handler(): registering 'flash'...
Debug: 256 1738 command.c:352 register_command_handler(): registering 'flash'...
Debug: 257 1742 command.c:352 register_command_handler(): registering 'flash'...
Debug: 258 1747 command.c:352 register_command_handler(): registering 'flash'...
Debug: 259 1752 command.c:352 register_command_handler(): registering 'flash'...
Debug: 260 1757 command.c:352 register_command_handler(): registering 'flash'...
Debug: 261 1761 command.c:352 register_command_handler(): registering 'flash'...
Debug: 262 1766 command.c:352 register_command_handler(): registering 'flash'...
Debug: 263 1770 command.c:352 register_command_handler(): registering 'flash'...
Debug: 264 1775 command.c:352 register_command_handler(): registering 'flash'...
Debug: 265 1779 command.c:352 register_command_handler(): registering 'flash'...
Debug: 266 1784 command.c:352 register_command_handler(): registering 'flash'...
Debug: 267 1789 command.c:352 register_command_handler(): registering 'flash'...
Debug: 268 1794 command.c:352 register_command_handler(): registering 'flash'...
Debug: 269 1798 command.c:352 register_command_handler(): registering 'flash'...
Debug: 270 1803 command.c:146 script_debug(): command - nand init
Debug: 272 1810 tcl.c:498 handle_nand_init_command(): Initializing NAND devices...
Debug: 273 1815 command.c:146 script_debug(): command - pld init
Debug: 275 1821 pld.c:206 handle_pld_init_command(): Initializing PLDs...
Info : 276 1826 gdb_server.c:3516 gdb_target_start(): starting gdb server for at91samd21g18.cpu on 3333
Info : 277 1831 server.c:311 add_service(): Listening on port 3333 for gdb connections


Info : 278 126479 server.c:100 add_connection(): accepting 'telnet' connection on tcp/4444
Debug: 279 174816 command.c:146 script_debug(): command - target current
User : 280 180768 command.c:692 command_run_line(): invalid command name "deg"
Debug: 281 186447 command.c:146 script_debug(): command - reg
Debug: 283 186454 target.c:2871 handle_reg_command(): -

The following is the log file of the terminal when “target current” and “reg” command are entered.

Open On-Chip Debugger
> target current
at91samd21g18.cpu
> reg
===== arm v7m registers
(0) r0 (/32)
(1) r1 (/32)
(2) r2 (/32)
(3) r3 (/32)
(4) r4 (/32)
(5) r5 (/32)
(6) r6 (/32)
(7) r7 (/32)
(8) r8 (/32)
(9) r9 (/32)
(10) r10 (/32)
(11) r11 (/32)
(12) r12 (/32)
(13) sp (/32)
(14) lr (/32)
(15) pc (/32)
(16) xPSR (/32)
(17) msp (/32)
(18) psp (/32)
(19) primask (/1)
(20) basepri (/8)
(21) faultmask (/1)
(22) control (/2)
===== Cortex-M DWT registers
>

msfujino,

Thanks for your help. I was able to get it working. I’m embarrassed to say I think it was a case of an unreliable connection between the probe and the target board.

–ken

I’m glad it helped you .