I started a project to try to use Arduino as a JTAG interface to perform debugging, programming and scans. The objective is to have a setup like the following diagram:
The complete project should include:
- Arduino sketch
- OpenOCD integration
- Python API
- Arduino shield with common connectors etc.
In particular the shield should have:
- Level shifters between the 5V of Arduino and the voltage of the target chip
- Some standard connectors (at least the 20 pin and the 10 pin)
- Power supply and ground lines
- Some jumpers for configuration (for example to bypass level shifters or to choose connector)
If the target chip that I want to debug works at 5V like the Arduino then the shield could actually be optional, but some wires must be used in place of the JTAG connectors.
I have started a project on GitHub called JTAGduino, that up to now contains the Arduino sketch and a Python API to access basic functionality. It should already be possible to use it to send some JTAG sequences to a 5V target chip.
I decided that inside the Arduino I should keep just some basic code to manage and drive the pins, and let the host PC do the “JTAG” logic of knowing the TAP state and fill Instruction Register and Data Register. By looking at OpenOCD source code it seems like it’s a common design choice.
The default mapping of Arduino pins to JTAG pins is that pins 2, 3, 4, 5 and 6 are used for TCK, TMS, TDI, TDO and TRST. The default speed is the maximum one, with TCK moving at 1MHz.
The next step would be to fork the OpenOCD repository and add the “JTAGduino” driver.

Entries
Iggo
2012/01/29
Ciao, complimenti per il tuo lavoro! Io sono di Venezia!
I have a beagleboard and I m interested in a JTAG emulator (where the “emulator” name comes from?!!?). I sow some of them, but what I can’t really understand (quite ignorant about this subject) is there are 5 signal in a common JTAG, so whats the difference between a Wiggler, a serial and for example a FlySwatter (the one I should use from what I understand)?? Could ur Arduino project fullfill my pourpouses??
Thank u very much!
Sorry for my english…
Balau
2012/01/29
My Arduino project is still at the beginning, it can’t do anything different than 5V (Beagleboard seems to need 1.8V) and can’t yet connect to a debugger.
The main (for me) differences between all the JTAG emulators are speed, voltage, and the software that attaches to them from the PC.
I think for now other than the FlySwatter you may try the Bus Blaster with OpenOCD.
These objects are historically called emulators, but I don’t know where the term comes from (here some hints: http://en.wikipedia.org/wiki/In-circuit_emulator)
Ciao!
Brad
2012/04/29
https://www.adafruit.com/products/757
This is the 4 channel bidirectional logic level converter I’m using to interface the 5v Arduino with 3.3v CPLD I’m attempting to use my Arduino Duemilanove to program a CPLD via Jtag. (Of which I have yet to be successful!) I’m definitely interested if this project has recieved any more of your attention. My hardware is solid, but the software end of my project seems be holding me back.
ElectronicsBuilder
2012/12/02
I am curious if you’ve considered joining an existing open source JTAG utility development effort, such as urjtag ( http://sourceforge.net/projects/urjtag/ ). It should allow for quicker development of JTAGduino given that you could use the exsiting JTAG communication routines, processor and flash discovery routines and all the rest of the goodness already having been worked out.
There’s a subdirectory in the source code called “cable”, which is urjtag’s codeword for any kind of JTAG communication devices, from simple unbuffered cable to an USB-attached device (a.k.a. dongle), where you could perhaps glean some very useful insight. The ft2232.c files seems to be particularly closely related, althought that’s for the bare FT2232C chip in MPSSE mode, not with an MCU behind it. There’s also a “usbblaster.c” file in there that also sounds promising.
Anyway, thanks for the great effort so far, I hope to find some time soon to try out your shield/sketch. Keep up the good work!
Balau
2012/12/02
I am not familiar with UrJTAG, but from what I see it seems to offer low-level access to JTAG. I prefer to target OpenOCD first because it seems to offer higher-level functionality such as GDB server. That said, it will be a good thing to add support to UrJTAG too.
I have at home an Olimex STM32-P152 board and I intend to use it as target for my tests. My current problem is that I am attending an on-line course on compilers and it’s draining all my free time. It should end in a couple of weeks, after that I may be able to breathe and go on with my open projects.
Thanks for your interest!