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

Add proper frequency control #42

Merged
merged 23 commits into from
Nov 9, 2019
Merged

Add proper frequency control #42

merged 23 commits into from
Nov 9, 2019

Conversation

jeanthom
Copy link
Collaborator

Maybe it is time to fix one of the earliest issues of DirtyJTAG, issue #13

@jeanthom jeanthom added the wip Work in progress label Aug 9, 2019
@jeanthom
Copy link
Collaborator Author

jeanthom commented Nov 2, 2019

This PR shows promising results but there are some bugs:

master output:

IR length: 8
Chain length: 1
Device Id: 01001001011000000010000010010011 (0x49602093)
  Manufacturer: Xilinx (0x093)
  Part(0):      xc9536xl (0x9602)
  Stepping:     4
  Filename:     /usr/share/urjtag/xilinx/xc9536xl/xc9536xl_cs48

jtag-freq output:

IR length: 9
Chain length: 2
Device Id: 01001001011000000010000010010011 (0x49602093)
  Manufacturer: Xilinx (0x093)
  Part(0):      xc9536xl (0x9602)
  Stepping:     4
  Filename:     /usr/share/urjtag/xilinx/xc9536xl/xc9536xl_cs48
Device Id: not supported (bit 0 was not a 1)

@jeanthom
Copy link
Collaborator Author

jeanthom commented Nov 2, 2019

I've captured both signals using Sigrok:

  • D0: TMS
  • D1: TDI
  • D2: TDO
  • D3: TCK

capture.zip

@jeanthom
Copy link
Collaborator Author

jeanthom commented Nov 2, 2019

Looks like TDI comes right after TCK which introduces some delay. Will try to swap jtag_set_tck and jtag_set_tdi calls in tim2_isr.
Capture d’écran 2019-11-02 à 23 32 54

@jeanthom
Copy link
Collaborator Author

jeanthom commented Nov 2, 2019

Reversing the function order seems to solve the issue but I'm worried by the delay between TCK and TDI. Perhaps direct write to the registers could trim the fat?

@jeanthom
Copy link
Collaborator Author

jeanthom commented Nov 3, 2019

The narrator: writing directly to the registers did improve the latency between TDI and TCK signals, making Jean the happiest child on earth...

@jeanthom jeanthom changed the title [WIP] Add proper frequency control Add proper frequency control Nov 9, 2019
@jeanthom
Copy link
Collaborator Author

jeanthom commented Nov 9, 2019

Uniport (write once to the port register for TDI/TCK) functionality was removed as it turned out to be unreliable.

jtag-freq works great on Blue Pill target, we can get faster than the 50kHz we used to have.

@jeanthom jeanthom merged commit 00bef08 into master Nov 9, 2019
@jeanthom jeanthom mentioned this pull request Nov 9, 2019
@jeanthom jeanthom deleted the jtag-freq branch January 16, 2020 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant