PEmicro - P&E Microcomputer Systems: Over 30 years as an Industry leader in Embedded Systems Development Tools, debug probes, and production programmers
Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service


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

Categories
ARM (29)  
Atmel (14)  
ColdFire Processors (46)
Corporate News (20)
Cyclone Automated Control SDK (1)
Cyclone Stand Alone Programmer (68)
Cypress (12)
Development Boards (9)
Drivers (3)
DSC (11)  
Expert's Corner (6)
GDB Server (12)
GNU (3)  
H8 Microcontrollers (5)
HCS08/RS08/HC08 Micrcontrollers (41)
HCS12Z (3)  
In-Circuit Debugging (62)
In-Circuit Flash Programming (92)
In-Circuit Test (34)
Interface Library Routines (3)
Kinetis (24)
Kinetis ARM (6)
L-Series (1)
LPCxxxx (15)
M16C Microcontrollers (5)
Maxim (11)  
MC(9)S12(X) Microcontrollers (32)
Nordic Semiconductor (6)
NXP (16)  
OpenSDA (6)
OSBDM (1)  
P&E Newsletter (1)
Power Architecture Processors (32)
Production Programming (10)
Qorivva (15)
R8C Microcontrollers (5)
Renesas (5)
RL78 (3)  
RX (2)  
S12Z (14)  
S32 (9)  
SPI Memory (2)
STM32 (6)  
STMicroelectronics (11)
SWD (8)  
Texas Instruments (13)
Toshiba (13)
Trace (1)  
Tracelink (1)
USB Multilink Hardware Interfaces (27)
USB Multilink Universal (21)
USB Multilink Universal FX (19)
Video Demonstrations (3)
Windows 8 (2)



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