Raw JTAG Access

There are cases where it is necessary to manipulate the JTAG chains directly, e.g. to explicitly set the TCK frequency or to set up a scan bridge controller. XJEase therefore has a JTAG block, within which special commands can be used to read and write data to the JTAG chains and manipulate the TAP controllers.

JTAG block syntax

JTAG
    ...
END;

Functions and statements to use inside a JTAG block

The following functions and statements can only be used inside a JTAG block:

  • Raw JTAG scans are used to write data to and read data back from the JTAG chains directly.
  • The SAFE function retrieves a value for a specific device that, when scanned into the device's boundary scan register, will leave the pins of that device in a "safe" state.
  • The JTAGSTATE statement is used to move the TAP controller into specific states, and the JTAGWAIT statement simply clocks the JTAG chains a specified number of times. If the TAP controller state has been modified manually, i.e. by accessing the JTAG pins directly and not via one of the raw JTAG statements JTAGSTATE, DRSCAN or IRSCAN, then the INJTAGSTATE statement can be used to notify the system of the new state.
  • A special form of the SET statement can be used to take direct control of TAP pins.
  • Target TCK frequencies can be set using the SETFREQ statement and read using the GETFREQ function.
  • Broken JTAG chain detection can be enabled and disabled using the SET_BROKEN_CHAIN_DETECTION function and read using the GET_BROKEN_CHAIN_DETECTION function.

Statements that cannot be used in a JTAG block

The following XJEase functions access the JTAG chains and so cannot be used within a JTAG block:

It is a compilation error to use any of these functions inside a JTAG block. If a function called from within the JTAG block uses one of these functions, it will cause a run-time error.

SWD functions are only allowed inside a JTAG block if no SWD pins are shared with JTAG TAP pins.

All other XJEase functions and statements can be used inside a JTAG block.

Entering and Leaving JTAG Blocks

No special action is taken on entry to a JTAG block. However, if this is the first JTAG access, the reset sequence will be executed and the IDs of the devices in the JTAG chains will be checked.

JTAG blocks can be nested. On exit from the final JTAG block, the reset sequence will be executed and the devices will be returned to their last known instructions.

These actions do not occur if the JTAG block is executed from within the reset sequence.