riscv-collab / riscv-openocd

Fork of OpenOCD that has RISC-V support
Other
437 stars 318 forks source link

JTAG does not use debugger's idle count #332

Open atthecodeface opened 5 years ago

atthecodeface commented 5 years ago

The debug spec provides for an idle count to be used after every dm access.

This is read into info->dtmcontrol_idle.

This is never used; it presumably should be a baseline for idle_count in riscv-013.c:dmi_scan

When I add in this value to idle_count, the openocd works correctly with hardware that sets this value.

timsifive commented 5 years ago

You're right about the intent of dtmcontrol_idle. I just wrote a small patch to do what you suggest, but it breaks debugging of some SiFive cores on Arty. I want to understand that before merging anything.

mwachs5 commented 5 years ago

Didn't OpenOCD use to do this?

rbarzic commented 4 years ago

Is this fixed ? I have the impression that the latest version still ignores dtmd_idle field...

timsifive commented 4 years ago

This problem likely still exists.

cquartier commented 3 years ago

can anyone elaborate on this problem for me? I'm trying to use the Arty A7 board's rs2232h for jtag so I don't need another external jtag tool in order to flash sifive's freedom e300 riscv core. I am getting:

Error: Unsupported DTM version 9. (dtmcontrol=0x9)

when trying to use openocd with the sifive-e31arty-onboard-ftdi.cfg board file. Is this a problem with openocd software, or a problem with the jtag hardware configuration in the freedom core?

timsifive commented 3 years ago

That is totally unrelated to this ticket. It seems like the kind of problem you'd get if there are timing issues. First thing I'd try would be to reduce the adapter speed in your OpenOCD config.