PEmicro | Experts in Embedded tools for Flash Programming and Development
Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

Please accept the use of cookies on our site

At PEmicro we use web browser cookies in order to provide you with an enhanced experience and in order to be able to do things like shopping cart processing and identify you when you login to our website.

Click here to accept

by Kevin Meyer

The JTAG specification introduced daisy chaining of MCUs in order to reduce the number of headers required to debug and program multiple MCUs. JTAG daisy chaining allows multiple MCU’s (and other JTAG compatible hardware, such as FPGAs) to share a single debug header. PEmicro currently supports daisy chaining of ARM-Cortex MCUs via our Cyclone programmers and Multilink debug probes. The same is true for most PEmicro software, including our Eclipse plugin GDB Server, and our Cyclone automation and control packages.

Connection: There are four pins necessary for JTAG: TDI, TMS, TCK, and TDO.

  • TDI is the input pin for JTAG data.
  • TMS is a control signal.
  • TCK is the clock signal.
  • TDO is the data output.

In a daisy chain setup, TMS and TCK are common to every device in the chain. This means that when routing your board, these signals should be routed to every device in the chain. TDO and TDI are a little more interesting. The debugger should attach its TDI pin to the TDI pin of the first device in the chain. That first device should then pass its TDO to the TDI pin of the next device, and so on. There is no practical limit to this chaining. Finally the last device in the chain should attach its TDO pin to the TDO pin of the debugger.

JTAG Daisy Chain
Figure 1: JTAG Daisy Chain (Click to Enlarge)

Debugging: JTAG relies on the JTAG state machine to shift data into the IR (instruction register) and DR (data register) that are present on every device. The current state and value of TMS determines the next state. Using the state machine, the debugger shifts in instructions and data. The key instruction for daisy chaining is the BYPASS instruction. By shifting all "1"s into a certain device’s IR register, that device can be bypassed. In daisy chaining, all devices are bypassed except for the target device. That means that the debugger is effectively talking to one device in the chain at a time.

PEMicro Implementation: In order for a PEmicro hardware interface to debug or program a certain device in a chain, two parameters are necessary: Tap number, and Pre IR bits. Figure 1 above is included in all PEmicro software and is useful for reference. The Tap number is the index of the device in the chain. As you can see, the first device connected to TDI is index 0, then index 1 and so on. The last device connected to the TDO of the debugger is the index number of devices minus 1. The Pre IR bits parameter is the sum of the length of the IR registers of the devices between the target device and TDO pin of the debugger. One might think that this parameter should be called "Post" IR bits, but "Pre" makes sense because these bits must be shifted in first. Once the user has specified these two parameters, PEmicro can infer the rest and connect to the target.

Troubleshooting: The most common mistake in specifying parameters occurs when setting Pre IR bits. Make sure that you are counting the number of bits after the device up to the TDO pin of the debugger. Also, it is not always a straightforward task determining the width of the IR register of a particular device. Usually this number is 4 for ARM, but some devices actually contain more than one JTAG device internally and are therefore larger. Consulting the device data sheet is usually a great place to start.

Quick Note: One important distinction to grasp is that JTAG daisy chaining is NOT a gang programming interface. A debugger/programmer can only communicate with one device at a time in the chain.

Conclusion: JTAG Daisy Chaining is an important feature that can simplify hardware layouts and increase productivity. The most difficult part of debugging in a daisy chain setup is selecting the correct initial parameters. PEmicro technical support is more than happy to assist in selecting these parameters. Once that is done, things should work properly without any further user intervention.

search in blog posts


Product pages
Cyclone (41)
Cyclone FX (43)
Multilink (22)
Multilink FX (17)
GDB Server (11)
Prog ACMP (6)
Interface Library Routines (5)

ARM (36)
NXP (43)
Microchip (4)
Cypress (5)
Infineon (1)
Maxim (2)
Nordic Semiconductor (2)
Silicon Labs (4)
STMicroelectronics (5)
Texas Instruments (1)
Toshiba (2)
Renesas (6)

Production Programming (52)
Debug (27)
Automated Control (13)
Miscellaneous (36)

© 2018 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement