Script File Writing Example; Executing J-Link Script Files - Segger J-Link User Manual

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

Advertisement

172
unsigned
5.10.5.4 Supported declarators
The following type qualifiers are supported by the J-Link script file language:
Array declarators
5.10.5.5 Supported selection statements
The following selection statements are supported by the J-Link script file language:
if-statements
if-else-statements
5.10.5.6 Supported iteration statements
The following iteration statements are supported by the J-Link script file language:
while
do-while
5.10.5.7 Jump statements
The following jump statements are supported by the J-Link script file language:
return
5.10.5.8 Sample script files
The J-Link software and documentation package comes with sample script files for
different devices. The sample script files can be found at $JLINK_INST_DIR$\Sam-
ples\JLink\Scripts.

5.10.6 Script file writing example

In the following, a short example how a J-Link script file could look like. In this
example we assume a JTAG chain with two devices on it (Cortex-A8 4 bits IRLen, cus-
tom device 5-bits IRLen).
void InitTarget(void) {
Report("J-Link script example.");
JTAG_Reset();
if (JTAG_TotalIRLen != 9) {
MessageBox("Can not find xxx device");
return 1;
}
JTAG_DRPre
JTAG_DRPost
JTAG_IRPre
JTAG_IRPost
JTAG_IRLen
CPU
JTAG_AllowTAPReset
//
// We have a non-CoreSight compliant Cortex-A8 here
// which does not allow auto-detection of the Core debug components base address.
// so set it manually to overwrite the DLL auto-detection
//
CORESIGHT_CoreBaseAddr = 0x80030000;
}

5.10.7 Executing J-Link script files

5.10.7.1 In J-Link commander
When J-Link commander is started it searches for a script file called
Default.JLinkScript in the folder wich contains the JLink.exe and the J-Link DLL
(by default the installation folder e.g. "C:\Program Files\SEGGER\JLinkARM_V456\").
J-Link / J-Trace (UM08001)
CHAPTER 5
// Perform TAP reset and J-Link JTAG auto-detection
// Basic check if JTAG chain information matches
= 0; // Cortex-A8 is closest to TDO, no no pre devices
= 1; // 1 device (custom device) comes after the Cortex-A8
= 0; // Cortex-A8 is closest to TDO, no no pre IR bits
= 5; // custom device after Cortex-A8 has 5 bits IR len
= 4; // We selected the Cortex-A8, it has 4 bits IRLen
= CORTEX_A8; // We are connected to a Cortex-A8
= 1;
// We are allowed to enter JTAG TAP reset
© 2004-2013 SEGGER Microcontroller GmbH & Co. KG
Working with J-Link and J-Trace

Hide quick links:

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?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

J-trace

Table of Contents

Save PDF