Author Topic: EEVblog #499 - What is JTAG and Boundary Scan?  (Read 25983 times)

0 Members and 1 Guest are viewing this topic.

Online EEVblog

  • Administrator
  • *****
  • Posts: 29986
  • Country: au
    • EEVblog
EEVblog #499 - What is JTAG and Boundary Scan?
« on: July 27, 2013, 12:00:57 am »
What is the JTAG interface and Boundary Scanning, how does it work, and what is it useful for?

 

Offline babi

  • Contributor
  • Posts: 12
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #1 on: July 27, 2013, 12:23:48 am »
As always, thank you Dave.

Has anyone tried to configure a Xilinx chip using an embedded microcontroller (even SVF or XSVF player)? That would be an interesting subject.
There are some libraries out there based on xapp058 App Note, but I wonder which of them is better to get started with.

I also wanted to know if it is better to use an FT2232 in conjunction with an application on the PC in order to configure FPGA/CPLD chips instead of using a microcontroller.

Thanks.
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2016
  • Country: us
EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #2 on: July 27, 2013, 12:27:13 am »
The problem with that is that the PC will have to essentially bit bang the whole JTAG protocol. The good side is that it can be reconfigured by software very easily.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12029
  • Country: gb
    • Mike's Electric Stuff
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #3 on: July 27, 2013, 12:44:56 am »
As always, thank you Dave.

Has anyone tried to configure a Xilinx chip using an embedded microcontroller (even SVF or XSVF player)? That would be an interesting subject.
There are some libraries out there based on xapp058 App Note, but I wonder which of them is better to get started with.

I also wanted to know if it is better to use an FT2232 in conjunction with an application on the PC in order to configure FPGA/CPLD chips instead of using a microcontroller.

Thanks.
Most FPGAs have simpler configuration options than JTAG for use with microcontrollers, so you'd normally use that rather then JTAG.
Not sure what Xilinx offer, but Lattice supply some nice code for JTAG  device programming (CPLDs and FPGAS) from microcontollers, which is very easy to integrate, and can program from a file from your filesystem (SD etc) , or from a CONST data array, auto-generated by their ISPVM programmer software from the device JEDEC file.. 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline robrenz

  • Super Contributor
  • ***
  • Posts: 3035
  • Country: us
  • Real Machinist, Wannabe EE
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #4 on: July 27, 2013, 12:54:57 am »
Very informative Dave, excellent :-+

Offline babi

  • Contributor
  • Posts: 12
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #5 on: July 27, 2013, 12:58:41 am »
Most FPGAs have simpler configuration options than JTAG for use with microcontrollers, so you'd normally use that rather then JTAG.
Not sure what Xilinx offer, but Lattice supply some nice code for JTAG  device programming (CPLDs and FPGAS) from microcontollers, which is very easy to integrate, and can program from a file from your filesystem (SD etc) , or from a CONST data array, auto-generated by their ISPVM programmer software from the device JEDEC file.. 

Thanks Mike.

So, you say that using a microcontroller to program an FPGA/CPLD is better than bit banging the configuration file directly to the chip from the PC?

Yeah, I know that there are better ways to configure modern FPGAs, but I want to use JTAG to program low-cost Xilinx chips.

Xilinx also offers a code library for configuring their chips using JTAG, but I didn't find it easy to start with.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12029
  • Country: gb
    • Mike's Electric Stuff
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #6 on: July 27, 2013, 01:34:24 am »
Bit-banging anything from a PC is going to be slow, and impossible when USB is the only IO available.Use a proper JTAG inteface - either one with an MCU, or the FTDI solution which handles the  low-level protocol in hardware.

I was referring to embedded systems where a MCU needs to update CPLD/FPGA code in the field. 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12029
  • Country: gb
    • Mike's Electric Stuff
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #7 on: July 27, 2013, 01:39:32 am »
JTAG reverse engineering video  :

Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Smokey

  • Super Contributor
  • ***
  • Posts: 1592
  • Country: us
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #8 on: July 27, 2013, 01:52:19 am »
I remember you opening up a dangerous prototypes Bus Blaster in a mail bag a while back.  That would be a good open source hobbyist alternative to the pro tools. 
http://dangerousprototypes.com/docs/Bus_Blaster
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7240
  • Country: us
    • SiliconValleyGarage
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #9 on: July 27, 2013, 01:59:27 am »
its not necessary to go through all pins. jtag has a number of commands. there are general commands and device specific commands.

in a chain, after powerup, you would first send the command to identify how many devices are on the bus. (basically you send in a single logic 1 and clock. count the number of clockticks before the one comes back out. that the number of devices. then send the identify command. each device will send out manufacturer and part number.
then you can tell individual devices to temporarily go in 'bypass'. meaning they pull their chain out of the loop and short their tdi and tdo together. that is how you speed up since you don't need to race through those shifters.

there are even ttl chips with jtag. there is an equivalent of a 74245 with 4 jtag pins. this allows you to inject such a device in a critical pathway on a complex board and ease testing.
or , using a little adapter board, temporarily remove the 74245 and pop the jtag version in. hook up the jtag dongle to the little adapter board and bob's your uncle.

74bct8245 is such a part. there is a whole family of em http://www.ti.com/lsds/ti/logic/boundary-scan-jtag-logic-products.page

now, before you get all excited and think about building your own superduper jtag tool : most of the information pertaining to guts of the devices are secret. some manufacturer specify some of the codes (the comon ones as mandated by the standard,but some of the advanced stuff is under NDA ...
therefore the JTAG probes with that fancy software that dave showed cost $$$
« Last Edit: July 27, 2013, 02:05:32 am by free_electron »
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline cthree

  • Frequent Contributor
  • **
  • Posts: 258
  • Country: ca
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #10 on: July 27, 2013, 02:17:18 am »
Another excellent FF video. Thanks Dave!
 

Offline chicken

  • Regular Contributor
  • *
  • Posts: 221
  • Country: us
  • Rusty Coder
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #11 on: July 27, 2013, 02:27:02 am »
Great video!

Is there an OSS/free equivalent to the XJAnalyser software for use with Bus Blaster or similar tools? Definitely looks like a useful tool for reverse engineer and hw hacking.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7240
  • Country: us
    • SiliconValleyGarage
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #12 on: July 27, 2013, 02:45:11 am »
Great video!

Is there an OSS/free equivalent to the XJAnalyser software for use with Bus Blaster or similar tools? Definitely looks like a useful tool for reverse engineer and hw hacking.

limited, yes. like i said : the real algorithms are only made available to select partners under NDA.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline FrankT

  • Regular Contributor
  • *
  • Posts: 151
  • Country: au
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #13 on: July 27, 2013, 03:13:00 am »
How does the XJTAG tool compare to the jtag tools offered by, say, Atmel for programming and debugging their own chips?
Can XJTAG be used instead of the atmel tools?  On my todo list is to get an ARM dev board and play with that - will any JTAG tool allow me to program the ARM?

Frank
 

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 4246
  • Country: us
  • hp>Agilent>Keysight>?
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #14 on: July 27, 2013, 03:14:28 am »
Another excellent FF video. Thanks Dave!

Seconded, never heard of it until now, but fascinating stuff.
I am a Test Equipment Addict (TEA) - by virtue of this forum signature, I have now faced my addiction
 

Offline babi

  • Contributor
  • Posts: 12
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #15 on: July 27, 2013, 06:22:17 am »
How does the XJTAG tool compare to the jtag tools offered by, say, Atmel for programming and debugging their own chips?
Can XJTAG be used instead of the atmel tools?  On my todo list is to get an ARM dev board and play with that - will any JTAG tool allow me to program the ARM?

Frank

Yes, there are a couple of JTAG Programmer/Debugger tools for ARM processors. You can use XJTAG for that purpose in ARM RealView, but you know, XJTAG is quite expensive.

You can use J-Link Programmer and Debugger for ARM processors. It is easy to use and much cheaper than the XJTAG.
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 29986
  • Country: au
    • EEVblog
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #16 on: July 27, 2013, 07:42:53 am »
limited, yes. like i said : the real algorithms are only made available to select partners under NDA.

Altium Designer has this ability to live view the boundary scan data and map to images of the chip and pins (via the USB JTAG adapter), even funkier than the XJTAG software if you are the PCB designer (no capability for production test system etc). I don't recall it having any of that additional secret squirrel capability though.
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 29986
  • Country: au
    • EEVblog
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #17 on: July 27, 2013, 07:44:04 am »
will any JTAG tool allow me to program the ARM?

In theory, yes. In practice, the software has to support the device on question.
 

Offline tinhead

  • Super Contributor
  • ***
  • Posts: 1905
  • Country: 00
    • If you like my hacks, send me a donation
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #18 on: July 27, 2013, 08:44:01 am »
other good boundary scan programms:

Universal Scan - http://www.universalscan.com/

TopJTAG - http://www.topjtag.com/


The TOPJtag is already good enought for most things, it is as well cheaper than UniversalScan.
UniversalScan have excellent videos as well, easy to understand how to use that app.

Both can use tons of other/known JTAG cables, no need to buy special one from Boundary Scan tool manufacturer.
Their software is comparable to XJAnalyser, where (in my opinion) UniversalScan is a bit better than TopJTAG.
« Last Edit: July 27, 2013, 09:08:31 am by tinhead »
I don't want to be human! I want to see gamma rays, I want to hear X-rays, and I want to smell dark matter ...
I want to reach out with something other than these prehensile paws and feel the solar wind of a supernova flowing over me.
 

Online daqq

  • Super Contributor
  • ***
  • Posts: 1594
  • Country: sk
    • My site
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #19 on: July 27, 2013, 09:48:49 am »
Thanks Dave, that was a very useful video.


Another fun usage of JTAG reverse engineering I've seen was here:

http://nsa.unaligned.org/jrev.php

Where he reverse engineered the schematic (or rather some of it) for a whole really big board.
Believe it or not, pointy haired people do exist!
+++Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
 

Offline RoadRunner

  • Regular Contributor
  • *
  • Posts: 237
  • Country: de
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #20 on: July 27, 2013, 11:17:18 am »
i am a bit confused about the hardware & the software for JTAG.

there are a number of different devices, like pic32 ,xilinx FPGA, Altera FPGA and ARM processor they all have JTAG . i know they we can access them by a same jtag cable but.

what i am wondering  if  FT2232 based JTAG hardware will work for all of them ?

is there software or hardware tool available for hobby use like with limited functionality.
 

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #21 on: July 27, 2013, 11:40:21 am »
Excellent video Dave!  :-+

Found a quick pricelist for the XJTAG thing - have a look at this: http://www.anacom.com.br/downloads/pdf/XJTAG-USPL-Q1-2011.pdf
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline RJdaMoD

  • Contributor
  • Posts: 11
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #22 on: July 27, 2013, 12:52:35 pm »
what i am wondering  if  FT2232 based JTAG hardware will work for all of them ?

is there software or hardware tool available for hobby use like with limited functionality.
Hi, look for urjtag. Although it is cmdline-tool (that might limit its functionality for some, but it's open source, so you can write your own gui if you want one) it should be sufficient for the hobbyist.
 

Offline Ericho

  • Regular Contributor
  • *
  • Posts: 52
  • Country: be
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #23 on: July 27, 2013, 01:45:17 pm »
Excellent video Dave  :-+ thanks
 

Offline RoadRunner

  • Regular Contributor
  • *
  • Posts: 237
  • Country: de
Re: EEVblog #499 - What is JTAG and Boundary Scan?
« Reply #24 on: July 27, 2013, 01:47:39 pm »
what i am wondering  if  FT2232 based JTAG hardware will work for all of them ?

is there software or hardware tool available for hobby use like with limited functionality.
Hi, look for urjtag. Although it is cmdline-tool (that might limit its functionality for some, but it's open source, so you can write your own gui if you want one) it should be sufficient for the hobbyist.


 Thank you :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf