Author Topic: Identifying undocumented JTAG pinout?  (Read 2275 times)

0 Members and 1 Guest are viewing this topic.

Offline pceeTopic starter

  • Regular Contributor
  • *
  • Posts: 60
  • Country: us
Identifying undocumented JTAG pinout?
« on: June 22, 2021, 03:05:17 am »
I’m looking at a board that has a few test points scattered around the board, including a cluster of 6, and I suspect some of them collectively make up a JTAG interface.

Is there any good way to identify the correct pinout?  Any telltale signals that I should look for?  First I plan to rule out anything connected to ground.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6756
  • Country: ro
Re: Identifying undocumented JTAG pinout?
« Reply #1 on: June 22, 2021, 04:04:55 am »
Usually the JTAG pins are fixed on a chip's pinout, so if you can identify the main chip (I assume that would be a FPGA or an MCU), then search for its datasheet, then test the continuity between the 6 testing points and the main chip.

If there are ,ore than one JTAG enabled chip, they are usually daisy chained to the same JTAG connector.

Another hint might be to identify the GND pin in the JTAG connector, then the Vcc, and see if their order in the 6 pins connector correspond with the JTAG programmer's pinout.

If you can attach a clear picture of the board, somebody might recognize the board and the connector.
 
The following users thanked this post: pcee

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11763
  • Country: us
    • Personal site
Re: Identifying undocumented JTAG pinout?
« Reply #2 on: June 22, 2021, 04:05:18 am »
First if all find ground and power. This should be easy enough.

Weakly pull-up/down all the pins and find the inputs/outputs. Just make sure to override whatever pull-up/down resistors may be on the board.

Power cycle/reset the device.

Then monitor all pins on the  logic analyzer and drive them one by one with a clock (something slow, like 1 kHz).  If there is a JTAG, one of the pins will clock out a device ID. This pin would be TDO and the clock pin would be TCK. If that happens, then the remaining two can just be found experimentally with a JTAG probe.

And you only really need to monitor one previously identified output for TDO.  But just in case monitor all of them.
« Last Edit: June 22, 2021, 04:06:55 am by ataradov »
Alex
 
The following users thanked this post: pcee

Offline pceeTopic starter

  • Regular Contributor
  • *
  • Posts: 60
  • Country: us
Re: Identifying undocumented JTAG pinout?
« Reply #3 on: June 27, 2021, 06:50:13 pm »
Weakly pull-up/down all the pins and find the inputs/outputs. Just make sure to override whatever pull-up/down resistors may be on the board.
I understood everything else, but how would this work?  Is the idea that any pin that I can successfully pull both high and low is an input, and any pin that I can’t is an output that the chip is driving?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11763
  • Country: us
    • Personal site
Re: Identifying undocumented JTAG pinout?
« Reply #4 on: June 27, 2021, 07:23:40 pm »
Yes, if the pin is driven by the device, it would be able to override your pull-ups and pull-downs.

But really, all you need to do is observe all the pins with a logic analyzer and use a clock source with current limiting resistor and supply that clock to all the pins. If you find a pin that has some data on it other than the clock pin, you automatically identified both TCK and TDO.
« Last Edit: June 27, 2021, 07:25:24 pm by ataradov »
Alex
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Identifying undocumented JTAG pinout?
« Reply #5 on: June 27, 2021, 11:53:01 pm »
I use a wiggler program.
It configures a pin as GPIO input with high pullup, then low pullup at a 100 Hz or so.
Then you look for the point that's wiggling.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11763
  • Country: us
    • Personal site
Re: Identifying undocumented JTAG pinout?
« Reply #6 on: June 28, 2021, 12:13:24 am »
I use a wiggler program.
This may not work if there are relatively strong pull-up or pull-down resistors on the board, for example. Internal MCU resistors are typically in the 100 kOhm range, on the board it is not uncommon to see 10 kOhm.

For this wiggler setup it is better to use an output driven low and high with a series resistor with a low value (< 1kOhm, probably close to 330 Ohm). This would be strong enough to override any other pull resistors, but not strong enough to cause any issues with conflicts.
Alex
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6756
  • Country: ro
Re: Identifying undocumented JTAG pinout?
« Reply #7 on: June 28, 2021, 03:48:48 am »
To identify which ones are the input pins, I simply connect the oscilloscope to the pin, then touch first the GND of the probe to discharge any electrostatic charges I may have, and then touch the pin with the finger.

The finger will induce more 60Hz wiggling on an input pin than on an output pin.  Seems brutal, but if you touch the GND first it should be safe for the board.


Online ataradov

  • Super Contributor
  • ***
  • Posts: 11763
  • Country: us
    • Personal site
Re: Identifying undocumented JTAG pinout?
« Reply #8 on: June 28, 2021, 04:35:30 am »
Nobody would leave JTAG pins floating, they would be pulled up or down internally or externally.
Alex
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Identifying undocumented JTAG pinout?
« Reply #9 on: June 28, 2021, 11:31:40 am »
I use a wiggler program.
This may not work...
It's always worked fine for me.
Of course since everything is current limited you can get away with just wiggling an output too.
You might have to do that if you only have gpio-sysfs to play with.
 

Offline Fred27

  • Supporter
  • ****
  • Posts: 727
  • Country: gb
    • Fred's blog
Re: Identifying undocumented JTAG pinout?
« Reply #10 on: June 30, 2021, 12:36:20 pm »
I found a Raspberry Pi program called JTAGenum helped narrow down the possibilities to something more manageable for checking by hand.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf