How to modify your XJEase project to work with XJRunner

Introduction

To run XJEase tests using XJRunner, a new section (TEST LIST) must be added to the XJEase project file, and the XJEase tests must be turned into an XJPack file. This application note describes how to convert an XJEase project file to use the full capabilities of XJRunner.

GUI vs. Command-line

The command-line version of XJRunner is called XJRun. It can run unmodified XJEase code in the same way as XJDebug, by running the CircuitTest function, but does not support any of the advanced features of the graphical version of XJRunner – customisable log files, user IDs, automatic serial numbering, etc.

The graphical version also gives you greater flexibility in running tests, by allowing you to have a basic set of tests to verify the board is working correctly and more complex debugging tests to help you track down any faults found on a board.

To allow for this flexibility, XJRunner uses a new section in the XJEase project preamble – the TEST LIST section – in place of the CircuitTest function.

The TEST LIST Section

The TEST LIST section must be put at the end of the project file preamble, after the JTAG CHAIN and optional CONNTEST sections. It contains a list of the test groups available to XJRunner.

Each part of the TEST LIST gives a test group name and a set of XJEase functions that make up that group. The test group names are displayed when running the tests in XJRunner.

Example:

TEST LIST
"Memory Tests"
IC1.Test;
IC12.Test;
END;

"LED Tests"
LEDtests;
END;
END;

In this very simple example, there are two test groups available to XJRunner – “LED Tests” and “Memory Tests”. Each of these runs a set of XJEase test functions to test various components. For the first group, memory devices IC1 and IC12 will be tested, each using an XJEase function called “Test” in their device file. The second group contains just one function, in the XJEase project file, which will test various LEDs on the board and return an overall pass/fail value.

What functions can I call from the TEST LIST?

The functions called from the TEST LIST must have no input parameters, and just one output parameter – the pass/fail value:

  • Pass = 0
  • Fail = 1 (or any non-zero value)

The functions can either be in a device file, or in the XJEase project file. To call a function in the XJEase project file, simply use the name of that function. To call a function in a device file, you must put the device reference before the function name, as seen above. If there is more than one board in your circuit, and a device reference is repeated between boards, you must also add the relevant board name before the device reference.

You can also call the CONNTEST function directly from the TEST LIST.

If you need to call a function that needs more parameters, or to call functions in a more complex way, you can ‘wrap’ them in a higher-level function – e.g.:

TestLEDs()(INT error)
INT key;
INT currentLED := 0;
INT timeout;

error := FALSE;

DO
// Turn off LEDs.
CALL("D1", "SetLED")(0)();
CALL("D2", "SetLED")(0)();

PRINT("\nTesting the LEDs: D1, D2.");
PRINT("\nPress the space bar to light up each LED.\n");

DO key := WAITKEY(); WHILE(key != ' ') END;
PRINT("*");
CALL("D1", "SetLED")(1)();

DO key := WAITKEY(); WHILE(key != ' ') END;
PRINT("*");
CALL("D1", "SetLED")(0)();
CALL("D2", "SetLED")(1)();

PRINT("\n\nDid the LEDs light up correctly?\n");
PRINT("Y = Yes\nN = No\nR = Repeat test.\n");
DO
key := WAITKEY();
CALL("D2", "SetLED")(0)();
WHILE((key != 'Y') && (key != 'y') && (key != 'N') && (key != 'n')
&& (key != 'R') && (key != 'r'))
END;

IF ((key = 'N') || (key = 'n')) THEN
error := TRUE;
END;
WHILE ((key = 'R') || (key = 'r'))
END;
END;

XJPack

The final step before you can use XJRunner (or XJRun) is to turn your XJEase tests into an XJPack file. This will compress and encrypt the tests, giving you the reassurance that the tests cannot then be changed. XJPack is run from the XJTAG Command Prompt, and is fully described in the XJTAG Help Files, under ‘XJRunner / XJPack’ -> ‘XJPack’.

Further help about using XJRunner is also available in the Help Files.

Want to be the first to know of new eBooks and JTAG Resources?

Find out how XJTAG can help you test your PCB faster
From Prototype To Manufacture