riscv-openocd icon indicating copy to clipboard operation
riscv-openocd copied to clipboard

JTAG does not use debugger's idle count

Open atthecodeface opened this issue 6 years ago • 6 comments

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.

atthecodeface avatar Nov 18 '18 16:11 atthecodeface

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.

timsifive avatar Nov 20 '18 22:11 timsifive

Didn't OpenOCD use to do this?

mwachs5 avatar Nov 20 '18 22:11 mwachs5

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

rbarzic avatar Aug 12 '20 17:08 rbarzic

This problem likely still exists.

timsifive avatar Aug 12 '20 19:08 timsifive

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?

cquartier avatar May 12 '21 21:05 cquartier

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.

timsifive avatar May 12 '21 22:05 timsifive