Using the JTAG Chain Debugger (Dynamic Projects)

This page describes the Check Chain output for projects that use Dynamic Chains. For other projects, see Using the JTAG Chain Debugger (Non-Dynamic Projects).

The Check Chain operation verifies that the connected hardware matches what the project is expecting. It verifies the Pin Mapping, Test Reset Sequence and TCK Frequency. The Check Chain output comes from the Validate step in the Test Reset Sequence, but may additionally include some scans which are used to take control of the UUT (which will be referred to as the Test Preparation step). The scans run by the validate step also differ depending on where the reset sequence is being run from; when debugging in the JTAG Chain Debugger or on the Pin Mapping screen there are some additional phase 2 scans to help identify issues that are not present when running before tests on the Run Tests, Debug Connection Test or Analyser screens.

Output structure

When Check Chain data is written to the output window it is organised into nested, collapsible regions. To view scan data or additional analysis, any of the subnodes may be expanded. When debugging, the top-level region is expanded to show an overview of the completed steps. When running before tests, output is hidden unless an error occurs. The example below includes all possible output which includes the phase 2 scans and the test preparation step:

For each subchain there will be a top-level region, Check Chain details for subchain 'name'.

  • Confirmation of test reset sequence completion and a valid starting state.
  • The initial TCK frequency used in the first set of scans.
  • JTAG scan data phase 1 - the scans used to confirm that the chain is connected and that the expected devices are present. Each scan has its own region inside.
  • Analysis phase 1 - the analysis of the phase 1 scan data.
  • Confirmation that Phase 1 scans succeeded.
  • Increasing TCK to the target frequency - A higher TCK frequency to use for further scans.
  • JTAG scan data phase 2 - the scans used to confirm the length of each device's Boundary Scan Register. Each device has its own region inside.
  • Analysis phase 2 - the analysis of the phase 2 scan data.
  • Confirmation that Phase 2 scans succeeded.
  • Load Safe Bitstream - the scans used to load the initial pin states.
  • Confirmation that the main set of check chain scans succeeded.
  • Preparation for Testing - the scans used to take control of the UUT.

When all scans succeed, a success message is shown at the end: Check Chain completed OK on subchain 'name'. If a step fails, an error is shown in red and the regions describing the failure are expanded.

JTAG scan data phase 1

The first JTAG scans confirm that the JTAG chain is connected, that data scans all the way through the chain, and that the expected devices are present. These scans run at a maximum of 100 kHz the first time they are run. They are run on the subchain selected by the reset sequence, and all other subchains are left untouched.

All devices that have ID codes must have them loaded before the Validate step starts, and any devices without ID codes must use the BYPASS instruction instead. The simplest way to achieve this is to include a TMS Reset before the Validate step.

The region starts with a note that marker data is highlighted in the TDI data, and the expected location of that marker is highlighted in the TDO data. It contains three regions, each of which corresponds to a single JTAG scan:

DR scan to get IDCODEs

If this scan fails then check:

  • All necessary cables are plugged in.
  • The UUT is powered.
  • The pin mapping defines TDI, TDO, TMS and TCK on the correct pins and they connect through to the UUT.
  • The pin mapping is configured to use the correct voltage(s).
  • If there is an nTRST pin or other reset pins, they are defined in the pin mapping and are in the correct state before the Validate step starts.
  • There is a TMS Reset, or another method of getting all JTAG devices to select IDCODE/BYPASS, before the Validate step.
  • The correct BSDL files are being used for the devices on the UUT.
  • All of the individual devices on the JTAG chain are powered and out of reset (for example, another device on the UUT may need to enable power or release resets).
  • The compliance values given in the BSDL file for each JTAG device; if these pins are not in the specified states then the JTAG functionality of the device may be disabled.
  • The wiring and UUT design have the correct wiring and termination according to the XJTAG Design For Test guidelines; poor signal integrity can cause the JTAG chain to break even if TCK is running at 100 kHz.

IR scan to measure total IR length and put all devices into BYPASS mode

If this scan fails then check:

  • The latest BSDL file from the JTAG device manufacturer is being used.
  • The compliance values given in the BSDL file for each JTAG device; if these pins are not in the specified states then the JTAG functionality of the device may be disabled or broken in some way.
  • The wiring and UUT design have the correct wiring and termination according to the XJTAG Design For Test guidelines; poor signal integrity can cause the JTAG chain to break even if TCK is running at 100 kHz.

DR scan to count devices

If this scan fails then check:

  • The compliance values given in the BSDL file for each JTAG device; if these pins are not in the specified states then the JTAG functionality of the device may be disabled or broken in some way.
  • The wiring and UUT design have the correct wiring and termination according to the XJTAG Design For Test guidelines; poor signal integrity can cause the JTAG chain to break even if TCK is running at 100 kHz.

If any of these scans fail and there is no obvious cause then check with the JTAG device manufacturer for any Errata, and with XJTAG Support in case there are known issues with the devices.

Analysis phase 1

This region analyses the data from the phase 1 scans, showing a summary for each:

  • IDCODE check
  • IR length check
  • Device count

If all three checks pass, a success message IDCODEs, IR length and Device count all OK is shown. If a check fails, the analysis step will be expanded and an error will be displayed in red.

Increasing TCK to the target frequency

After basic communication with the JTAG chain is established, the TCK frequency is increased to the target frequency. If the selected hardware configuration is unable to achieve the target frequency requested then both the target frequency and the effective frequency used by the hardware are displayed. Hardware that supports AutoSkew applies it here.

If errors are reported here then check:

  • The maximum target frequency is not too high for any of the JTAG devices in the chain.
  • There are sufficient ground wire connections between the JTAG controller and the UUT, and at least one very closely follows the TCK wire.
  • There is termination on at least TCK and TDO on the UUT, following the XJTAG Design For Test guidelines. If these can't be added to the UUT then add them to the wires or test fixture as close to the UUT ends of the wires as possible.
  • There is filtering on all reset signals (including nTRST) that have external connections to the UUT. If these can't be added to the UUT then add them to the wires or test fixture as close to the UUT ends of the wires as possible.

Try a lower TCK frequency, or find the maximum TCK frequency automatically, and check the chain again. A mismatch between what was found at the minimum frequency and at the target frequency can also be caused by instability on the board.

JTAG scan data phase 2

Phase 2 confirms that each device on the JTAG chain implements the SAMPLE and PRELOAD JTAG instructions, and that their Boundary Scan Register length matches the length defined in the BSDL file. This only occurs when Check Chain is run in JTAG Chain Debugger when provided with the BSDL files for the UUT, or on the Pin Mapping screen in other XJTAG applications.

If there is more than one JTAG device on the chain, scans are organised into regions by device: Device n Boundary Scan Register length scans. The first device in the JTAG chain is put into PRELOAD with all other devices put into BYPASS, using an IR scan to put Device n into PRELOAD and others into BYPASS. At least one DR scan to measure Boundary Scan Register length in Device n then measures the entire length of the JTAG chain, and so determines the length of the first device's Boundary Scan Register. If the device uses a different instruction value for SAMPLE then the sequence is repeated for the SAMPLE instruction. This process is then repeated for each subsequent device, making sure only one device at a time is ever in SAMPLE or PRELOAD.

Analysis phase 2

This region reports whether the Boundary Scan Register length measured for each device matches the corresponding BSDL file.

When all devices pass, the message Boundary Scan Register length for all JTAG devices OK is shown.

Incorrect Boundary Scan Register length

If this fails with Incorrect Boundary Scan Register length then check:

  • The BSDL file used for the JTAG device is the latest from the IC manufacturer for that part. Older versions may have an incorrect boundary scan register length.
  • There are no relevant errata for the device.
  • All banks on the JTAG device are powered up. On some devices an unpowered bank may cause parts of the boundary scan to by bypassed, which will require a modified BSDL file.
  • The compliance values given in the BSDL file for each JTAG device; if these pins are not in the specified states then the JTAG functionality of the device may be disabled or broken in some way.
  • Errata for the other devices in the JTAG chain. If a device does not reliably implement the BYPASS instruction as a 1-bit DR value then that will affect the detected Boundary Scan Register length for other devices on the JTAG chain.
  • All of the checks listed under Analysis phase 1.

Broken chain detected

If this fails with Broken chain detected when determining the Boundary Scan Register length then check:

  • The BSDL file used for the JTAG device is the latest from the IC manufacturer. Older versions may have incorrect instructions defined.
  • There are no relevant errata for the device.
  • All banks on the JTAG device are powered up. On some devices any unpowered bank may break the entire Boundary Scan Register.
  • The compliance values given in the BSDL file for each JTAG device. If these pins are not in the specified states then the JTAG functionality of the device may be disabled or broken in some way.
  • Errata for the other devices in the JTAG chain. If the previous device is not JTAG compliant then it may break the JTAG chain when switching from SAMPLE or PRELOAD back into EXTEST.
  • All of the checks listed under Analysis phase 1.

Load Safe Bitstream

Before taking boundary scan control of the pins on a JTAG device, the state to apply to those pins (driving high, driving low or setting to high impedence) must be initialised. The default state is determined from the XJTAG project and is the Safe Bitstream. All devices are loaded with their PRELOAD instruction, which may be the same as their SAMPLE instruction, before the Safe Bitstream is scanned into the boundary scan register. This is shown as two scans: IR scan to put all devices into PRELOAD mode and DR scan to preload Safe Bitstream.

If either of these scans fail then try to run Check Chain on the Pin Mapping screen, or in the JTAG Chain Debugger, with the same profile selected. This allows phase 2 to run, which can help pinpoint the cause of errors. If this is not possible then check the suggestions given for Analysis phase 2.

Preparation for testing

After the reset sequences on all Subchains in the Profile are complete, all of the JTAG devices should have had their Safe Bitstream loaded into the Boundary Scan Register using the PRELOAD instruction. By default the devices will not yet be controlled by boundary scan, and so not be in EXTEST, but this may not be the case if Raw JTAG, SAFE, SET or SET_DEFAULT_OVERRIDE statements have been used in the reset sequence.

To take control of all JTAG Devices in the Profile, they are scanned into EXTEST simultaneously across all JTAG chains. This is the first time that all of the Subchains in the Profile have been scanned simultaneously. Any errors here are likely to be related to scanning more than one JTAG chain at the same time.

Broken chain error

If a broken chain error is reported then check:

  • There are sufficient ground wire connections between the JTAG controller and the UUT: at least one ground wire should be very close to each TCK wire all the way from its connections to the JTAG controller to its connections to the UUT.
  • There is termination on at least each TCK and TDO on the UUT, following the XJTAG Design For Test guidelines. If these can't be added to the UUT then add them to the wires or test fixture as close to the UUT ends of the wires as possible.
  • There is filtering on all reset signals (including nTRST) that have external connections to the UUT. If these can't be added to the UUT then add them to the wires or test fixture as close to the UUT ends of the wires as possible.
  • There is sufficient spacing between the JTAG wires for the different Subchains: interference between the different JTAG chains can be a common cause of problems.
  • There aren't any unexpected dependencies between the different Subchains in the Profile. For example, if a Profile includes Subchain1 and Subchain2 and their reset sequences are run in that order then the Validate step may run on Subchain1 without problems, but if anything in the reset sequence for Subchain2 interferes with Subchain1 then it could become apparent in this step.

With all devices now in EXTEST, the state of the UUT is dependent on the XJTAG project: the categorisation of devices, constant pins and disable values. If any of these are wrong or missing then subsequent JTAG scans may not work.

First DR scan after entering EXTEST

If the first DR scan after entering EXTEST fails then check:

  • If any JTAG devices can control the power, power enable or reset signals to any part of the UUT. If they do then check if this might impact any JTAG devices and include constant pins or disable values as necessary.
  • If any JTAG devices can control the routing of the JTAG signals. If they can, such as controlling multiplexers or buffer enables, then include constant pins or disable values as necessary.
  • All of the checks listed under Broken Chain Error.
  • The BSDL file used for the JTAG device is the latest from the IC manufacturer. It may have incorrect instructions defined.
  • Errata for all JTAG devices. The Boundary Scan Register on a non-compliant JTAG device might behave differently in EXTEST to PRELOAD or SAMPLE.

A broken JTAG chain reported on one Subchain does not necessarily mean that the project setup is incorrect for devices on that Subchain.

Second DR scan after entering EXTEST

If the second DR scan after entering EXTEST fails then check:

  • All of the other checks in this section. An incorrect constant pin or disable value might not have an immediate effect on causing the JTAG chain to break.
  • All reset sequences for any Raw JTAG, SET statements or missing Validate steps. In these cases it is possible that the reset sequence modified the Boundary Scan Register to contain values other than the default Safe Bitstream. If the values in the default Safe Bitstream do not keep the UUT in a suitable state but the values applied in the reset sequence do then it is this scan that will fail. If the reset sequence uses SET statements then these will not persist beyond the reset sequence, so use SET_DEFAULT_OVERRIDE instead.