ARMmbed / DAPLink

https://daplink.io
Apache License 2.0
2.33k stars 977 forks source link

fail to debug stm32f1 with jtag mode #757

Closed mttbx closed 3 years ago

mttbx commented 3 years ago

Noticed that I can debug stm32f1 with swd mode.

openocd.cfg:

source [find interface/cmsis-dap.cfg]
transport select jtag
source [find target/stm32f1x.cfg]

telnet_port 7777
gdb_port 8888
tcl_port 9999
init

result:

Debug: 23 3 configuration.c:97 find_file(): found openocd.cfg
Debug: 24 3 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/interface/cmsis-dap.cfg
Debug: 25 3 command.c:146 script_debug(): command - adapter driver cmsis-dap
Debug: 27 3 command.c:352 register_command_handler(): registering 'cmsis-dap'...
Debug: 28 3 command.c:352 register_command_handler(): registering 'cmsis-dap'...
Debug: 29 3 command.c:352 register_command_handler(): registering 'cmsis_dap_vid_pid'...
Debug: 30 3 command.c:352 register_command_handler(): registering 'cmsis_dap_serial'...
Debug: 31 3 command.c:146 script_debug(): command - transport select jtag
Debug: 32 3 command.c:352 register_command_handler(): registering 'jtag_flush_queue_sleep'...
Debug: 33 3 command.c:352 register_command_handler(): registering 'jtag_rclk'...
Debug: 34 3 command.c:352 register_command_handler(): registering 'jtag_ntrst_delay'...
Debug: 35 3 command.c:352 register_command_handler(): registering 'jtag_ntrst_assert_width'...
Debug: 36 3 command.c:352 register_command_handler(): registering 'scan_chain'...
Debug: 37 3 command.c:352 register_command_handler(): registering 'runtest'...
Debug: 38 3 command.c:352 register_command_handler(): registering 'irscan'...
Debug: 39 3 command.c:352 register_command_handler(): registering 'verify_ircapture'...
Debug: 40 3 command.c:352 register_command_handler(): registering 'verify_jtag'...
Debug: 41 3 command.c:352 register_command_handler(): registering 'tms_sequence'...
Debug: 42 3 command.c:352 register_command_handler(): registering 'wait_srst_deassert'...
Debug: 43 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 44 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 45 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 46 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 47 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 48 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 49 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 50 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 51 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 52 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 53 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 54 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 55 3 command.c:352 register_command_handler(): registering 'jtag'...
Debug: 56 3 command.c:352 register_command_handler(): registering 'svf'...
Debug: 57 3 command.c:352 register_command_handler(): registering 'xsvf'...
Debug: 58 4 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/stm32f1x.cfg
Debug: 59 4 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/target/swj-dp.tcl
Debug: 60 4 command.c:146 script_debug(): command - transport select
Debug: 61 4 configuration.c:97 find_file(): found /usr/local/bin/../share/openocd/scripts/mem_helper.tcl
Debug: 62 4 command.c:146 script_debug(): command - add_usage_text mrw address
Debug: 64 4 command.c:1123 help_add_command(): added 'mrw' help text
Debug: 65 4 command.c:146 script_debug(): command - add_help_text mrw Returns value of word in memory.
Debug: 67 4 command.c:1136 help_add_command(): added 'mrw' help text
Debug: 68 4 command.c:146 script_debug(): command - add_usage_text mrh address
Debug: 70 4 command.c:1123 help_add_command(): added 'mrh' help text
Debug: 71 4 command.c:146 script_debug(): command - add_help_text mrh Returns value of halfword in memory.
Debug: 73 4 command.c:1136 help_add_command(): added 'mrh' help text
Debug: 74 4 command.c:146 script_debug(): command - add_usage_text mrb address
Debug: 76 4 command.c:1123 help_add_command(): added 'mrb' help text
Debug: 77 4 command.c:146 script_debug(): command - add_help_text mrb Returns value of byte in memory.
Debug: 79 4 command.c:1136 help_add_command(): added 'mrb' help text
Debug: 80 4 command.c:146 script_debug(): command - add_usage_text mmw address setbits clearbits
Debug: 82 4 command.c:1123 help_add_command(): added 'mmw' help text
Debug: 83 4 command.c:146 script_debug(): command - add_help_text mmw Modify word in memory. new_val = (old_val & ~clearbits) | setbits;
Debug: 85 4 command.c:1136 help_add_command(): added 'mmw' help text
Debug: 86 4 command.c:146 script_debug(): command - transport select
Debug: 87 4 command.c:146 script_debug(): command - transport select
Debug: 88 4 command.c:146 script_debug(): command - transport select
Debug: 89 4 command.c:146 script_debug(): command - jtag newtap stm32f1x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x3ba00477
Debug: 90 4 tcl.c:566 jim_newtap_cmd(): Creating New Tap, Chip: stm32f1x, Tap: cpu, Dotted: stm32f1x.cpu, 8 params
Debug: 91 4 tcl.c:591 jim_newtap_cmd(): Processing option: -irlen
Debug: 92 4 tcl.c:591 jim_newtap_cmd(): Processing option: -ircapture
Debug: 93 4 tcl.c:591 jim_newtap_cmd(): Processing option: -irmask
Debug: 94 5 tcl.c:591 jim_newtap_cmd(): Processing option: -expected-id
Debug: 95 5 core.c:1484 jtag_tap_init(): Created Tap: stm32f1x.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf
Debug: 96 5 command.c:146 script_debug(): command - dap create stm32f1x.dap -chain-position stm32f1x.cpu
Debug: 97 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 98 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 99 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 100 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 101 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 102 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 103 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 104 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 105 5 command.c:352 register_command_handler(): registering 'stm32f1x.dap'...
Debug: 106 5 command.c:146 script_debug(): command - transport select
Debug: 107 5 command.c:146 script_debug(): command - jtag newtap stm32f1x bs -irlen 5
Debug: 108 5 tcl.c:566 jim_newtap_cmd(): Creating New Tap, Chip: stm32f1x, Tap: bs, Dotted: stm32f1x.bs, 2 params
Debug: 109 5 tcl.c:591 jim_newtap_cmd(): Processing option: -irlen
Debug: 110 5 core.c:1484 jtag_tap_init(): Created Tap: stm32f1x.bs @ abs position 1, irlen 5, capture: 0x1 mask: 0x3
Debug: 111 5 command.c:146 script_debug(): command - target create stm32f1x.cpu cortex_m -endian little -dap stm32f1x.dap
Debug: 112 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 113 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 114 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 115 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 116 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 117 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 118 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 119 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 120 5 command.c:352 register_command_handler(): registering 'arm'...
Debug: 121 5 command.c:352 register_command_handler(): registering 'tpiu'...
Debug: 122 5 command.c:352 register_command_handler(): registering 'itm'...
Debug: 123 5 command.c:352 register_command_handler(): registering 'itm'...
Debug: 124 5 command.c:352 register_command_handler(): registering 'cortex_m'...
Debug: 125 5 command.c:352 register_command_handler(): registering 'cortex_m'...
Debug: 126 5 command.c:352 register_command_handler(): registering 'cortex_m'...
Debug: 127 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 128 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 129 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 130 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 131 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 132 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 133 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 134 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 135 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 136 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 137 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 138 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 139 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 140 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 141 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 142 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 143 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 144 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 145 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 146 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 147 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 148 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 149 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 150 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 151 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 152 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 153 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 154 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 155 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 156 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 157 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 158 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 159 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 160 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 161 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 162 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 163 5 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 164 6 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 165 6 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 166 6 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 167 6 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 168 6 command.c:352 register_command_handler(): registering 'stm32f1x.cpu'...
Debug: 169 6 command.c:146 script_debug(): command - stm32f1x.cpu configure -work-area-phys 0x20000000 -work-area-size 0x1000 -work-area-backup 0
Debug: 170 6 target.c:2004 target_free_all_working_areas_restore(): freeing all working areas
Debug: 171 6 target.c:2004 target_free_all_working_areas_restore(): freeing all working areas
Debug: 172 6 target.c:2004 target_free_all_working_areas_restore(): freeing all working areas
Debug: 173 6 command.c:146 script_debug(): command - flash bank stm32f1x.flash stm32f1x 0x08000000 0 0 0 stm32f1x.cpu
Debug: 175 6 command.c:352 register_command_handler(): registering 'stm32f1x'...
Debug: 176 6 command.c:352 register_command_handler(): registering 'stm32f1x'...
Debug: 177 6 command.c:352 register_command_handler(): registering 'stm32f1x'...
Debug: 178 6 command.c:352 register_command_handler(): registering 'stm32f1x'...
Debug: 179 6 command.c:352 register_command_handler(): registering 'stm32f1x'...
Debug: 180 6 command.c:352 register_command_handler(): registering 'stm32f1x'...
Debug: 181 6 tcl.c:1259 handle_flash_bank_command(): 'stm32f1x' driver usage field missing
Debug: 182 6 command.c:146 script_debug(): command - adapter speed 1000
Debug: 184 6 core.c:1822 jtag_config_khz(): handle jtag khz
Debug: 185 6 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 186 6 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 187 6 command.c:146 script_debug(): command - adapter srst delay 100
Debug: 189 6 command.c:146 script_debug(): command - transport select
Debug: 190 6 command.c:146 script_debug(): command - jtag_ntrst_delay 100
Debug: 192 6 command.c:146 script_debug(): command - reset_config srst_nogate
Debug: 194 6 command.c:146 script_debug(): command - transport select
Debug: 195 6 command.c:146 script_debug(): command - cortex_m reset_config sysresetreq
Debug: 197 6 command.c:146 script_debug(): command - stm32f1x.cpu configure -event examine-end 
    # DBGMCU_CR |= DBG_WWDG_STOP | DBG_IWDG_STOP |
    #              DBG_STANDBY | DBG_STOP | DBG_SLEEP
    mmw 0xE0042004 0x00000307 0

Debug: 198 6 command.c:146 script_debug(): command - stm32f1x.cpu configure -event trace-config 
    # Set TRACE_IOEN; TRACE_MODE is set to async; when using sync
    # change this value accordingly to configure trace pins
    # assignment
    mmw 0xE0042004 0x00000020 0

Debug: 199 6 command.c:146 script_debug(): command - telnet_port 7777
Debug: 201 6 command.c:146 script_debug(): command - gdb_port 8888
Debug: 203 6 command.c:146 script_debug(): command - tcl_port 9999
Debug: 205 6 command.c:146 script_debug(): command - init
Debug: 207 6 command.c:146 script_debug(): command - target init
Debug: 209 6 command.c:146 script_debug(): command - target names
Debug: 210 6 command.c:146 script_debug(): command - stm32f1x.cpu cget -event gdb-flash-erase-start
Debug: 211 6 command.c:146 script_debug(): command - stm32f1x.cpu configure -event gdb-flash-erase-start reset init
Debug: 212 6 command.c:146 script_debug(): command - stm32f1x.cpu cget -event gdb-flash-write-end
Debug: 213 6 command.c:146 script_debug(): command - stm32f1x.cpu configure -event gdb-flash-write-end reset halt
Debug: 214 6 command.c:146 script_debug(): command - stm32f1x.cpu cget -event gdb-attach
Debug: 215 6 command.c:146 script_debug(): command - stm32f1x.cpu configure -event gdb-attach halt 1000
Debug: 216 7 target.c:1465 handle_target_init_command(): Initializing targets...
Debug: 217 7 semihosting_common.c:97 semihosting_common_init():  
Debug: 218 7 command.c:352 register_command_handler(): registering 'target_request'...
Debug: 219 7 command.c:352 register_command_handler(): registering 'trace'...
Debug: 220 7 command.c:352 register_command_handler(): registering 'trace'...
Debug: 221 7 command.c:352 register_command_handler(): registering 'fast_load_image'...
Debug: 222 7 command.c:352 register_command_handler(): registering 'fast_load'...
Debug: 223 7 command.c:352 register_command_handler(): registering 'profile'...
Debug: 224 7 command.c:352 register_command_handler(): registering 'virt2phys'...
Debug: 225 7 command.c:352 register_command_handler(): registering 'reg'...
Debug: 226 7 command.c:352 register_command_handler(): registering 'poll'...
Debug: 227 7 command.c:352 register_command_handler(): registering 'wait_halt'...
Debug: 228 7 command.c:352 register_command_handler(): registering 'halt'...
Debug: 229 7 command.c:352 register_command_handler(): registering 'resume'...
Debug: 230 7 command.c:352 register_command_handler(): registering 'reset'...
Debug: 231 7 command.c:352 register_command_handler(): registering 'soft_reset_halt'...
Debug: 232 7 command.c:352 register_command_handler(): registering 'step'...
Debug: 233 7 command.c:352 register_command_handler(): registering 'mdd'...
Debug: 234 7 command.c:352 register_command_handler(): registering 'mdw'...
Debug: 235 7 command.c:352 register_command_handler(): registering 'mdh'...
Debug: 236 7 command.c:352 register_command_handler(): registering 'mdb'...
Debug: 237 7 command.c:352 register_command_handler(): registering 'mwd'...
Debug: 238 7 command.c:352 register_command_handler(): registering 'mww'...
Debug: 239 7 command.c:352 register_command_handler(): registering 'mwh'...
Debug: 240 7 command.c:352 register_command_handler(): registering 'mwb'...
Debug: 241 7 command.c:352 register_command_handler(): registering 'bp'...
Debug: 242 7 command.c:352 register_command_handler(): registering 'rbp'...
Debug: 243 7 command.c:352 register_command_handler(): registering 'wp'...
Debug: 244 7 command.c:352 register_command_handler(): registering 'rwp'...
Debug: 245 7 command.c:352 register_command_handler(): registering 'load_image'...
Debug: 246 7 command.c:352 register_command_handler(): registering 'dump_image'...
Debug: 247 7 command.c:352 register_command_handler(): registering 'verify_image_checksum'...
Debug: 248 7 command.c:352 register_command_handler(): registering 'verify_image'...
Debug: 249 7 command.c:352 register_command_handler(): registering 'test_image'...
Debug: 250 7 command.c:352 register_command_handler(): registering 'reset_nag'...
Debug: 251 7 command.c:352 register_command_handler(): registering 'ps'...
Debug: 252 7 command.c:352 register_command_handler(): registering 'test_mem_access'...
Info : 253 72 cmsis_dap_usb.c:870 cmsis_dap_get_caps_info(): CMSIS-DAP: SWD  Supported
Info : 254 72 cmsis_dap_usb.c:872 cmsis_dap_get_caps_info(): CMSIS-DAP: JTAG Supported
Info : 255 74 cmsis_dap_usb.c:850 cmsis_dap_get_version_info(): CMSIS-DAP: FW Version = 0254
Info : 256 76 cmsis_dap_usb.c:835 cmsis_dap_get_serial_info(): CMSIS-DAP: Serial# = 0123456789abcdef0123456789abcd@
Info : 257 78 cmsis_dap_usb.c:1003 cmsis_dap_init(): CMSIS-DAP: Interface Initialised (JTAG)
Debug: 258 80 cmsis_dap_usb.c:1035 cmsis_dap_init(): CMSIS-DAP: Packet Size = 64
Debug: 259 82 cmsis_dap_usb.c:1048 cmsis_dap_init(): CMSIS-DAP: Packet Count = 1
Debug: 260 82 cmsis_dap_usb.c:1051 cmsis_dap_init(): Allocating FIFO for 1 pending HID requests
Info : 261 84 cmsis_dap_usb.c:885 cmsis_dap_get_status(): SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 0
Info : 262 92 cmsis_dap_usb.c:1105 cmsis_dap_init(): CMSIS-DAP: Interface ready
Debug: 263 92 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 264 92 core.c:1789 adapter_khz_to_speed(): have interface set up
Debug: 265 94 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 266 94 core.c:1789 adapter_khz_to_speed(): have interface set up
Info : 267 94 core.c:1565 adapter_init(): clock speed 1000 kHz
Debug: 268 94 openocd.c:141 handle_init_command(): Debug Adapter init complete
Debug: 269 94 command.c:146 script_debug(): command - transport init
Debug: 271 94 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 272 96 core.c:830 jtag_add_reset(): SRST line released
Debug: 273 96 core.c:855 jtag_add_reset(): TRST line released
Debug: 274 96 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 275 299 command.c:146 script_debug(): command - jtag arp_init
Debug: 276 299 core.c:1578 jtag_init_inner(): Init JTAG chain
Debug: 277 299 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Info : 278 299 cmsis_dap_usb.c:1158 cmsis_dap_execute_tlr_reset(): cmsis-dap JTAG TLR_RESET
Debug: 279 301 core.c:1243 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 280 301 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Info : 281 305 cmsis_dap_usb.c:1158 cmsis_dap_execute_tlr_reset(): cmsis-dap JTAG TLR_RESET
Info : 282 307 core.c:1293 jtag_examine_chain(): TAP stm32f1x.cpu does not have valid IDCODE (idcode=0x4100410c)
Info : 283 307 core.c:1293 jtag_examine_chain(): TAP stm32f1x.bs does not have valid IDCODE (idcode=0x20802086)
Debug: 284 307 core.c:1484 jtag_tap_init(): Created Tap: auto0.tap @ abs position 2, irlen 0, capture: 0x1 mask: 0x3
Info : 285 307 core.c:1142 jtag_examine_chain_display(): JTAG tap: auto0.tap tap/device found: 0x10401043 (mfg: 0x021 (Lattice Semi.), part: 0x0401, ver: 0x1)
Debug: 286 307 core.c:1484 jtag_tap_init(): Created Tap: auto1.tap @ abs position 3, irlen 0, capture: 0x1 mask: 0x3
Info : 287 307 core.c:1293 jtag_examine_chain(): TAP auto1.tap does not have valid IDCODE (idcode=0x401040)
Debug: 288 307 core.c:1484 jtag_tap_init(): Created Tap: auto2.tap @ abs position 4, irlen 0, capture: 0x1 mask: 0x3
Info : 289 307 core.c:1293 jtag_examine_chain(): TAP auto2.tap does not have valid IDCODE (idcode=0x200820)
Debug: 290 307 core.c:1484 jtag_tap_init(): Created Tap: auto3.tap @ abs position 5, irlen 0, capture: 0x1 mask: 0x3
Info : 291 307 core.c:1293 jtag_examine_chain(): TAP auto3.tap does not have valid IDCODE (idcode=0x100410)
Debug: 292 307 core.c:1484 jtag_tap_init(): Created Tap: auto4.tap @ abs position 6, irlen 0, capture: 0x1 mask: 0x3
Info : 293 307 core.c:1293 jtag_examine_chain(): TAP auto4.tap does not have valid IDCODE (idcode=0x80208)
Debug: 294 307 core.c:1484 jtag_tap_init(): Created Tap: auto5.tap @ abs position 7, irlen 0, capture: 0x1 mask: 0x3
Info : 295 307 core.c:1293 jtag_examine_chain(): TAP auto5.tap does not have valid IDCODE (idcode=0x40104)
Debug: 296 307 core.c:1484 jtag_tap_init(): Created Tap: auto6.tap @ abs position 8, irlen 0, capture: 0x1 mask: 0x3
Info : 297 307 core.c:1293 jtag_examine_chain(): TAP auto6.tap does not have valid IDCODE (idcode=0x20082)
Debug: 298 307 core.c:1484 jtag_tap_init(): Created Tap: auto7.tap @ abs position 9, irlen 0, capture: 0x1 mask: 0x3
Info : 299 307 core.c:1142 jtag_examine_chain_display(): JTAG tap: auto7.tap tap/device found: 0x00010041 (mfg: 0x020 (STMicroelectronics), part: 0x0010, ver: 0x0)
Debug: 300 307 core.c:1484 jtag_tap_init(): Created Tap: auto8.tap @ abs position 10, irlen 0, capture: 0x1 mask: 0x3
Info : 301 307 core.c:1142 jtag_examine_chain_display(): JTAG tap: auto8.tap tap/device found: 0x00010041 (mfg: 0x020 (STMicroelectronics), part: 0x0010, ver: 0x0)
Debug: 302 307 core.c:1484 jtag_tap_init(): Created Tap: auto9.tap @ abs position 11, irlen 0, capture: 0x1 mask: 0x3
Debug: 303 307 jep106.c:33 jep106_manufacturer(): BUG: Caller passed out-of-range JEP106 ID!
Info : 304 307 core.c:1142 jtag_examine_chain_display(): JTAG tap: auto9.tap tap/device found: 0xff800001 (mfg: 0x000 (<invalid>), part: 0xf800, ver: 0xf)
Warn : 305 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 168 0x80ffffff
Warn : 306 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 264 0xffffff80
Warn : 307 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 296 0x08ffffff
Warn : 308 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 328 0xffffff80
Warn : 309 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 392 0xffff80ff
Warn : 310 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 456 0xff80ffff
Warn : 311 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 520 0x80ffffff
Warn : 312 307 core.c:1179 jtag_examine_chain_end(): Unexpected idcode after end of chain: 616 0xffffff80
Error: 313 307 core.c:1319 jtag_examine_chain(): double-check your JTAG setup (interface, speed, ...)
Error: 314 307 core.c:1623 jtag_init_inner(): Trying to use configured scan chain anyway...
Debug: 315 307 core.c:1374 jtag_validate_ircapture(): IR capture validation scan
Error: 316 311 core.c:1423 jtag_validate_ircapture(): stm32f1x.cpu: IR capture error; saw 0x0c not 0x01
Debug: 317 311 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Info : 318 311 cmsis_dap_usb.c:1158 cmsis_dap_execute_tlr_reset(): cmsis-dap JTAG TLR_RESET
Warn : 319 313 core.c:1646 jtag_init_inner(): Bypassing JTAG setup events due to errors
Debug: 320 313 command.c:146 script_debug(): command - dap init
Debug: 322 313 arm_dap.c:106 dap_init_all(): Initializing all DAPs ...
Debug: 323 313 arm_adi_v5.c:653 dap_dp_init(): stm32f1x.dap
Debug: 324 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 325 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 326 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 327 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 328 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 329 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 330 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 331 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 332 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Debug: 333 313 cmsis_dap_usb.c:1405 cmsis_dap_execute_scan(): discarding trailing empty field
Error: 334 317 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (5) in DAP response
Error: 335 323 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 336 329 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 337 335 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 338 341 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 339 347 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 340 353 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 341 359 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 342 365 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 343 371 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 344 377 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 345 383 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 346 389 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 347 395 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 348 401 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 349 407 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 350 413 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 351 419 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 352 425 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 353 431 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 354 437 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 355 443 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 356 449 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 357 455 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 358 461 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 359 467 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 360 473 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 361 479 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 362 485 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Error: 363 491 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Debug: 364 495 arm_adi_v5.c:698 dap_dp_init(): DAP: wait CDBGPWRUPACK
Debug: 365 495 arm_adi_v5.h:506 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000
Error: 366 503 adi_v5_jtag.c:425 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
Debug: 367 507 command.c:626 run_command(): Command 'dap init' failed with error code -107
User : 368 507 command.c:692 command_run_line(): 
Debug: 369 507 command.c:626 run_command(): Command 'init' failed with error code -4
User : 370 507 command.c:692 command_run_line(): 
Info : 371 507 server.c:311 add_service(): Listening on port 9999 for tcl connections
Info : 372 507 server.c:311 add_service(): Listening on port 7777 for telnet connections
Debug: 373 507 command.c:146 script_debug(): command - init
mttbx commented 3 years ago

pyocd outptus:

Enter the number of the debug probe to connect:
> 1
0001813:WARNING:mbed_board:Unsupported board found 29AA
0001813:INFO:board:Target type is cortex_m
0004226:ERROR:__main__:uncaught exception: 
Traceback (most recent call last):
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/cmsis_dap_probe.py", line 251, in read_dp_result_callback
    return result()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 679, in read_reg_cb
    res = transfer.get_result()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 119, in get_result
    self.daplink.flush()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 610, in flush
    self._read_packet()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 765, in _read_packet
    decoded_data = cmd.decode_data(raw_data)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 417, in decode_data
    data = self._decode_transfer_block_data(data)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 384, in _decode_transfer_block_data
    raise DAPAccessIntf.TransferError()
pyocd.probe.pydapaccess.dap_access_api.DAPAccessIntf.TransferError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 95, in init
    self.read_id_code()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 105, in read_id_code
    self.dpidr = self.read_reg(DP_IDCODE)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 119, in read_reg
    return self.read_dp(addr, now)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 234, in read_dp
    return read_dp_cb()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 225, in read_dp_cb
    result = result_cb()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/cmsis_dap_probe.py", line 254, in read_dp_result_callback
    six.raise_from(self._convert_exception(error), error)
  File "<string>", line 3, in raise_from
pyocd.core.exceptions.TransferError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/cmsis_dap_probe.py", line 251, in read_dp_result_callback
    return result()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 679, in read_reg_cb
    res = transfer.get_result()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 119, in get_result
    self.daplink.flush()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 610, in flush
    self._read_packet()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 765, in _read_packet
    decoded_data = cmd.decode_data(raw_data)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 417, in decode_data
    data = self._decode_transfer_block_data(data)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 384, in _decode_transfer_block_data
    raise DAPAccessIntf.TransferError()
pyocd.probe.pydapaccess.dap_access_api.DAPAccessIntf.TransferError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/__main__.py", line 298, in run
    self._commands[self._args.cmd]()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/__main__.py", line 443, in do_gdbserver
    session = ConnectHelper.session_with_chosen_probe(
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/core/helpers.py", line 199, in session_with_chosen_probe
    session.open()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/core/session.py", line 157, in open
    self._board.init()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/board/board.py", line 52, in init
    self.target.init()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/core/coresight_target.py", line 136, in init
    seq.invoke()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/utility/sequencer.py", line 189, in invoke
    resultSequence = call()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 100, in init
    self.read_id_code()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 105, in read_id_code
    self.dpidr = self.read_reg(DP_IDCODE)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 119, in read_reg
    return self.read_dp(addr, now)
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 234, in read_dp
    return read_dp_cb()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/coresight/dap.py", line 225, in read_dp_cb
    result = result_cb()
  File "/home/xx/.local/lib/python3.8/site-packages/pyocd/probe/cmsis_dap_probe.py", line 254, in read_dp_result_callback
    six.raise_from(self._convert_exception(error), error)
  File "<string>", line 3, in raise_from
pyocd.core.exceptions.TransferError
mttbx commented 3 years ago

I can debug it with jlink

Open On-Chip Debugger 0.10.0+dev-01405-gc56aa667c (2020-11-30-17:08)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : J-Link V9 compiled Oct 25 2018 11:46:07
Info : Hardware version: 9.40
Info : VTarget = 3.158 V
Info : clock speed 1000 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x16410041 (mfg: 0x020 (STMicroelectronics), part: 0x6410, ver: 0x1)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 8888
Info : Listening on port 8888 for gdb connections
Info : Listening on port 9999 for tcl connections
Info : Listening on port 7777 for telnet connections
mttbx commented 3 years ago

So what's the issue, can you help me ?

mttbx commented 3 years ago

solved.

lilang1746 commented 3 years ago

你好,请问你是怎么解决的

lilang1746 commented 3 years ago

How did you solve it?