OpenOCD/JTAG working incorrectly with Freedom SoC


(Santiago Gutierrez) #1

Hi All,

I had posted a question earlier about help with Freedom running on a Digilent Genesys board. My team and I are trying to get a similar board up and running with Freedom and OpenOCD. We are using a minimodule to try and interface with the FPGA. When I run openocd this is the output I get from it.

Open On-Chip Debugger 0.10.0+dev-00129-gfd9de02 (2018-03-12-14:20)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Ready for Remote Connections..
Info : Listening on port 6665 for tcl connections
Info : Listening on port 4443 for telnet connections
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: riscv.cpu: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Unsupported DTM version: 15
Info : Listening on port 3334 for gdb connections

This is the same startup command with the “-d” flag passed in.

Open On-Chip Debugger 0.10.0+dev-00129-gfd9de02 (2018-03-12-14:20)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 13 3 command.c:544 command_print(): debug_level: 3
Debug: 14 3 options.c:184 add_default_dirs(): bindir=/usr/local/bin
Debug: 15 3 options.c:185 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
Debug: 16 3 options.c:186 add_default_dirs(): exepath=/usr/local/bin
Debug: 17 3 options.c:187 add_default_dirs(): bin2data=../share/openocd
Debug: 18 3 configuration.c:42 add_script_search_dir(): adding /home/sgutierrez/.openocd
Debug: 19 3 configuration.c:42 add_script_search_dir(): adding /usr/local/bin/../share/openocd/site
Debug: 20 3 configuration.c:42 add_script_search_dir(): adding /usr/local/bin/../share/openocd/scripts
Debug: 21 3 configuration.c:82 find_file(): found /usr/local/bin/../share/openocd/scripts/interface/ftdi/minimodule.cfg
Debug: 22 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface ftdi
Debug: 23 3 command.c:143 script_debug(): command - interface ocd_interface ftdi
Debug: 25 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_device_desc'...
Debug: 26 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_serial'...
Debug: 27 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_location'...
Debug: 28 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_channel'...
Debug: 29 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_layout_init'...
Debug: 30 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_layout_signal'...
Debug: 31 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_set_signal'...
Debug: 32 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_get_signal'...
Debug: 33 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_vid_pid'...
Debug: 34 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_tdo_sample_edge'...
Debug: 35 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_device_desc FT2232H MiniModule
Debug: 36 3 command.c:143 script_debug(): command - ftdi_device_desc ocd_ftdi_device_desc FT2232H MiniModule
Debug: 38 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_vid_pid 0x0403 0x6010
Debug: 39 4 command.c:143 script_debug(): command - ftdi_vid_pid ocd_ftdi_vid_pid 0x0403 0x6010
Debug: 41 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_init 0x0008 0x000b
Debug: 42 4 command.c:143 script_debug(): command - ftdi_layout_init ocd_ftdi_layout_init 0x0008 0x000b
Debug: 44 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020
Debug: 45 4 command.c:143 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020
Debug: 47 4 configuration.c:82 find_file(): found viarocket_board.cfg
Debug: 48 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 1000
Debug: 49 4 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 1000
Debug: 51 4 core.c:1693 jtag_config_khz(): handle jtag khz
Debug: 52 4 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 53 4 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 54 4 command.c:544 command_print(): adapter speed: 1000 kHz
Debug: 55 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 56 4 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Info : 57 4 transport.c:286 jim_transport_select(): auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Debug: 58 4 command.c:364 register_command_handler(): registering 'ocd_jtag_flush_queue_sleep'...
Debug: 59 4 command.c:364 register_command_handler(): registering 'ocd_jtag_rclk'...
Debug: 60 4 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 61 4 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_assert_width'...
Debug: 62 4 command.c:364 register_command_handler(): registering 'ocd_scan_chain'...
Debug: 63 4 command.c:364 register_command_handler(): registering 'ocd_jtag_reset'...
Debug: 64 4 command.c:364 register_command_handler(): registering 'ocd_runtest'...
Debug: 65 4 command.c:364 register_command_handler(): registering 'ocd_irscan'...
Debug: 66 4 command.c:364 register_command_handler(): registering 'ocd_verify_ircapture'...
Debug: 67 4 command.c:364 register_command_handler(): registering 'ocd_verify_jtag'...
Debug: 68 4 command.c:364 register_command_handler(): registering 'ocd_tms_sequence'...
Debug: 69 4 command.c:364 register_command_handler(): registering 'ocd_wait_srst_deassert'...
Debug: 70 4 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 71 4 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 72 4 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 73 4 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 74 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 75 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 76 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 77 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 78 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 79 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 80 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 81 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 82 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 83 5 command.c:364 register_command_handler(): registering 'ocd_svf'...
Debug: 84 5 command.c:364 register_command_handler(): registering 'ocd_xsvf'...
Debug: 85 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 86 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 87 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap riscv cpu -irlen 5
Debug: 88 5 command.c:143 script_debug(): command - ocd_jtag ocd_jtag newtap riscv cpu -irlen 5
Debug: 89 5 tcl.c:549 jim_newtap_cmd(): Creating New Tap, Chip: riscv, Tap: cpu, Dotted: riscv.cpu, 2 params
Debug: 90 5 tcl.c:573 jim_newtap_cmd(): Processing option: -irlen
Debug: 91 5 core.c:1366 jtag_tap_init(): Created Tap: riscv.cpu @ abs position 0, irlen 5, capture: 0x1 mask: 0x3
Debug: 92 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create riscv.cpu riscv -chain-position riscv.cpu
Debug: 93 5 command.c:143 script_debug(): command - ocd_target ocd_target create riscv.cpu riscv -chain-position riscv.cpu
Debug: 94 5 target.c:1905 target_free_all_working_areas_restore(): freeing all working areas
Debug: 95 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 96 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 97 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 98 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 99 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 100 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 101 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 102 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 103 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 104 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 105 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 106 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 107 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 108 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 109 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 110 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 111 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 112 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 113 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 114 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 115 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 116 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 117 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 118 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 119 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 120 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 121 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 122 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 123 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 124 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 125 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 126 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 127 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 128 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 129 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_reset_timeout_sec 120
Debug: 130 6 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_reset_timeout_sec 120
Debug: 132 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_command_timeout_sec 120
Debug: 133 6 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_command_timeout_sec 120
Debug: 135 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_echo Ready for Remote Connections..
Debug: 136 6 command.c:143 script_debug(): command - echo ocd_echo Ready for Remote Connections..
User : 138 6 command.c:762 jim_echo(): Ready for Remote Connections..
Debug: 139 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_gdb_port 3334
Debug: 140 6 command.c:143 script_debug(): command - gdb_port ocd_gdb_port 3334
Debug: 142 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_telnet_port 4443
Debug: 143 6 command.c:143 script_debug(): command - telnet_port ocd_telnet_port 4443
Debug: 145 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_tcl_port 6665
Debug: 146 6 command.c:143 script_debug(): command - tcl_port ocd_tcl_port 6665
Debug: 148 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_location 3:3
Debug: 149 6 command.c:143 script_debug(): command - ftdi_location ocd_ftdi_location 3:3
Info : 151 7 server.c:307 add_service(): Listening on port 6665 for tcl connections
Info : 152 7 server.c:307 add_service(): Listening on port 4443 for telnet connections
Debug: 153 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 154 7 command.c:143 script_debug(): command - init ocd_init
Debug: 156 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 157 7 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 159 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 160 7 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 161 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 162 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 163 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 164 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 165 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 166 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 167 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 168 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 169 7 target.c:1329 handle_target_init_command(): Initializing targets...
Debug: 170 7 riscv.c:247 riscv_init_target(): riscv_init_target()
Debug: 171 9 command.c:364 register_command_handler(): registering 'ocd_target_request'...
Debug: 172 9 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 173 9 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 174 9 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
Debug: 175 9 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
Debug: 176 9 command.c:364 register_command_handler(): registering 'ocd_profile'...
Debug: 177 9 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
Debug: 178 9 command.c:364 register_command_handler(): registering 'ocd_reg'...
Debug: 179 9 command.c:364 register_command_handler(): registering 'ocd_poll'...
Debug: 180 9 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
Debug: 181 9 command.c:364 register_command_handler(): registering 'ocd_halt'...
Debug: 182 9 command.c:364 register_command_handler(): registering 'ocd_resume'...
Debug: 183 9 command.c:364 register_command_handler(): registering 'ocd_reset'...
Debug: 184 9 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
Debug: 185 9 command.c:364 register_command_handler(): registering 'ocd_step'...
Debug: 186 9 command.c:364 register_command_handler(): registering 'ocd_mdd'...
Debug: 187 9 command.c:364 register_command_handler(): registering 'ocd_mdw'...
Debug: 188 9 command.c:364 register_command_handler(): registering 'ocd_mdh'...
Debug: 189 9 command.c:364 register_command_handler(): registering 'ocd_mdb'...
Debug: 190 9 command.c:364 register_command_handler(): registering 'ocd_mwd'...
Debug: 191 9 command.c:364 register_command_handler(): registering 'ocd_mww'...
Debug: 192 9 command.c:364 register_command_handler(): registering 'ocd_mwh'...
Debug: 193 9 command.c:364 register_command_handler(): registering 'ocd_mwb'...
Debug: 194 9 command.c:364 register_command_handler(): registering 'ocd_bp'...
Debug: 195 9 command.c:364 register_command_handler(): registering 'ocd_rbp'...
Debug: 196 9 command.c:364 register_command_handler(): registering 'ocd_wp'...
Debug: 197 10 command.c:364 register_command_handler(): registering 'ocd_rwp'...
Debug: 198 10 command.c:364 register_command_handler(): registering 'ocd_load_image'...
Debug: 199 10 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
Debug: 200 10 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
Debug: 201 10 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
Debug: 202 10 command.c:364 register_command_handler(): registering 'ocd_test_image'...
Debug: 203 10 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
Debug: 204 10 command.c:364 register_command_handler(): registering 'ocd_ps'...
Debug: 205 10 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
Debug: 206 10 ftdi.c:657 ftdi_initialize(): ftdi interface using shortest path jtag state transitions
Debug: 207 22 mpsse.c:121 device_location_equal(): device path has 2 steps
Debug: 208 22 mpsse.c:129 device_location_equal(): bus mismatch
Debug: 209 22 mpsse.c:121 device_location_equal(): device path has 2 steps
Debug: 210 22 mpsse.c:129 device_location_equal(): bus mismatch
Debug: 211 22 mpsse.c:121 device_location_equal(): device path has 1 steps
Debug: 212 22 mpsse.c:137 device_location_equal(): no more tokens in path at step 1
Debug: 213 25 mpsse.c:422 mpsse_purge(): -
Debug: 214 26 mpsse.c:703 mpsse_loopback_config(): off
Debug: 215 26 mpsse.c:748 mpsse_set_frequency(): target 1000000 Hz
Debug: 216 26 mpsse.c:740 mpsse_rtck_config(): off
Debug: 217 26 mpsse.c:729 mpsse_divide_by_5_config(): off
Debug: 218 26 mpsse.c:709 mpsse_set_divisor(): 29
Debug: 219 26 mpsse.c:772 mpsse_set_frequency(): actually 1000000 Hz
Debug: 220 26 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 221 26 core.c:1663 adapter_khz_to_speed(): have interface set up
Debug: 222 26 mpsse.c:748 mpsse_set_frequency(): target 1000000 Hz
Debug: 223 26 mpsse.c:740 mpsse_rtck_config(): off
Debug: 224 26 mpsse.c:729 mpsse_divide_by_5_config(): off
Debug: 225 26 mpsse.c:709 mpsse_set_divisor(): 29
Debug: 226 26 mpsse.c:772 mpsse_set_frequency(): actually 1000000 Hz
Debug: 227 26 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 228 26 core.c:1663 adapter_khz_to_speed(): have interface set up
Info : 229 26 core.c:1448 adapter_init(): clock speed 1000 kHz
Debug: 230 26 openocd.c:140 handle_init_command(): Debug Adapter init complete
Debug: 231 26 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 232 26 command.c:143 script_debug(): command - ocd_transport ocd_transport init
Debug: 234 26 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 235 26 core.c:729 jtag_add_reset(): SRST line released
Debug: 236 26 core.c:753 jtag_add_reset(): TRST line released
Debug: 237 26 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 238 26 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init
Debug: 239 26 command.c:143 script_debug(): command - ocd_jtag ocd_jtag arp_init
Debug: 240 26 core.c:1461 jtag_init_inner(): Init JTAG chain
Debug: 241 26 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 242 26 core.c:1121 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 243 26 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Error: 244 27 core.c:1010 jtag_examine_chain_check(): JTAG scan chain interrogation failed: all ones
Error: 245 27 core.c:1011 jtag_examine_chain_check(): Check JTAG interface, timings, target power, etc.
Error: 246 27 core.c:1506 jtag_init_inner(): Trying to use configured scan chain anyway...
Debug: 247 28 core.c:1252 jtag_validate_ircapture(): IR capture validation scan
Error: 248 28 core.c:1304 jtag_validate_ircapture(): riscv.cpu: IR capture error; saw 0x1f not 0x01
Debug: 249 28 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Warn : 250 28 core.c:1529 jtag_init_inner(): Bypassing JTAG setup events due to errors
Debug: 251 28 openocd.c:153 handle_init_command(): Examining targets...
Debug: 252 28 target.c:1515 target_call_event_callbacks(): target event 17 (examine-start)
Debug: 253 28 riscv.c:654 riscv_examine(): riscv_examine()
Debug: 254 28 riscv.c:224 dtmcontrol_scan(): DTMCONTROL: 0x0 -> 0xffffffff
Debug: 255 28 riscv.c:664 riscv_examine(): dtmcontrol=0xffffffff
Debug: 256 28 riscv.c:666 riscv_examine():   version=0xf
Error: 257 28 riscv.c:239 get_target_type(): Unsupported DTM version: 15
Debug: 258 28 openocd.c:155 handle_init_command(): target examination failed
Debug: 259 28 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash init
Debug: 260 28 command.c:143 script_debug(): command - ocd_flash ocd_flash init
Debug: 262 28 tcl.c:1166 handle_flash_init_command(): Initializing flash devices...
Debug: 263 28 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_mflash init
Debug: 264 28 command.c:143 script_debug(): command - ocd_mflash ocd_mflash init
Debug: 266 28 mflash.c:1377 handle_mflash_init_command(): Initializing mflash devices...
Debug: 267 28 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nand init
Debug: 268 28 command.c:143 script_debug(): command - ocd_nand ocd_nand init
Debug: 270 28 tcl.c:497 handle_nand_init_command(): Initializing NAND devices...
Debug: 271 28 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_pld init
Debug: 272 28 command.c:143 script_debug(): command - ocd_pld ocd_pld init
Debug: 274 28 pld.c:205 handle_pld_init_command(): Initializing PLDs...
Info : 275 28 server.c:307 add_service(): Listening on port 3334 for gdb connections

We have a system reset that is constrained to a pin with a push button going into it. When I press it and reset the system we start to get more normal behavior. This is trying to use openocd after hitting the reset button.

Open On-Chip Debugger 0.10.0+dev-00129-gfd9de02 (2018-03-12-14:20)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Ready for Remote Connections..
Info : Listening on port 6665 for tcl connections
Info : Listening on port 4443 for telnet connections
Info : clock speed 1000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x000001c7 (mfg: 0x0e3 (MGV Memory), part: 0x0000, ver: 0x0)

I’m currently tearing my hair out trying to get this to work, any help would be amazing.


(Santiago Gutierrez) #2

This is that last command with the “-d” flag

Open On-Chip Debugger 0.10.0+dev-00129-gfd9de02 (2018-03-12-14:20)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 13 3 command.c:544 command_print(): debug_level: 3
Debug: 14 3 options.c:184 add_default_dirs(): bindir=/usr/local/bin
Debug: 15 3 options.c:185 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
Debug: 16 3 options.c:186 add_default_dirs(): exepath=/usr/local/bin
Debug: 17 3 options.c:187 add_default_dirs(): bin2data=../share/openocd
Debug: 18 3 configuration.c:42 add_script_search_dir(): adding /home/sgutierrez/.openocd
Debug: 19 3 configuration.c:42 add_script_search_dir(): adding /usr/local/bin/../share/openocd/site
Debug: 20 3 configuration.c:42 add_script_search_dir(): adding /usr/local/bin/../share/openocd/scripts
Debug: 21 3 configuration.c:82 find_file(): found /usr/local/bin/../share/openocd/scripts/interface/ftdi/minimodule.cfg
Debug: 22 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface ftdi
Debug: 23 3 command.c:143 script_debug(): command - interface ocd_interface ftdi
Debug: 25 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_device_desc'...
Debug: 26 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_serial'...
Debug: 27 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_location'...
Debug: 28 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_channel'...
Debug: 29 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_layout_init'...
Debug: 30 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_layout_signal'...
Debug: 31 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_set_signal'...
Debug: 32 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_get_signal'...
Debug: 33 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_vid_pid'...
Debug: 34 3 command.c:364 register_command_handler(): registering 'ocd_ftdi_tdo_sample_edge'...
Debug: 35 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_device_desc FT2232H MiniModule
Debug: 36 3 command.c:143 script_debug(): command - ftdi_device_desc ocd_ftdi_device_desc FT2232H MiniModule
Debug: 38 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_vid_pid 0x0403 0x6010
Debug: 39 4 command.c:143 script_debug(): command - ftdi_vid_pid ocd_ftdi_vid_pid 0x0403 0x6010
Debug: 41 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_init 0x0008 0x000b
Debug: 42 4 command.c:143 script_debug(): command - ftdi_layout_init ocd_ftdi_layout_init 0x0008 0x000b
Debug: 44 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020
Debug: 45 4 command.c:143 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020
Debug: 47 4 configuration.c:82 find_file(): found viarocket_board.cfg
Debug: 48 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 1000
Debug: 49 4 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 1000
Debug: 51 4 core.c:1693 jtag_config_khz(): handle jtag khz
Debug: 52 4 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 53 4 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 54 4 command.c:544 command_print(): adapter speed: 1000 kHz
Debug: 55 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 56 4 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Info : 57 4 transport.c:286 jim_transport_select(): auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Debug: 58 4 command.c:364 register_command_handler(): registering 'ocd_jtag_flush_queue_sleep'...
Debug: 59 4 command.c:364 register_command_handler(): registering 'ocd_jtag_rclk'...
Debug: 60 4 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 61 4 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_assert_width'...
Debug: 62 4 command.c:364 register_command_handler(): registering 'ocd_scan_chain'...
Debug: 63 4 command.c:364 register_command_handler(): registering 'ocd_jtag_reset'...
Debug: 64 4 command.c:364 register_command_handler(): registering 'ocd_runtest'...
Debug: 65 4 command.c:364 register_command_handler(): registering 'ocd_irscan'...
Debug: 66 4 command.c:364 register_command_handler(): registering 'ocd_verify_ircapture'...
Debug: 67 4 command.c:364 register_command_handler(): registering 'ocd_verify_jtag'...
Debug: 68 4 command.c:364 register_command_handler(): registering 'ocd_tms_sequence'...
Debug: 69 4 command.c:364 register_command_handler(): registering 'ocd_wait_srst_deassert'...
Debug: 70 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 71 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 72 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 73 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 74 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 75 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 76 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 77 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 78 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 79 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 80 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 81 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 82 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 83 5 command.c:364 register_command_handler(): registering 'ocd_svf'...
Debug: 84 5 command.c:364 register_command_handler(): registering 'ocd_xsvf'...
Debug: 85 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 86 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 87 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap riscv cpu -irlen 5
Debug: 88 5 command.c:143 script_debug(): command - ocd_jtag ocd_jtag newtap riscv cpu -irlen 5
Debug: 89 5 tcl.c:549 jim_newtap_cmd(): Creating New Tap, Chip: riscv, Tap: cpu, Dotted: riscv.cpu, 2 params
Debug: 90 5 tcl.c:573 jim_newtap_cmd(): Processing option: -irlen
Debug: 91 5 core.c:1366 jtag_tap_init(): Created Tap: riscv.cpu @ abs position 0, irlen 5, capture: 0x1 mask: 0x3
Debug: 92 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create riscv.cpu riscv -chain-position riscv.cpu
Debug: 93 5 command.c:143 script_debug(): command - ocd_target ocd_target create riscv.cpu riscv -chain-position riscv.cpu
Debug: 94 5 target.c:1905 target_free_all_working_areas_restore(): freeing all working areas
Debug: 95 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 96 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 97 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 98 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 99 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 100 5 command.c:364 register_command_handler(): registering 'ocd_riscv'...
Debug: 101 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 102 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 103 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 104 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 105 5 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 106 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 107 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 108 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 109 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 110 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 111 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 112 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 113 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 114 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 115 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 116 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 117 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 118 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 119 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 120 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 121 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 122 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 123 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 124 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 125 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 126 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 127 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 128 6 command.c:364 register_command_handler(): registering 'ocd_riscv.cpu'...
Debug: 129 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_reset_timeout_sec 120
Debug: 130 6 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_reset_timeout_sec 120
Debug: 132 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv set_command_timeout_sec 120
Debug: 133 6 command.c:143 script_debug(): command - ocd_riscv ocd_riscv set_command_timeout_sec 120
Debug: 135 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_echo Ready for Remote Connections..
Debug: 136 6 command.c:143 script_debug(): command - echo ocd_echo Ready for Remote Connections..
User : 138 6 command.c:762 jim_echo(): Ready for Remote Connections..
Debug: 139 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_gdb_port 3334
Debug: 140 6 command.c:143 script_debug(): command - gdb_port ocd_gdb_port 3334
Debug: 142 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_telnet_port 4443
Debug: 143 6 command.c:143 script_debug(): command - telnet_port ocd_telnet_port 4443
Debug: 145 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_tcl_port 6665
Debug: 146 7 command.c:143 script_debug(): command - tcl_port ocd_tcl_port 6665
Debug: 148 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ftdi_location 3:3
Debug: 149 7 command.c:143 script_debug(): command - ftdi_location ocd_ftdi_location 3:3
Info : 151 7 server.c:307 add_service(): Listening on port 6665 for tcl connections
Info : 152 7 server.c:307 add_service(): Listening on port 4443 for telnet connections
Debug: 153 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 154 7 command.c:143 script_debug(): command - init ocd_init
Debug: 156 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 157 7 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 159 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 160 7 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 161 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 162 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-erase-start
Debug: 163 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 164 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-erase-start reset init
Debug: 165 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 166 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu cget -event gdb-flash-write-end
Debug: 167 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 168 7 command.c:143 script_debug(): command - ocd_riscv.cpu ocd_riscv.cpu configure -event gdb-flash-write-end reset halt
Debug: 169 7 target.c:1329 handle_target_init_command(): Initializing targets...
Debug: 170 7 riscv.c:247 riscv_init_target(): riscv_init_target()
Debug: 171 9 command.c:364 register_command_handler(): registering 'ocd_target_request'...
Debug: 172 9 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 173 9 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 174 9 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
Debug: 175 9 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
Debug: 176 9 command.c:364 register_command_handler(): registering 'ocd_profile'...
Debug: 177 9 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
Debug: 178 9 command.c:364 register_command_handler(): registering 'ocd_reg'...
Debug: 179 9 command.c:364 register_command_handler(): registering 'ocd_poll'...
Debug: 180 9 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
Debug: 181 9 command.c:364 register_command_handler(): registering 'ocd_halt'...
Debug: 182 9 command.c:364 register_command_handler(): registering 'ocd_resume'...
Debug: 183 9 command.c:364 register_command_handler(): registering 'ocd_reset'...
Debug: 184 9 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
Debug: 185 9 command.c:364 register_command_handler(): registering 'ocd_step'...
Debug: 186 9 command.c:364 register_command_handler(): registering 'ocd_mdd'...
Debug: 187 9 command.c:364 register_command_handler(): registering 'ocd_mdw'...
Debug: 188 9 command.c:364 register_command_handler(): registering 'ocd_mdh'...
Debug: 189 9 command.c:364 register_command_handler(): registering 'ocd_mdb'...
Debug: 190 9 command.c:364 register_command_handler(): registering 'ocd_mwd'...
Debug: 191 9 command.c:364 register_command_handler(): registering 'ocd_mww'...
Debug: 192 10 command.c:364 register_command_handler(): registering 'ocd_mwh'...
Debug: 193 10 command.c:364 register_command_handler(): registering 'ocd_mwb'...
Debug: 194 10 command.c:364 register_command_handler(): registering 'ocd_bp'...
Debug: 195 10 command.c:364 register_command_handler(): registering 'ocd_rbp'...
Debug: 196 10 command.c:364 register_command_handler(): registering 'ocd_wp'...
Debug: 197 10 command.c:364 register_command_handler(): registering 'ocd_rwp'...
Debug: 198 10 command.c:364 register_command_handler(): registering 'ocd_load_image'...
Debug: 199 10 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
Debug: 200 10 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
Debug: 201 10 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
Debug: 202 10 command.c:364 register_command_handler(): registering 'ocd_test_image'...
Debug: 203 10 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
Debug: 204 10 command.c:364 register_command_handler(): registering 'ocd_ps'...
Debug: 205 10 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
Debug: 206 10 ftdi.c:657 ftdi_initialize(): ftdi interface using shortest path jtag state transitions
Debug: 207 20 mpsse.c:121 device_location_equal(): device path has 2 steps
Debug: 208 20 mpsse.c:129 device_location_equal(): bus mismatch
Debug: 209 20 mpsse.c:121 device_location_equal(): device path has 2 steps
Debug: 210 20 mpsse.c:129 device_location_equal(): bus mismatch
Debug: 211 20 mpsse.c:121 device_location_equal(): device path has 1 steps
Debug: 212 20 mpsse.c:137 device_location_equal(): no more tokens in path at step 1
Debug: 213 24 mpsse.c:422 mpsse_purge(): -
Debug: 214 24 mpsse.c:703 mpsse_loopback_config(): off
Debug: 215 24 mpsse.c:748 mpsse_set_frequency(): target 1000000 Hz
Debug: 216 24 mpsse.c:740 mpsse_rtck_config(): off
Debug: 217 24 mpsse.c:729 mpsse_divide_by_5_config(): off
Debug: 218 24 mpsse.c:709 mpsse_set_divisor(): 29
Debug: 219 24 mpsse.c:772 mpsse_set_frequency(): actually 1000000 Hz
Debug: 220 24 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 221 24 core.c:1663 adapter_khz_to_speed(): have interface set up
Debug: 222 24 mpsse.c:748 mpsse_set_frequency(): target 1000000 Hz
Debug: 223 24 mpsse.c:740 mpsse_rtck_config(): off
Debug: 224 24 mpsse.c:729 mpsse_divide_by_5_config(): off
Debug: 225 24 mpsse.c:709 mpsse_set_divisor(): 29
Debug: 226 24 mpsse.c:772 mpsse_set_frequency(): actually 1000000 Hz
Debug: 227 24 core.c:1660 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 228 24 core.c:1663 adapter_khz_to_speed(): have interface set up
Info : 229 24 core.c:1448 adapter_init(): clock speed 1000 kHz
Debug: 230 24 openocd.c:140 handle_init_command(): Debug Adapter init complete
Debug: 231 24 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 232 24 command.c:143 script_debug(): command - ocd_transport ocd_transport init
Debug: 234 24 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 235 25 core.c:729 jtag_add_reset(): SRST line released
Debug: 236 25 core.c:753 jtag_add_reset(): TRST line released
Debug: 237 25 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 238 25 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init
Debug: 239 25 command.c:143 script_debug(): command - ocd_jtag ocd_jtag arp_init
Debug: 240 25 core.c:1461 jtag_init_inner(): Init JTAG chain
Debug: 241 25 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 242 25 core.c:1121 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 243 25 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Info : 244 26 core.c:1020 jtag_examine_chain_display(): JTAG tap: riscv.cpu tap/device found: 0x000001c7 (mfg: 0x0e3 (MGV Memory), part: 0x0000, ver: 0x0)
Debug: 245 26 core.c:1252 jtag_validate_ircapture(): IR capture validation scan
Debug: 246 26 core.c:1310 jtag_validate_ircapture(): riscv.cpu: IR capture 0x01
Debug: 247 26 openocd.c:153 handle_init_command(): Examining targets...
Debug: 248 26 target.c:1515 target_call_event_callbacks(): target event 17 (examine-start)
Debug: 249 26 riscv.c:654 riscv_examine(): riscv_examine()
Debug: 250 27 riscv.c:224 dtmcontrol_scan(): DTMCONTROL: 0x0 -> 0x5071
Debug: 251 27 riscv.c:664 riscv_examine(): dtmcontrol=0x5071
Debug: 252 27 riscv.c:666 riscv_examine():   version=0x1
Debug: 253 27 riscv-013.c:1449 init_target(): init
Debug: 254 27 riscv-013.c:416 dtmcontrol_scan(): DTMCS: 0x0 -> 0x5071
Debug: 255 27 riscv-013.c:1232 examine(): dtmcontrol=0x5071
Debug: 256 27 riscv-013.c:1233 examine():   dmireset=0
Debug: 257 27 riscv-013.c:1234 examine():   idle=5
Debug: 258 27 riscv-013.c:1235 examine():   dmistat=0
Debug: 259 27 riscv-013.c:1236 examine():   abits=7
Debug: 260 27 riscv-013.c:1237 examine():   version=1
Debug: 261 27 riscv-013.c:359 scan(): 41b r 00000000 @11 -> + 00000000 @00
Debug: 262 27 riscv-013.c:359 scan(): 41b - 00000000 @11 -> b 00000000 @00
Debug: 263 27 riscv-013.c:427 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=1, ac_busy_delay=0
Debug: 264 27 riscv-013.c:416 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x5471
Debug: 265 27 riscv-013.c:359 scan(): 41b - 00000000 @11 -> b 00000000 @00
Debug: 266 27 riscv-013.c:427 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=2, ac_busy_delay=0
Debug: 267 28 riscv-013.c:416 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x5471

The last scan keeps repeating indefinitely and it hangs after finding the tap device.


(Michael Eager) #3

I’ve seen similar behavior. OpenOCD errors on JTAG scan chain interrogation the first time it is run. On second and subsequent runs, it succeeds. Possibly I may need to reboot of the development system to see the failure.

$ freedom-e-sdk/work/build/openocd/prefix/bin/openocd -f freedom-e-sdk/bsp/env/freedom-e300-arty/openocd.cfg
Open On-Chip Debugger 0.10.0+dev (2018-03-23-18:40)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
adapter speed: 10000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 10000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: riscv.cpu: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Unsupported DTM version: 15
Info : Listening on port 3333 for gdb connections
Error: Target not examined yet

$ freedom-e-sdk/work/build/openocd/prefix/bin/openocd -f freedom-e-sdk/bsp/env/freedom-e300-arty/openocd.cfg
Open On-Chip Debugger 0.10.0+dev (2018-03-23-18:40)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
adapter speed: 10000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive, Inc.), part: 0x0e31, ver: 0x1)
Info : Examined RISCV core; XLEN=32, misa=0x40001105
Info : Listening on port 3333 for gdb connections
Info : [0] Found 2 triggers
halted at 0x0 due to debug interrupt
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections

I’ll look at your diagnostics to see if there is a clue.


(Megan A. Wachs) #4

On our platforms, we create a “power on reset” signal to drive the jtag_reset input in the Verilog. You must do this, or something like it. The debug needs to be reset before your core comes out of reset. You don’t really want to drive the jtag_reset input from the reset button, because then you can’t debug across reset presses.


#5

@mwachs5, I have a similar issue here:

Debug: 1060 148232 riscv-013.c:346 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x5471
Debug: 1090 163024 riscv-013.c:265 scan(): 41b - 00000000 @11 -> b 00000000 @00
Info : 1091 163024 riscv-013.c:357 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=131326986, ac_busy_delay=0
`

I am stuck in this last scan, it repeats indefinitely, but I have put power on reset blocks in my design as suggested above, and map the power_on_reset signal to a pin which the debugger is connected to (maybe do we map the power_on_reset signal on a switch?). Did I do anything wrong? Thank you.

Dong


(Megan A. Wachs) #6

I would not map the power-on-reset signal to a pin, but to a circuit within the FPGA that acts like a power-on-reset. See the Freedom code for reference:

Since I am not sure what you have changed from the default Freedom design, it’s tough to say what the issue is, but it seems like something is wrong with your clocks and resets on the Core or JTAG side.


(Megan A. Wachs) #7

Also, to all the posters, it may be useful to ensure that you are applying proper clock constraints on your jtag_TCK input, as well as marking the jtag_TCK group as asynchronous from the coreClk/tlClock groups.


#8

Thanks @mwachs5, I’ll check my clocks and resets on the core, but for JTAG, the TRST_n is not used in the design, right? So by reset on JTAG I assume you mean the power-on-reset circuit?


(Megan A. Wachs) #9

@dong correct


#10

Also, quick question, I am in a little doubt with my core reset (ck_rst signal), how does it work in Arty. Known it is connected to ck_rst signal in Arty board, but in other board we might not have this signal available, is it ok to map this pin into a switch (ck is active low?) with pull up enable? Or a push button? Thanks! :slight_smile:


#11

Below is my log, I am not sure why the last three statements are repeating indefinitely… I have checked my core reset (replace the bootROM to blink few LEDs and it blinked.) The power-on-reset circuit’s clock is from core clock, so I think that part is ok as well. What else could be wrong? Any insight would be very good, thank you.

Also, I noticed that TMS, TDI has pull ups, do we really need these?

Debug: 214 33 core.c:1310 jtag_validate_ircapture(): riscv.cpu: IR capture 0x01
Debug: 215 33 openocd.c:153 handle_init_command(): Examining targets…
Debug: 216 33 target.c:1524 target_call_event_callbacks(): target event 21 (examine-start)
Debug: 217 33 riscv.c:653 riscv_examine(): riscv_examine()
Debug: 218 33 riscv.c:228 dtmcontrol_scan(): DTMCONTROL: 0x0 -> 0x5071
Debug: 219 33 riscv.c:663 riscv_examine(): dtmcontrol=0x5071
Debug: 220 33 riscv.c:665 riscv_examine(): version=0x1
Debug: 221 33 riscv-013.c:879 init_target(): init
Debug: 222 34 riscv-013.c:346 dtmcontrol_scan(): DTMCS: 0x0 -> 0x5071
Debug: 223 34 riscv-013.c:979 examine(): dtmcontrol=0x5071
Debug: 224 34 riscv-013.c:980 examine(): dmireset=0
Debug: 225 34 riscv-013.c:981 examine(): idle=5
Debug: 226 34 riscv-013.c:982 examine(): dmistat=0
Debug: 227 34 riscv-013.c:983 examine(): abits=7
Debug: 228 34 riscv-013.c:984 examine(): version=1
Debug: 229 34 riscv-013.c:265 scan(): 41b r 00000000 @10 -> + 00000000 @00
Debug: 230 34 riscv-013.c:265 scan(): 41b - 00000000 @10 -> + 80000001 @10
Debug: 231 34 riscv-013.c:276 scan(): -> haltreq dmactive
Debug: 232 34 riscv-013.c:265 scan(): 41b r 00000000 @11 -> + 00000000 @00
Debug: 233 35 riscv-013.c:265 scan(): 41b - 00000000 @11 -> b 00000000 @00
Info : 234 35 riscv-013.c:357 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=1, ac_busy_delay=0
Debug: 235 35 riscv-013.c:346 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x5471
Debug: 236 35 riscv-013.c:265 scan(): 41b - 00000000 @11 -> b 00000000 @00
Info : 237 35 riscv-013.c:357 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=2, ac_busy_delay=0
Debug: 238 35 riscv-013.c:346 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x5471
Debug: 239 35 riscv-013.c:265 scan(): 41b - 00000000 @11 -> b 00000000 @00
Info : 240 35 riscv-013.c:357 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=3, ac_busy_delay=0
Debug: 241 35 riscv-013.c:346 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x5471
Debug: 242 35 riscv-013.c:265 scan(): 41b - 00000000 @11 -> b 00000000 @00
Info : 243 35 riscv-013.c:357 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=4, ac_busy_delay=0
Debug: 244 35 riscv-013.c:346 dtmcontrol_scan(): DTMCS: 0x10000 -> 0x5471
Debug: 245 35 riscv-013.c:265 scan(): 41b - 00000000 @11 -> b 00000000 @00
Info : 246 35 riscv-013.c:357 increase_dmi_busy_delay(): dtmcontrol_idle=5, dmi_busy_delay=5, ac_busy_delay=0


#12

Now I am hitting this:

Open On-Chip Debugger 0.10.0+dev-00152-gdf7ba7d-dirty (2018-04-03-14:58)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 3000 kHz
Info : auto-selecting first available session transport “jtag”. To override use 'transport select '.
Info : clock speed 3000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive, Inc.), part: 0x0000, ver: 0x2)
Error: unable to halt hart 0
Error: dmcontrol=0x80000001
Error: dmstatus =0x00030c82

The chain can be recognized, but the debugger is not able to halt the core. Any idea how to proceed here?? Thanks.


(fox) #13

I have the same problem, can you tell me how to solve this problem.
fuli@fuli-virtual-machine:~/fox/e200_opensource-master/sirv-e-sdk$ make upload PROGRAM=demo_gpio BOARD=sirv-e203-arty
work/build/openocd/prefix/bin/openocd -f bsp/env/sirv-e203-arty/openocd.cfg &
/home/fuli/fox/e200_opensource-master/sirv-e-sdk/work/build/riscv-gnu-toolchain/riscv32-unknown-elf/prefix/bin/riscv-none-embed-gdb software/demo_gpio/demo_gpio --batch -ex “set remotetimeout 240” -ex “target extended-remote localhost:3333” -ex “monitor reset halt” -ex “monitor flash protect 0 64 last off” -ex “load” -ex “monitor resume” -ex “monitor shutdown” -ex “quit” &&
echo "Successfully uploaded ‘demo_gpio’ to sirv-e203-arty."
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00084-gae68d7da-dirty (2018-09-26-15:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
Info : auto-selecting first available session transport “jtag”. To override use 'transport select '.
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway…
Error: riscv.cpu: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Unsupported DTM version: 15
Info : Listening on port 3333 for gdb connections
Error: Target not examined yet

Error: Unsupported DTM version: 15
Warn : Flash driver of my_first_flash does not support free_driver_priv()
localhost:3333: 连接超时.
“monitor” command not supported by this target.
“monitor” command not supported by this target.
You can’t do that when your target is `exec’
“monitor” command not supported by this target.
“monitor” command not supported by this target.
Successfully uploaded ‘demo_gpio’ to sirv-e203-arty.