Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Setup/Hold time on TDI / TMS #11

Open
GideonZ opened this issue Apr 24, 2022 · 1 comment
Open

No Setup/Hold time on TDI / TMS #11

GideonZ opened this issue Apr 24, 2022 · 1 comment

Comments

@GideonZ
Copy link

GideonZ commented Apr 24, 2022

With my purchased Sipeed RV Debugger Plus, which seems to use this firmware, I am not getting any successful JTAG connection using OpenOCD.

One issue is that the setup and hold times on TDI and TMS are near zero. This is wrong!

TDI and TCK toggle AT THE SAME TIME. Even more so, TDI / TMS also change on the falling edge of TCK. I did not expect this, and it is highly suspicious.

Please fix, as this adapter is totally unusable with a timing like this.

@robertlipe
Copy link

** This is a fly-by comment. I don't technically contain any relevant experience with this project, except as a user. (They work OK on the devices I've used...) I was looking at the source and something caught my eye that may be relevant.

In the main source directory of this app, there are two versions of the source code for the main application. I think they share a common ancestor, but it's not clear which is the newest or what the hardware actually shipped with. Just reading the code and the git history, the trunk contains a newer version (10 months vs. 11) of that main app that works hard to avoid code that was there that added delays in transitions like this.

Try replacing jtag_process.c with jtag_process.c.gowin. There are a lot of changes, but all that DELAY stuff that is missing might actually be helpful to this case. It's uncomfortable to busy-wait in an interrupt handler, but that interrupt handler should be most of what that device is doing. It'd cause USB and serial overruns, but it shouldn't be DOING either of those while JTAGGing, right?

Maybe you graft those definitions and uses into the trunk and create a PR.

At the very least, these DELAY_HIGH and DELAY_LOW call sites mark the places in the code create edges in those signals when starting and ending transitions, so it may be helpful to add yet more delays.

Sidebar: you may find #3 handy.

Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants