jeanthom/openocd-dirtyjtag

IR capture errors

Opened this issue · 8 comments

[jeanthomas@computer openocd-dirtyjtag]$ sudo src/openocd -f tcl/interface/dirtyjtag.cfg 
[sudo] Mot de passe de jeanthomas : 
Open On-Chip Debugger 0.10.0+dev-01035-g60aaf148-dirty (2020-01-23-14:00)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 100 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 100 kHz
Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!
syncbb_scan (ir_scan=0, scan_type=3, scan_size=672)
Info : JTAG tap: auto0.tap tap/device found: 0x41111043 (mfg: 0x021 (Lattice Semi.), part: 0x1111, ver: 0x4)
syncbb_scan (ir_scan=1, scan_type=3, scan_size=62)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x41111043"
Error: IR capture error at bit 2, saw 0x3FFFFFFFFFFFFF05 not 0x...3
Warn : Bypassing JTAG setup events due to errors
Warn : gdb services need one or more targets defined
^Cshutdown command invoked

ecp5-capture-dirtyjtag.zip
(TMS=D0, TCK=D3, TDI=D2, TDO=D3)

(This issue also occurs with other JTAG targets, such as a Xilinx CPLD)

Looks like it's related to this issue (when programming an ECP5):

Error: tdo check error at line 11
Error:     READ = 0xc1111043
Error:     WANT = 0x41111043
Error:     MASK = 0xffffffff

Those IR capture errors do not seem to appear on an Espressif ESP32S2:

$ ./src/openocd -f tcl/interface/dirtyjtag.cfg
Open On-Chip Debugger 0.10.0+dev-g569944a0-dirty (2021-01-28-22:34)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter driver' not 'interface'
Info : only one transport option; autoselect 'jtag'
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 100 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 100 kHz
Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!

*** syncbb_scan ****************************************
TX	ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
RX	e5340012ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Info : JTAG tap: auto0.tap tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)

*** syncbb_scan ****************************************
TX	ffffffffffffff3f
RX	e1ffffffffffff3f
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 5 -expected-id 0x120034e5"
Warn : gdb services need one or more targets defined

I'll port those dirtyJTAG driver/changes over to Espressif's OpenOCD fork tomorrow to be able to -f target/esp32s2.cfg and hopefully GDB away with it :D

Hi, what version of DirtyJTAG are you using? We did changes in DirtyJTAG 1.4 that changes the way JTAG is bitbanged so it is more compliant with the JTAG standard, maybe that fixed the issue?

Cloned, compiled and flashed DirtyJTAG today, so 1.4 on master... commit 3728cb9.

Thanks! I think I have to try again the DirtyJTAG + OpenOCD + ECP5 combo.

Ok so I performed some tests and unfortunately I'm still having TDO check errors...

Error: tdo check error at line 11
Error:     READ = 0x0000000
Error:     WANT = 0x41111043
Error:     MASK = 0xffffffff
Error: fail to run command at line 12510
Error: tdo check error at line 11
Error:     READ = 0x0000000
Error:     WANT = 0x41111043
Error:     MASK = 0xffffffff
Time used: 0m51s72ms 
svf file programmed failed

What do you think it's the underlying cause?

A couple of things to check I can suggest:

Did you peek at the signals with an oscilloscope? I solved a few of my issues with another JTAG work I've been doing recently by bumping the adapter speed to at least 500kHz (up to 10MHz).

Hope that helps in some way, looking forward to have an affordable and accessible JTAG probe, keep the good work mate! ;)

I think the root cause is buggy code in my OpenOCD driver, but I'm not sure where... Just tried bumping tck to 500kHz but nope 😢

Never tried to probe with an oscilloscope, just with a cheap FX2 logic analyzer (see first post of this issue).