J-Link Script Files - Segger J-Link User Manual

Hide thumbs Also See for J-Link:
Table of Contents

Advertisement

206

5.11 J-Link script files

In some situations it it necessary to customize some actions performed by J-Link. In
most cases it is the connection sequence and/or the way in which a reset is per-
formed by J-Link, since some custom hardware needs some special handling which
cannot be integrated into the generic part of the J-Link software. J-Link script files
are written in C-like syntax in order to have an easy start to learning how to write J-
Link script files. The script file syntax supports most statements (if-else, while, dec-
laration of variables, ...) which are allowed in C, but not all of them. Moreover, there
are some statements that are script file specific. The script file allows maximum flex-
ibility, so almost any target initialization which is necessary can be supported.
5.11.1 Actions that can be customized
The script file support allows customizing of different actions performed by J-Link.
Depending on whether the corresponding function is present in the script file or not,
a generically implemented action is replaced by an action defined in a script file. In
the following all J-Link actions which can be customized using a script file are listed
and explained.
5.11.1.1 ConfigTargetSettings()
Description
Called before InitTarget(). Maninly used to set some global DLL variables to custom-
ize the normal connect procedure. For ARM CoreSight devices this may be specifying
the base address of some CoreSight components (ETM, ...) that cannot be auto-
detected by J-Link due to erroneous ROM tables etc. May also be used to specify the
device name in case debugger does not pass it to the DLL.
Prototype
void ConfigTargetSettings(void);
Notes / Limitations
May not, under absolutely NO circumstances, call any API functions that perform
target communication.
Should only set some global DLL variables
5.11.1.2 InitTarget()
Description
Replaces the target-CPU-auto-find procedure of the J-Link DLL. Useful for target
CPUs that are not accessible by default and need some special steps to be executed
before the normal debug probe connect procedure can be executed successfully.
Example devices are MCUs from TI which have a so-called ICEPick JTAG unit on them
that needs to be configured via JTAG, before the actual CPU core is accessible via
JTAG.
Prototype
void InitTarget(void);
Notes / Limitations
If target interface JTAG is used: JTAG chain has to be specified manually before
leaving this function (meaning all devices and their TAP IDs have to be specified
by the user). Also appropriate JTAG TAP number to communicate with during the
debug session has to be manually specified in this function.
MUST NOT use any MEM_ API functions
Global DLL variable "CPU" MUST be set when implementing this function, so the
DLL knows which CPU module to use internally.
J-Link / J-Trace (UM08001)
CHAPTER 5
© 2004-2017 SEGGER Microcontroller GmbH & Co. KG
Working with J-Link and J-Trace

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the J-Link and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

J-trace

Table of Contents

Save PDF