A JTAG/XSVF library for Arduino

Posted on Wednesday, August 19th, 2015 in Arduino, JTAG by DP


Marcelo published a post on his blog about JTAG and the library he wrote.

I have recently felt the need to incorporate a JTAG port in a project to program a hardware that contained a CPLD. The idea was to both program it and perform some integrity tests on the board. I imagined something using pogo pins, to make it easier and quicker to test everything. I would also write the necessary test routines and generate some kind of report.
With this objective in mind, I have decided to design an Arduino shield to do the job. The testing routines were not really a big deal. And I was sure I would find some JTAG library for Arduino ready to be used. That was not the case.
There were some projects using Arduino to control a JTAG TAP (Test Access Port), but they were all incomplete. And I had no idea what was really JTAG. So I had to study a little bit to make things work for me.
In the end, the challenge proved enlightening. There were some caveats, both from hardware and from software. I’ll try to address them in this article.

The library is hosted on Github.

More details at Marcelo’s EE & CS blog.

This entry was posted on Wednesday, August 19th, 2015 at 12:45 pm and is filed under Arduino, JTAG. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

6 Responses to “A JTAG/XSVF library for Arduino”

  1. Drone says:

    Cool – Let’s try this with one of the Dangerous Prototypes CPLD breakout boards.

  2. Spix says:

    Could I use this in combination with a Teensy 3.2 board and Eclipse IDE? I am just starting to setup an IDE and I would love to stick to Eclipse and being able to debug the code on the target. using a hardware hack to be able to access the JTAG pins on the processor as explained in

    I don’t know JTAG but I guess it is something processor and supplier independent interface?

    Any help is very much appriciated

    • Drone says:

      I think Teensy 3.1 comes preloaded with a bootloader that is ATMEL STK500 protocol compliant (because it works with the Arduino IDE, for-example). So I suggest you configure your Eclipse IDE to communicate with the Teensy using the STK500 protocol, which I am pretty sure it should be able to do. Heck working from memory, I don’t even think the JTAG pins are brought out on the Teensy 3.1 – are they?

  3. Spix says:

    I have found these threads on debugging on the target via Eclipse,

    and an approach that does break out the JTAG pins doing some tiny DIY solder work yourself:

    also I have found to be an excelent source on many many topics


Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • Joe Desbonnet: Ya, I can recommend the low melting point solder. I used brand 'ChipQuik' and it's amazingly easy to use.
  • Jerome: I need a new BusPirate for the Fablab ;) Many thanks!
  • Max: Seems like an unexpectedly violent way to remove the chip indeed. A hot air station should of course do the job just fine, but in...
  • jose: Part removal described here is pure butchery, the cheapest hot air station will do a fast and clean job removing the QFP, heat air to...
  • Cody: Yes please