adapter_khz 1000 interface ftdi ftdi_device_desc "Digilent USB Device" ftdi_vid_pid 0x0403 0x6014 ftdi_channel 0 ftdi_layout_init 0x00e8 0x60eb reset_config none set _CHIPNAME riscv jtag newtap $_CHIPNAME cpu -irlen 5 set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME riscv -chain-position $_TARGETNAME -coreid 0 gdb_report_data_abort enable gdb_report_register_access_error enable riscv set_reset_timeout_sec 120 riscv set_command_timeout_sec 120 riscv set_prefer_sba off init halt echo "Ready for Remote Connections"
使用openocd连接待调试设备
openocd -f debug.cfg
连接上的话终端中会输出下面的内容
Open On-Chip Debugger 0.10.0+dev-00195-g933cb87 (2020-06-15-20:32) 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 Info : TAP riscv.cpu does not have IDCODE Info : datacount=2 progbufsize=8 Info : Examined RISC-V core; found 1 harts Info : hart 0: XLEN=64, misa=0x8000000000141105 Info : Listening on port 3333 for gdb connections Ready for Remote Connections Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections