Closed WHZhou closed 1 year ago
Hi,
I did merge RISC-V upstream recently. see the commits from Oct 25, 2022.
That's curious, i just tried with the last version and it worked for me. connecting to the MuraxSim without issues :
rawrr@rawrr:~/tmp/riscv/openocd_riscv$ git branch
However, it works with the older version I built in March of laster year.
And it still works now right ? on what OS are you ?
Can you check if the version before Oct 25, 2022 is working on your side ? it may be the threshold.
I've found the reason, I guess it was caused by the MinGW gcc version. My previous openocd was built with gcc 12.2.0 on msys2. When I switch back to gcc 11.3.0, everything works fine :)
Cool, thanks ^^
I built openocd_riscv of the lastest version, and try to connect to MuraxSim with Jtag Tcp( https://github.com/SpinalHDL/VexRiscv/blob/master/src/test/scala/vexriscv/MuraxSim.scala). the command I use:
src/openocd -f tcl/interface/jtag_tcp.cfg -c 'set MURAX_CPU0_YAML ../VexRiscv/cpu0.yaml' -f tcl/target/murax.cfg
the log I got: ` Open On-Chip Debugger 0.11.0+dev-02583-g9d50e3c2f-dirty (2022-11-13-00:26) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html User : 3 2 options.c:63 configuration_output_handler(): debug_level: 3 User : 4 6 options.c:63 configuration_output_handler(): Debug: 5 8 options.c:244 add_default_dirs(): bindir=D:/msys64/mingw64/bin Debug: 6 11 options.c:245 add_default_dirs(): pkgdatadir=D:/msys64/mingw64/share/openocd Debug: 7 15 options.c:246 add_default_dirs(): exepath=F:/Projects/openocd_riscv/src Debug: 8 18 options.c:247 add_default_dirs(): bin2data=../share/openocd Debug: 9 21 configuration.c:44 add_script_search_dir(): adding C:/Users/zhy/AppData/Roaming/OpenOCD Debug: 10 25 configuration.c:44 add_script_search_dir(): adding D:\msys64\home\zhy/.config/openocd Debug: 11 29 configuration.c:44 add_script_search_dir(): adding D:\msys64\home\zhy/.openocd Debug: 12 33 configuration.c:44 add_script_search_dir(): adding F:/Projects/openocd_riscv/src/../sha re/openocd/site Debug: 13 37 configuration.c:44 add_script_search_dir(): adding F:/Projects/openocd_riscv/src/../sha re/openocd/scripts Debug: 14 42 command.c:166 script_debug(): command - ocd_find sim/jtag_tcp.cfg Debug: 15 45 configuration.c:99 find_file(): found sim/jtag_tcp.cfg Debug: 16 49 command.c:166 script_debug(): command - echo DEPRECATED! use 'adapter driver' not 'inte rface' User : 17 54 command.c:696 handle_echo(): DEPRECATED! use 'adapter driver' not 'interface' Debug: 18 59 command.c:166 script_debug(): command - adapter driver jtag_tcp Debug: 19 62 command.c:312 register_command(): registering 'jtag_tcp'... Debug: 20 65 command.c:312 register_command(): registering 'jtag_tcp hello'... Debug: 21 68 command.c:312 register_command(): registering 'jtag_tcp foo'... Debug: 22 71 command.c:312 register_command(): registering 'jtag_tcp foo bar'... Debug: 23 76 command.c:312 register_command(): registering 'jtag_tcp foo baz'... Debug: 24 79 command.c:312 register_command(): registering 'jtag_tcp foo flag'... Info : 25 82 transport.c:118 allow_transports(): only one transport option; autoselect 'jtag' Debug: 26 86 command.c:312 register_command(): registering 'jtag_flush_queue_sleep'... Debug: 27 91 command.c:312 register_command(): registering 'jtag_rclk'... Debug: 28 94 command.c:312 register_command(): registering 'jtag_ntrst_delay'... Debug: 29 98 command.c:312 register_command(): registering 'jtag_ntrst_assert_width'... Debug: 30 101 command.c:312 register_command(): registering 'scan_chain'... Debug: 31 104 command.c:312 register_command(): registering 'runtest'... Debug: 32 107 command.c:312 register_command(): registering 'irscan'... Debug: 33 110 command.c:312 register_command(): registering 'verify_ircapture'... Debug: 34 114 command.c:312 register_command(): registering 'verify_jtag'... Debug: 35 117 command.c:312 register_command(): registering 'tms_sequence'... Debug: 36 120 command.c:312 register_command(): registering 'wait_srst_deassert'... Debug: 37 123 command.c:312 register_command(): registering 'jtag'... Debug: 38 125 command.c:312 register_command(): registering 'jtag init'... Debug: 39 129 command.c:312 register_command(): registering 'jtag arp_init'... Debug: 40 132 command.c:312 register_command(): registering 'jtag arp_init-reset'... Debug: 41 136 command.c:312 register_command(): registering 'jtag newtap'... Debug: 42 139 command.c:312 register_command(): registering 'jtag tapisenabled'... Debug: 43 141 command.c:312 register_command(): registering 'jtag tapenable'... Debug: 44 145 command.c:312 register_command(): registering 'jtag tapdisable'... Debug: 45 149 command.c:312 register_command(): registering 'jtag configure'... Debug: 46 151 command.c:312 register_command(): registering 'jtag cget'... Debug: 47 154 command.c:312 register_command(): registering 'jtag names'... Debug: 48 157 command.c:312 register_command(): registering 'jtag drscan'... Debug: 49 160 command.c:312 register_command(): registering 'jtag flush_count'... Debug: 50 165 command.c:312 register_command(): registering 'jtag pathmove'... Debug: 51 168 command.c:312 register_command(): registering 'drscan'... Debug: 52 171 command.c:312 register_command(): registering 'flush_count'... Debug: 53 174 command.c:312 register_command(): registering 'pathmove'... Debug: 54 177 command.c:312 register_command(): registering 'svf'... Debug: 55 179 command.c:312 register_command(): registering 'xsvf'... Debug: 56 182 command.c:312 register_command(): registering 'ipdbg'... User : 57 184 options.c:63 configuration_output_handler(): cpu0.yamlUser : 58 186 options.c:63 confi guration_output_handler(): Debug: 59 189 command.c:166 script_debug(): command - ocd_find sim/murax.cfg Debug: 60 192 configuration.c:99 find_file(): found sim/murax.cfg Debug: 61 195 command.c:166 script_debug(): command - echo DEPRECATED! use 'adapter speed' not 'adap ter_khz' User : 62 198 command.c:696 handle_echo(): DEPRECATED! use 'adapter speed' not 'adapter_khz' Debug: 63 202 command.c:166 script_debug(): command - adapter speed 800 Debug: 64 205 adapter.c:176 adapter_config_khz(): handle adapter khz Debug: 65 207 adapter.c:140 adapter_khz_to_speed(): convert khz to adapter specific speed value Debug: 66 210 adapter.c:140 adapter_khz_to_speed(): convert khz to adapter specific speed value Debug: 67 214 command.c:166 script_debug(): command - echo DEPRECATED! use 'adapter srst delay' not 'adapter_nsrst_delay' User : 68 218 command.c:696 handle_echo(): DEPRECATED! use 'adapter srst delay' not 'adapter_nsrst_d elay' Debug: 69 223 command.c:166 script_debug(): command - adapter srst delay 260 Debug: 70 227 command.c:166 script_debug(): command - jtag_ntrst_delay 250 Debug: 71 229 command.c:166 script_debug(): command - jtag newtap fpga_spinal bridge -expected-id 0x 10001fff -irlen 4 -ircapture 0x1 -irmask 0xF Debug: 72 235 tcl.c:568 jim_newtap_cmd(): Creating New Tap, Chip: fpga_spinal, Tap: bridge, Dotted: fpga_spinal.bridge, 8 params Debug: 73 240 tcl.c:593 jim_newtap_cmd(): Processing option: -expected-id Debug: 74 243 tcl.c:593 jim_newtap_cmd(): Processing option: -irlen Debug: 75 246 tcl.c:593 jim_newtap_cmd(): Processing option: -ircapture Debug: 76 248 tcl.c:593 jim_newtap_cmd(): Processing option: -irmask Debug: 77 251 core.c:1468 jtag_tap_init(): Created Tap: fpga_spinal.bridge @ abs position 0, irlen 4 , capture: 0x1 mask: 0xf Debug: 78 256 command.c:166 script_debug(): command - target create fpga_spinal.cpu0 vexriscv -endia n little -chain-position fpga_spinal.bridge -coreid 0 -dbgbase 0xF00F0000 Debug: 79 263 target.c:2215 target_free_all_working_areas_restore(): freeing all working areas Debug: 80 266 vexriscv.c:205 vexriscv_target_create(): vexriscv_target_createDebug: 81 269 command.c:312 register_command(): registering 'vexriscv'... Debug: 82 272 command.c:312 register_command(): registering 'vexriscv jtagMapping'... Debug: 83 275 command.c:312 register_command(): registering 'vexriscv readWaitCycles'... Debug: 84 278 command.c:312 register_command(): registering 'vexriscv cpuConfigFile'... Debug: 85 282 command.c:312 register_command(): registering 'vexriscv targetAddress'... Debug: 86 285 command.c:312 register_command(): registering 'vexriscv networkProtocol'... Debug: 87 289 command.c:312 register_command(): registering 'arm'... Debug: 88 291 command.c:312 register_command(): registering 'arm semihosting'... Debug: 89 294 command.c:312 register_command(): registering 'arm semihosting_redirect'... Debug: 90 298 command.c:312 register_command(): registering 'arm semihosting_cmdline'... Debug: 91 301 command.c:312 register_command(): registering 'arm semihosting_fileio'... Debug: 92 304 command.c:312 register_command(): registering 'arm semihosting_resexit'... Debug: 93 307 command.c:312 register_command(): registering 'arm semihosting_read_user_param'... Debug: 94 310 command.c:312 register_command(): registering 'fpga_spinal.cpu0'... Debug: 95 313 command.c:312 register_command(): registering 'fpga_spinal.cpu0 configure'... Debug: 96 316 command.c:312 register_command(): registering 'fpga_spinal.cpu0 cget'... Debug: 97 319 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mwd'... Debug: 98 323 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mww'... Debug: 99 326 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mwh'... Debug: 100 329 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mwb'... Debug: 101 332 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mdd'... Debug: 102 335 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mdw'... Debug: 103 338 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mdh'... Debug: 104 342 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mdb'... Debug: 105 345 command.c:312 register_command(): registering 'fpga_spinal.cpu0 array2mem'... Debug: 106 348 command.c:312 register_command(): registering 'fpga_spinal.cpu0 mem2array'... Debug: 107 351 command.c:312 register_command(): registering 'fpga_spinal.cpu0 get_reg'... Debug: 108 355 command.c:312 register_command(): registering 'fpga_spinal.cpu0 set_reg'... Debug: 109 358 command.c:312 register_command(): registering 'fpga_spinal.cpu0 read_memory'... Debug: 110 362 command.c:312 register_command(): registering 'fpga_spinal.cpu0 write_memory'... Debug: 111 366 command.c:312 register_command(): registering 'fpga_spinal.cpu0 eventlist'... Debug: 112 369 command.c:312 register_command(): registering 'fpga_spinal.cpu0 curstate'... Debug: 113 372 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arp_examine'... Debug: 114 376 command.c:312 register_command(): registering 'fpga_spinal.cpu0 was_examined'... Debug: 115 379 command.c:312 register_command(): registering 'fpga_spinal.cpu0 examine_deferred'... Debug: 116 383 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arp_halt_gdb'... Debug: 117 386 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arp_poll'... Debug: 118 390 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arp_reset'... Debug: 119 394 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arp_halt'... Debug: 120 397 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arp_waitstate'... Debug: 121 401 command.c:312 register_command(): registering 'fpga_spinal.cpu0 invoke-event'... Debug: 122 404 command.c:312 register_command(): registering 'fpga_spinal.cpu0 vexriscv'... Debug: 123 408 command.c:312 register_command(): registering 'fpga_spinal.cpu0 vexriscv jtagMapping' ... Debug: 124 412 command.c:312 register_command(): registering 'fpga_spinal.cpu0 vexriscv readWaitCycl es'... Debug: 125 416 command.c:312 register_command(): registering 'fpga_spinal.cpu0 vexriscv cpuConfigFil e'... Debug: 126 420 command.c:312 register_command(): registering 'fpga_spinal.cpu0 vexriscv targetAddres s'... Debug: 127 425 command.c:312 register_command(): registering 'fpga_spinal.cpu0 vexriscv networkProto col'... Debug: 128 429 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arm'... Debug: 129 432 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arm semihosting'... Debug: 130 436 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arm semihosting_redir ect'... Debug: 131 441 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arm semihosting_cmdli ne'... Debug: 132 445 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arm semihosting_filei o'... Debug: 133 450 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arm semihosting_resex it'... Debug: 134 454 command.c:312 register_command(): registering 'fpga_spinal.cpu0 arm semihostingread user_param'... Debug: 135 459 command.c:166 script_debug(): command - vexriscv readWaitCycles 12 Debug: 136 462 command.c:166 script_debug(): command - vexriscv cpuConfigFile cpu0.yaml Debug: 137 465 command.c:166 script_debug(): command - poll_period 50 Info : 138 467 server.c:783 handle_poll_period_command(): set servers polling period to 50ms Debug: 139 471 command.c:166 script_debug(): command - init Debug: 140 474 command.c:166 script_debug(): command - target init Debug: 141 477 command.c:166 script_debug(): command - target names Debug: 142 480 command.c:166 script_debug(): command - fpga_spinal.cpu0 cget -event gdb-flash-erase- start Debug: 143 484 command.c:166 script_debug(): command - fpga_spinal.cpu0 configure -event gdb-flash-e rase-start reset init Debug: 144 488 command.c:166 script_debug(): command - fpga_spinal.cpu0 cget -event gdb-flash-write- end Debug: 145 493 command.c:166 script_debug(): command - fpga_spinal.cpu0 configure -event gdb-flash-w rite-end reset halt Debug: 146 497 command.c:166 script_debug(): command - fpga_spinal.cpu0 cget -event gdb-attach Debug: 147 500 command.c:166 script_debug(): command - fpga_spinal.cpu0 configure -event gdb-attach halt 1000 Debug: 148 505 target.c:1672 handle_target_init_command(): Initializing targets... Debug: 149 509 vexriscv.c:569 vexriscv_init_target(): vexriscv_init_target
Debug: 150 512 vexriscv.c:570 vexriscv_init_target(): vexriscv_init_target Error: 151 515 vexriscv.c:513 vexriscv_parse_cpu_file(): cpuConfigFile cpu0.yaml not found Error: 152 518 target.c:1576 target_init_one(): target 'fpga_spinal.cpu0' init failed Debug: 153 521 command.c:555 run_command(): Command 'target init' failed with error code -4 User : 154 526 command.c:619 command_run_line(): Debug: 155 529 command.c:555 run_command(): Command 'init' failed with error code -4 User : 156 532 command.c:619 command_run_line(): Debug: 157 534 target.c:2215 target_free_all_working_areas_restore(): freeing all working areas `
However, it works with the older version I built in March of laster year.