J-Link / J-Trace User Guide (UM08001) - Microcontrollers
J-Link / J-Trace User Guide (UM08001) - Microcontrollers
J-Link / J-Trace User Guide (UM08001) - Microcontrollers
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
5.10 J-<strong>Link</strong> script files<br />
In some situations it it necessary to customize some actions performed by J-<strong>Link</strong>. In<br />
most cases it is the connection sequence and/or the way in which a reset is performed<br />
by J-<strong>Link</strong>, since some custom hardware needs some special handling which<br />
can not be integrated into the generic part of the J-<strong>Link</strong> software. J-<strong>Link</strong> script files<br />
are written in C-like syntax in order to have an easy start to learning how to write J-<br />
<strong>Link</strong> script files. The script file syntax does support most statements (if-else, while,<br />
declaration of variables, ...) which are allowed in C, but not all of them. Moverover,<br />
there are some statements that are script file specific. The script file allows maximum<br />
flexibility, so almost any target initialization which is necessary, can be supported.<br />
5.10.1 Actions that can be customized<br />
The script file support allows customizing of different actions performed by J-<strong>Link</strong>. If<br />
an generic-implemented action is replaced by an action defined in a scriptfile<br />
depends on if the corresponding function is present in the scriptfile. In the following<br />
all J-<strong>Link</strong> actions which can be customized using a script file, are listed and<br />
explained.<br />
5.10.1.1 ResetTarget()<br />
Decsription<br />
If present, it replaces the reset strategy performed by the DLL when issuing a reset.<br />
Prototype<br />
void ResetTarget(void);<br />
5.10.1.2 InitEMU()<br />
Decsription<br />
If present, it allows configuration of the emulator prior to starting target communication.<br />
Currently this function is only used to configure if the target which is connected<br />
to J-<strong>Link</strong> has an ETB or not. For more information how to configure the existence of<br />
an ETB, please refer to Global DLL variables on page 120.<br />
Prototype<br />
void InitEMU(void);<br />
5.10.1.3 InitTarget()<br />
Decsription<br />
If present, it can replace the auto-detection capability of J-<strong>Link</strong>. Some targets can<br />
not be auto-detected by J-<strong>Link</strong> since some special target initialization is necessary<br />
before communication with the core is possible. Moreover, J-<strong>Link</strong> uses a TAP reset to<br />
get the JTAG IDs of the devices in the JTAG chain. On some targets this disables<br />
access to the core.<br />
Prototype<br />
void InitTarget(void);<br />
5.10.2 Script file API functions<br />
In the following, the API functions which can be used in a script file to communicate<br />
with the DLL are explained.<br />
J-<strong>Link</strong> / J-<strong>Trace</strong> (<strong>UM08001</strong>) © 2004-2010 SEGGER Microcontroller GmbH & Co. KG<br />
117