Scilab Arduino Blinking LED Tutorial
Scilab Arduino Blinking LED Tutorial
Short Contents
About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 OpenOCD Developer Resources . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Debug Adapter Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 About Jim-Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 OpenOCD Project Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6 Config File Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7 Daemon Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8 Debug Adapter Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 38
9 Reset Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10 TAP Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
11 CPU Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
12 Flash Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
13 NAND Flash Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
14 PLD/FPGA Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
15 General Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
16 Architecture and Core Commands . . . . . . . . . . . . . . . . . . . . . . . 96
17 JTAG Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
18 Boundary Scan Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
19 TFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
20 GDB and OpenOCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
21 Tcl Scripting API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
22 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
23 Tcl Crash Course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
A The GNU Free Documentation License. . . . . . . . . . . . . . . . . . 131
OpenOCD Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Command and Driver Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
ii
Table of Contents
About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What is OpenOCD? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
OpenOCD Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Latest User’s Guide: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
OpenOCD User’s Forum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
OpenOCD User’s Mailing List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
OpenOCD IRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 About Jim-Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1 Simple setup, no customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 What OpenOCD does as it starts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7 Daemon Configuration . . . . . . . . . . . . . . . . . . . . . . . . 34
7.1 Configuration Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.2 Entering the Run Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.3 TCP/IP Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.4 GDB Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.5 Event Polling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
9 Reset Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.1 Types of Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.2 SRST and TRST Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.3 Commands for Handling Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
9.4 Custom Reset Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
iv
10 TAP Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.1 Scan Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.2 TAP Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
10.3 TAP Declaration Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
10.4 Other TAP commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.5 TAP Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.6 Enabling and Disabling TAPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.7 Autoprobing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
11 CPU Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 59
11.1 Target List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
11.2 Target CPU Types and Variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
11.3 Target Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
11.4 Other $target name Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.5 Target Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
12 Flash Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
12.1 Flash Configuration Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
12.2 Erasing, Reading, Writing to Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
12.3 Other Flash commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
12.4 Flash Driver List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
12.4.1 External Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
12.4.2 Internal Flash (Microcontrollers) . . . . . . . . . . . . . . . . . . . . . . . . 72
12.4.3 str9xpec driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
12.5 mFlash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
12.5.1 mFlash Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
12.5.2 mFlash commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
14 PLD/FPGA Commands . . . . . . . . . . . . . . . . . . . . . 89
14.1 PLD/FPGA Configuration and Commands . . . . . . . . . . . . . . . . . . . 89
14.2 PLD/FPGA Drivers, Options, and Commands . . . . . . . . . . . . . . . 89
15 General Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 90
15.1 Daemon Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
15.2 Target State handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
15.3 I/O Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
15.4 Memory access commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
15.5 Image loading commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
15.6 Breakpoint and Watchpoint commands . . . . . . . . . . . . . . . . . . . . . . . 95
15.7 Misc Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
v
19 TFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
22 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
vi
About
OpenOCD was created by Dominic Rath as part of a diploma thesis written at the University
of Applied Sciences Augsburg (http://www.fh-augsburg.de). Since that time, the project
has grown into an active open-source project, supported by a diverse community of software
and hardware developers from around the world.
What is OpenOCD?
The Open On-Chip Debugger (OpenOCD) aims to provide debugging, in-system program-
ming and boundary-scan testing for embedded target devices.
It does so with the assistance of a debug adapter, which is a small hardware module which
helps provide the right kind of electrical signaling to the target being debugged. These are
required since the debug host (on which OpenOCD runs) won’t usually have native support
for such signaling, or the connector needed to hook up to the target.
Such debug adapters support one or more transport protocols, each of which involves dif-
ferent electrical signaling (and uses different messaging protocols on top of that signaling).
There are many types of debug adapter, and little uniformity in what they are called.
(There are also product naming differences.)
These adapters are sometimes packaged as discrete dongles, which may generically be called
hardware interface dongles. Some development boards also integrate them directly, which
may let the development board can be directly connected to the debug host over USB (and
sometimes also to power it over USB).
For example, a JTAG Adapter supports JTAG signaling, and is used to communicate with
JTAG (IEEE 1149.1) compliant TAPs on your target board. A TAP is a “Test Access Port”,
a module which processes special instructions and data. TAPs are daisy-chained within and
between chips and boards. JTAG supports debugging and boundary scan operations.
There are also SWD Adapters that support Serial Wire Debug (SWD) signaling to commu-
nicate with some newer ARM cores, as well as debug adapters which support both JTAG
and SWD transports. SWD only supports debugging, whereas JTAG also supports bound-
ary scan operations.
For some chips, there are also Programming Adapters supporting special transports used
only to write code to flash memory, without support for on-chip debugging or boundary
scan. (At this writing, OpenOCD does not support such non-debug adapters.)
Dongles: OpenOCD currently supports many types of hardware dongles: USB based, par-
allel port based, and other standalone boxes that run OpenOCD internally. See Chapter 2
[Debug Adapter Hardware], page 5.
GDB Debug: It allows ARM7 (ARM7TDMI and ARM720t), ARM9 (ARM920T,
ARM922T, ARM926EJ–S, ARM966E–S), XScale (PXA25x, IXP42x) and Cortex-M3
(Stellaris LM3 and ST STM32) based cores to be debugged via the GDB protocol.
Flash Programing: Flash writing is supported for external CFI compatible NOR flashes
(Intel and AMD/Spansion command set) and several internal flashes (LPC1700, LPC2000,
AT91SAM7, AT91SAM3U, STR7x, STR9x, LM3, and STM32x). Preliminary support for
various NAND flash controllers (LPC3180, Orion, S3C24xx, more) controller is included.
About 2
OpenOCD IRC
Support can also be found on irc: irc://irc.freenode.net/openocd
Chapter 1: OpenOCD Developer Resources 3
• usbjtag
Link http: / /elk .informatik .fh-augsburg .de /hhweb /doc /openocd /usbjtag /
usbjtag.html
• jtagkey
See: http://www.amontec.com/jtagkey.shtml
• jtagkey2
See: http://www.amontec.com/jtagkey2.shtml
• oocdlink
See: http://www.oocdlink.com By Joern Kaipf
• signalyzer
See: http://www.signalyzer.com
• Stellaris Eval Boards
See: http://www.luminarymicro.com - The Stellaris eval boards bundle FT2232-
based JTAG and SWD support, which can be used to debug the Stellaris chips. Using
separate JTAG adapters is optional. These boards can also be used in a "pass through"
mode as JTAG adapters to other target boards, disabling the Stellaris chip.
• Luminary ICDI
See: http://www.luminarymicro.com - Luminary In-Circuit Debug Interface (ICDI)
Boards are included in Stellaris LM3S9B9x Evaluation Kits. Like the non-detachable
FT2232 support on the other Stellaris eval boards, they can be used to debug other
target boards.
• olimex-jtag
See: http://www.olimex.com
• Flyswatter/Flyswatter2
See: http://www.tincantools.com
• turtelizer2
See: Turtelizer 2, or http://www.ethernut.de
• comstick
Link: http://www.hitex.com/index.php?id=383
• stm32stick
Link http://www.hitex.com/stm32-stick
• axm0432 jtag
Axiom AXM-0432 Link http://www.axman.com - NOTE: This JTAG does not appear
to be available anymore as of April 2012.
• cortino
Link http://www.hitex.com/index.php?id=cortino
• dlp-usb1232h
Link http://www.dlpdesign.com/usb/usb1232h.shtml
• digilent-hs1
Link http://www.digilentinc.com/Products/Detail.cfm?Prod=JTAG-HS1
For info the original ST-LINK enumerates using the mass storage usb class, however it’s
implementation is completely broken. The result is this causes issues under linux. The
simplest solution is to get linux to ignore the ST-LINK using one of the following methods:
• modprobe -r usb-storage && modprobe usb-storage quirks=483:3744:i
• add "options usb-storage quirks=483:3744:i" to /etc/modprobe.conf
2.10 Other...
• ep93xx
An EP93xx based Linux machine using the GPIO pins directly.
• at91rm9200
Like the EP93xx - but an ATMEL AT91RM9200 based solution using the GPIO pins
on the chip.
Chapter 3: About Jim-Tcl 10
3 About Jim-Tcl
OpenOCD uses a small “Tcl Interpreter” known as Jim-Tcl. This programming language
provides a simple and extensible command interpreter.
All commands presented in this Guide are extensions to Jim-Tcl. You can use them as
simple commands, without needing to learn much of anything about Tcl. Alternatively,
can write Tcl programs with them.
You can learn more about Jim at its website, http: / /jim .berlios .de. There is an
active and responsive community, get on the mailing list if you have any questions. Jim-Tcl
maintainers also lurk on the OpenOCD mailing list.
• Jim vs. Tcl
Jim-Tcl is a stripped down version of the well known Tcl language, which can be found
here: http://www.tcl.tk. Jim-Tcl has far fewer features. Jim-Tcl is several dozens
of .C files and .H files and implements the basic Tcl command set. In contrast: Tcl 8.6
is a 4.2 MB .zip file containing 1540 files.
• Missing Features
Our practice has been: Add/clone the real Tcl feature if/when needed. We welcome
Jim-Tcl improvements, not bloat. Also there are a large number of optional Jim-Tcl
features that are not enabled in OpenOCD.
• Scripts
OpenOCD configuration scripts are Jim-Tcl Scripts. OpenOCD’s command interpreter
today is a mixture of (newer) Jim-Tcl commands, and (older) the orginal command
interpreter.
• Commands
At the OpenOCD telnet command line (or via the GDB monitor command) one can
type a Tcl for() loop, set variables, etc. Some of the commands documented in this
guide are implemented as Tcl scripts, from a startup.tcl file internal to the server.
• Historical Note
Jim-Tcl was introduced to OpenOCD in spring 2008. Fall 2010, before OpenOCD
0.5 release OpenOCD switched to using Jim Tcl as a git submodule, which greatly
simplified upgrading Jim Tcl to benefit from new features and bugfixes in Jim Tcl.
• Need a crash course in Tcl?
See Chapter 23 [Tcl Crash Course], page 125.
Chapter 4: Running 11
4 Running
Properly installing OpenOCD sets up your operating system to grant it access to the de-
bug adapters. On Linux, this usually involves installing a file in /etc/udev/rules.d, so
OpenOCD has permissions. MS-Windows needs complex and confusing driver configuration
for every peripheral. Such issues are unique to each operating system, and are not detailed
in this User’s Guide.
Then later you will invoke the OpenOCD server, with various options to tell it how each
debug session should work. The --help option shows:
bash$ openocd --help
Talk with the OpenOCD server using telnet (telnet localhost 4444 on many systems) or
GDB. See Chapter 20 [GDB and OpenOCD], page 114.
• For example, a gdb-attach event handler that invokes the reset init command will
interfere with debugging early boot code, which performs some of the same actions
that the reset-init event handler does.
• Likewise, the arm9 vector_catch command (or its siblings xscale vector_catch and
cortex_m3 vector_catch) can be a timesaver during some debug sessions, but don’t
make everyone use that either. Keep those kinds of debugging aids in your user config
file, along with messaging and tracing setup. (See [Software Debug Messages and
Tracing], page 107.)
• You might need to override some defaults. For example, you might need to move,
shrink, or back up the target’s work area if your application needs much SRAM.
• TCP/IP port configuration is another example of something which is environment-
specific, and should only appear in a user config file. See [TCP/IP Ports], page 35.
# Start running.
resume 0x20000000
}
Then once that code is working you will need to make it boot from NOR flash; a different
utility would help. Alternatively, some developers write to flash using GDB. (You might
use a similar script if you’re working with a flash based microcontroller application instead
of a boot loader.)
proc newboot { } {
# Reset, leaving the CPU halted. The "reset-init" event
# proc gives faster access to the CPU and to NOR flash;
# "reset halt" would be slower.
reset init
1
Note that many systems support a "monitor mode" debug that is a somewhat cleaner way to address such
issues. You can think of it as only halting part of the system, maybe just one task, instead of the whole
thing. At this writing, January 2010, OpenOCD based debugging does not support monitor mode debug,
only "halt mode" debug.
2
See chapter 8 "Semihosting" in ARM DUI 0203I, the "RealView Compilation Tools Developer Guide". The
CodeSourcery EABI toolchain also includes a semihosting library.
Chapter 5: OpenOCD Project Setup 18
• ARM Wait-For-Interrupt... Many ARM chips synchronize the JTAG clock using the
core clock. Low power states which stop that core clock thus prevent JTAG access. Idle
loops in tasking environments often enter those low power states via the WFI instruction
(or its coprocessor equivalent, before ARMv7).
You may want to disable that instruction in source code, or otherwise prevent using that
state, to ensure you can get JTAG access at any time.3 For example, the OpenOCD
halt command may not work for an idle processor otherwise.
• Delay after reset... Not all chips have good support for debugger access right after
reset; many LPC2xxx chips have issues here. Similarly, applications that reconfigure
pins used for JTAG access as they start will also block debugger access.
To work with boards like this, enable a short delay loop the first thing after reset, before
"real" startup activities. For example, one second’s delay is usually more than enough
time for a JTAG debugger to attach, so that early code execution can be debugged or
firmware can be replaced.
• Debug Communications Channel (DCC)... Some processors include mechanisms to
send messages over JTAG. Many ARM cores support these, as do some cores from
other vendors. (OpenOCD may be able to use this DCC internally, speeding up some
operations like writing to memory.)
Your application may want to deliver various debugging messages over JTAG, by linking
with a small library of code provided with OpenOCD and using the utilities there to
send various kinds of message. See [Software Debug Messages and Tracing], page 107.
• Memory Addressing ... Boards which support multiple boot modes may also have
jumpers to configure memory addressing. One board, for example, jumpers external
chipselect 0 (used for booting) to address either a large SRAM (which must be pre-
loaded via JTAG), NOR flash, or NAND flash. When it’s jumpered to address NAND
flash, that board must also be told to start booting from on-chip ROM.
Your board.cfg file may also need to be told this jumper configuration, so that it can
know whether to declare NOR flash using flash bank or instead declare NAND flash
with nand device; and likewise which probe to perform in its reset-init handler.
A closely related issue is bus width. Jumpers might need to distinguish between 8 bit
or 16 bit bus access for the flash used to start booting.
• Peripheral Access ... Development boards generally provide access to every periph-
eral on the chip, sometimes in multiple modes (such as by providing multiple audio
codec chips). This interacts with software configuration of pin multiplexing, where for
example a given pin may be routed either to the MMC/SD controller or the GPIO
controller. It also often interacts with configuration jumpers. One jumper may be used
to route signals to an MMC/SD card slot or an expansion bus (which might in turn
affect booting); others might control which audio or video codecs are used.
Plus you should of course have reset-init event handlers which set up the hardware to
match that jumper configuration. That includes in particular any oscillator or PLL used
to clock the CPU, and any memory controllers needed to access external memory and
peripherals. Without such handlers, you won’t be able to access those resources without
working target firmware which can do that setup ... this can be awkward when you’re
trying to debug that target firmware. Even if there’s a ROM bootloader which handles a
few issues, it rarely provides full access to all board-specific capabilities.
Chapter 6: Config File Guidelines 20
at91cap7a-stk-sdram.cfg microchip_explorer16.cfg
at91eb40a.cfg mini2440.cfg
at91rm9200-dk.cfg mini6410.cfg
at91rm9200-ek.cfg olimex_LPC2378STK.cfg
at91sam9261-ek.cfg olimex_lpc_h2148.cfg
at91sam9263-ek.cfg olimex_sam7_ex256.cfg
at91sam9g20-ek.cfg olimex_sam9_l9260.cfg
atmel_at91sam7s-ek.cfg olimex_stm32_h103.cfg
atmel_at91sam9260-ek.cfg olimex_stm32_h107.cfg
atmel_at91sam9rl-ek.cfg olimex_stm32_p107.cfg
atmel_sam3n_ek.cfg omap2420_h4.cfg
atmel_sam3s_ek.cfg open-bldc.cfg
atmel_sam3u_ek.cfg openrd.cfg
atmel_sam3x_ek.cfg osk5912.cfg
atmel_sam4s_ek.cfg phytec_lpc3250.cfg
balloon3-cpu.cfg pic-p32mx.cfg
colibri.cfg propox_mmnet1001.cfg
crossbow_tech_imote2.cfg pxa255_sst.cfg
csb337.cfg redbee.cfg
csb732.cfg rsc-w910.cfg
da850evm.cfg sheevaplug.cfg
digi_connectcore_wi-9c.cfg smdk6410.cfg
diolan_lpc4350-db1.cfg spear300evb.cfg
dm355evm.cfg spear300evb_mod.cfg
dm365evm.cfg spear310evb20.cfg
dm6446evm.cfg spear310evb20_mod.cfg
efikamx.cfg spear320cpu.cfg
eir.cfg spear320cpu_mod.cfg
ek-lm3s1968.cfg steval_pcc010.cfg
ek-lm3s3748.cfg stm320518_eval_stlink.cfg
ek-lm3s6965.cfg stm32100b_eval.cfg
ek-lm3s811.cfg stm3210b_eval.cfg
ek-lm3s811-revb.cfg stm3210c_eval.cfg
ek-lm3s9b9x.cfg stm3210e_eval.cfg
ek-lm4f232.cfg stm3220g_eval.cfg
embedded-artists_lpc2478-32.cfg stm3220g_eval_stlink.cfg
ethernut3.cfg stm3241g_eval.cfg
glyn_tonga2.cfg stm3241g_eval_stlink.cfg
hammer.cfg stm32f0discovery.cfg
hilscher_nxdb500sys.cfg stm32f4discovery.cfg
hilscher_nxeb500hmi.cfg stm32ldiscovery.cfg
hilscher_nxhx10.cfg stm32vldiscovery.cfg
hilscher_nxhx500.cfg str910-eval.cfg
hilscher_nxhx50.cfg telo.cfg
hilscher_nxsb100.cfg ti_beagleboard.cfg
hitex_lpc2929.cfg ti_beagleboard_xm.cfg
hitex_stm32-performancestick.cfg ti_beaglebone.cfg
Chapter 6: Config File Guidelines 22
hitex_str9-comstick.cfg ti_blaze.cfg
iar_lpc1768.cfg ti_pandaboard.cfg
iar_str912_sk.cfg ti_pandaboard_es.cfg
icnova_imx53_sodimm.cfg topas910.cfg
icnova_sam9g45_sodimm.cfg topasa900.cfg
imx27ads.cfg twr-k60n512.cfg
imx27lnst.cfg tx25_stk5.cfg
imx28evk.cfg tx27_stk5.cfg
imx31pdk.cfg unknown_at91sam9260.cfg
imx35pdk.cfg uptech_2410.cfg
imx53loco.cfg verdex.cfg
keil_mcb1700.cfg voipac.cfg
keil_mcb2140.cfg voltcraft_dso-3062c.cfg
kwikstik.cfg x300t.cfg
linksys_nslu2.cfg zy1000.cfg
lisa-l.cfg
$
• target ... think chip. The “target” directory represents the JTAG TAPs on a chip
which OpenOCD should control, not a board. Two common types of targets are ARM
chips and FPGA or CPLD chips. When a chip has multiple TAPs (maybe it has both
ARM and DSP cores), the target config file defines all of them.
$ ls target
$duc702x.cfg ixp42x.cfg
am335x.cfg k40.cfg
amdm37x.cfg k60.cfg
ar71xx.cfg lpc1768.cfg
at32ap7000.cfg lpc2103.cfg
at91r40008.cfg lpc2124.cfg
at91rm9200.cfg lpc2129.cfg
at91sam3ax_4x.cfg lpc2148.cfg
at91sam3ax_8x.cfg lpc2294.cfg
at91sam3ax_xx.cfg lpc2378.cfg
at91sam3nXX.cfg lpc2460.cfg
at91sam3sXX.cfg lpc2478.cfg
at91sam3u1c.cfg lpc2900.cfg
at91sam3u1e.cfg lpc2xxx.cfg
at91sam3u2c.cfg lpc3131.cfg
at91sam3u2e.cfg lpc3250.cfg
at91sam3u4c.cfg lpc4350.cfg
at91sam3u4e.cfg mc13224v.cfg
at91sam3uxx.cfg nuc910.cfg
at91sam3XXX.cfg omap2420.cfg
at91sam4sXX.cfg omap3530.cfg
at91sam4XXX.cfg omap4430.cfg
at91sam7se512.cfg omap4460.cfg
at91sam7sx.cfg omap5912.cfg
Chapter 6: Config File Guidelines 23
at91sam7x256.cfg omapl138.cfg
at91sam7x512.cfg pic32mx.cfg
at91sam9260.cfg pxa255.cfg
at91sam9260_ext_RAM_ext_flash.cfg pxa270.cfg
at91sam9261.cfg pxa3xx.cfg
at91sam9263.cfg readme.txt
at91sam9.cfg samsung_s3c2410.cfg
at91sam9g10.cfg samsung_s3c2440.cfg
at91sam9g20.cfg samsung_s3c2450.cfg
at91sam9g45.cfg samsung_s3c4510.cfg
at91sam9rl.cfg samsung_s3c6410.cfg
atmega128.cfg sharp_lh79532.cfg
avr32.cfg smp8634.cfg
c100.cfg spear3xx.cfg
c100config.tcl stellaris.cfg
c100helper.tcl stm32.cfg
c100regs.tcl stm32f0x_stlink.cfg
cs351x.cfg stm32f1x.cfg
davinci.cfg stm32f1x_stlink.cfg
dragonite.cfg stm32f2x.cfg
dsp56321.cfg stm32f2x_stlink.cfg
dsp568013.cfg stm32f2xxx.cfg
dsp568037.cfg stm32f4x.cfg
epc9301.cfg stm32f4x_stlink.cfg
faux.cfg stm32l.cfg
feroceon.cfg stm32lx_stlink.cfg
fm3.cfg stm32_stlink.cfg
hilscher_netx10.cfg stm32xl.cfg
hilscher_netx500.cfg str710.cfg
hilscher_netx50.cfg str730.cfg
icepick.cfg str750.cfg
imx21.cfg str912.cfg
imx25.cfg swj-dp.tcl
imx27.cfg test_reset_syntax_error.cfg
imx28.cfg test_syntax_error.cfg
imx31.cfg ti_dm355.cfg
imx35.cfg ti_dm365.cfg
imx51.cfg ti_dm6446.cfg
imx53.cfg tmpa900.cfg
imx.cfg tmpa910.cfg
is5114.cfg u8500.cfg
• more ... browse for other library files which may be useful. For example, there are
various generic and CPU-specific utilities.
The openocd.cfg user config file may override features in any of the above files by setting
variables before sourcing the target file, or by adding commands specific to their situation.
Chapter 6: Config File Guidelines 24
1
A FAQ http://www.arm.com/support/faqdev/4170.html gives details.
Chapter 6: Config File Guidelines 27
proc enable_fast_clock {} {
# enables fast on-board clock source
# configures the chip to use it
}
As a rule of thumb, a target file sets up only one chip. For a microcontroller, that will often
include a single TAP, which is a CPU needing a GDB target, and its on-chip flash.
More complex chips may include multiple TAPs, and the target config file may need to
define them all before OpenOCD can talk to the chip. For example, some phone chips have
JTAG scan chains that include an ARM core for operating system use, a DSP, another
ARM core embedded in an image processing engine, and other processing engines.
Provide a reset-assert event handler if you can. Such a handler uses JTAG operations
to reset the target, letting this target config be used in systems which don’t provide the
optional SRST signal, or on systems where you don’t want to reset all targets at once. Such
a handler might write to chip registers to force a reset, use a JRC to do that (preferable –
the target may be wedged!), or force a watchdog timer to trigger. (For Cortex-M3 targets,
this is not necessary. The target driver knows how to use trigger an NVIC reset when SRST
is not available.)
Some chips need special attention during reset handling if they’re going to be used with
JTAG. An example might be needing to send some commands right after the target’s TAP
has been reset, providing a reset-deassert-post event handler that writes a chip register
to report that JTAG debugging is being done. Another would be reconfiguring the watchdog
so that it stops counting while the core is halted in the debugger.
JTAG clocking constraints often change during reset, and in some cases target config files
(rather than board config files) are the right places to handle some of those issues. For
example, immediately after reset most chips run using a slower clock than they will use
later. That means that after reset (and potentially, as OpenOCD first starts up) they must
use a slower JTAG clock rate than they will use later. See [JTAG Speed], page 46.
Important: When you are debugging code that runs right after chip reset,
getting these issues right is critical. In particular, if you see intermittent failures
when OpenOCD verifies the scan chain after reset, look at how you are setting
up JTAG clocking.
proc init_targets {} {
# initializes generic chip with 4kB of flash and 1kB of RAM
setup_my_chip MY_GENERIC_CHIP 4096 1024
}
proc init_targets {} {
# initializes specific chip with 128kB of flash and 64kB of RAM
setup_my_chip MY_CHIP_WITH_128K_FLASH_64KB_RAM 131072 65536
}
The easiest way to convert “linear” config files to init_targets version is to enclose every
line of “code” (i.e. not source commands, procedures, etc.) in this procedure.
For an example of this scheme see LPC2000 target config files.
The init_boards procedure is a similar concept concerning board config files (See [The
init board procedure], page 26.)
# Lauterbach syntax(?)
#
# Data.Set c15:0x042f %long 0x40000015
#
# OpenOCD syntax when using procedure below.
#
# setc15 0x01 0x00050078
7 Daemon Configuration
The commands here are commonly found in the openocd.cfg file and are used to specify
what TCP/IP ports are used, and how GDB should be supported.
The default implementation first tries jtag arp_init, which uses only a lightweight
JTAG reset before examining the scan chain. If that fails, it tries again, using a
harder reset from the overridable procedure init_reset.
Implementations must have verified the JTAG scan chain before they return. This is
done by calling jtag arp_init (or jtag arp_init-reset).
Correctly installing OpenOCD includes making your operating system give OpenOCD ac-
cess to debug adapters. Once that has been done, Tcl commands are used to select which
one is used, and to configure how it is used.
Note: Because OpenOCD started out with a focus purely on JTAG, you may
find places where it wrongly presumes JTAG is the only transport protocol in
use. Be aware that recent versions of OpenOCD are removing that limitation.
JTAG remains more functional than most other transports. Other transports
do not support boundary scan operations, or may be specific to a given chip
vendor. Some might be usable only for programming flash memory, instead of
also for debugging.
Debug Adapters/Interfaces/Dongles are normally configured through commands in an in-
terface configuration file which is sourced by your openocd.cfg file, or through a command
line -f interface/....cfg option.
source [find interface/olimex-jtag-tiny.cfg]
These commands tell OpenOCD what type of JTAG adapter you have, and how to talk to
it. A few cases are so simple that you only need to say what driver to use:
# jlink interface
interface jlink
Most adapters need a bit more configuration than that.
interface_list [Command]
List the debug adapter drivers that have been built into the running copy of
OpenOCD.
adapter_name [Command]
Returns the name of the debug adapter driver being used.
Chapter 8: Debug Adapter Configuration 39
For example, the interface config file for a Turtelizer JTAG Adapter looks something
like this:
Chapter 8: Debug Adapter Configuration 41
interface ft2232
ft2232_device_desc "Turtelizer JTAG/RS232 Adapter"
ft2232_layout turtelizer2
ft2232_vid_pid 0x0403 0xbdc8
remote_bitbang [Interface Driver]
Drive JTAG from a remote process. This sets up a UNIX or TCP socket connection
with a remote process and sends ASCII encoded bitbang requests to that process
instead of directly driving JTAG.
The remote bitbang driver is useful for debugging software running on processors
which are being simulated.
remote_bitbang_port number [Config Command]
Specifies the TCP port of the remote process to connect to or 0 to use UNIX
sockets instead of TCP.
remote_bitbang_host hostname [Config Command]
Specifies the hostname of the remote process to connect to using TCP, or the
name of the UNIX socket to use if remote bitbang port is 0.
For example, to connect remotely via TCP to the host foobar you might have some-
thing like:
interface remote_bitbang
remote_bitbang_port 3335
remote_bitbang_host foobar
To connect to another process running locally via UNIX sockets with socket named
mysocket:
interface remote_bitbang
remote_bitbang_port 0
remote_bitbang_host mysocket
usb_blaster [Interface Driver]
USB JTAG/USB-Blaster compatibles over one of the userspace libraries for FTDI
chips. These interfaces have several commands, used to configure the driver before
initializing the JTAG scan chain:
usb_blaster_device_desc description [Config Command]
Provides the USB device description (the iProduct string) of the FTDI FT245
device. If not specified, the FTDI default value is used. This setting is only
valid if compiled with FTD2XX support.
usb_blaster_vid_pid vid pid [Config Command]
The vendor ID and product ID of the FTDI FT245 device. If not specified,
default values are used. Currently, only one vid, pid pair may be given, e.g. for
Altera USB-Blaster (default):
usb_blaster_vid_pid 0x09FB 0x6001
The following VID/PID is for Kolja Waschk’s USB JTAG:
usb_blaster_vid_pid 0x16C0 0x06AD
Chapter 8: Debug Adapter Configuration 42
For example, the interface configuration file for a classic “Wiggler” cable on LPT2
might look something like this:
interface parport
parport_port 0x278
parport_cable wiggler
Note: This defines some driver-specific commands, which are not currently
documented here.
faster speed by a reset-init target event handler after it reprograms those CPU clocks,
or manually (if something else, such as a boot loader, sets up those clocks). See [Target
Events], page 64. When the initial low JTAG speed is a chip characteristic, perhaps because
of a required oscillator speed, provide such a handler in the target config file. When that
speed is a function of a board-specific characteristic such as which speed oscillator is used,
it belongs in the board config file instead. In both cases it’s safest to also set the initial
JTAG clock rate to that same slow speed, so that OpenOCD never starts up using a clock
speed that’s faster than the scan chain can support.
jtag_rclk 3000
$_TARGET.cpu configure -event reset-start { jtag_rclk 3000 }
If your system supports adaptive clocking (RTCK), configuring JTAG to use that is probably
the most robust approach. However, it introduces delays to synchronize clocks; so it may
not be the fastest solution.
NOTE: Script writers should consider using jtag_rclk instead of adapter_khz, but only
for (ARM) cores and boards which support adaptive clocking.
9 Reset Configuration
Every system configuration may require a different reset configuration. This can also be
quite confusing. Resets also interact with reset-init event handlers, which do things like
setting up clocks and DRAM, and JTAG clock rates. (See [JTAG Speed], page 46.) They
can also interact with JTAG routers. Please see the various board files for examples.
Note: To maintainers and integrators: Reset configuration touches several
things at once. Normally the board configuration file should define it and as-
sume that the JTAG adapter supports everything that’s wired up to the board’s
JTAG connector.
However, the target configuration file could also make note of something the sil-
icon vendor has done inside the chip, which will be true for most (or all) boards
using that chip. And when the JTAG adapter doesn’t support everything,
the user configuration file will need to override parts of the reset configuration
provided by other files.
When SRST is not available, your code might not be able to rely on controllers having
been fully reset during code startup. Missing TRST is not a problem, since JTAG-level
resets can be triggered using with TMS signaling.
• Signals shorted ... Sometimes a chip, board, or adapter will connect SRST to TRST,
instead of keeping them separate. Use the reset_config combination options to say
when those signals aren’t properly independent.
• Timing ... Reset circuitry like a resistor/capacitor delay circuit, reset supervisor, or
on-chip features can extend the effect of a JTAG adapter’s reset for some time after
the adapter stops issuing the reset. For example, there may be chip or board re-
quirements that all reset pulses last for at least a certain amount of time; and reset
buttons commonly have hardware debouncing. Use the adapter_nsrst_delay and
jtag_ntrst_delay commands to say when extra delays are needed.
• Drive type ... Reset lines often have a pullup resistor, letting the JTAG interface
treat them as open-drain signals. But that’s not a requirement, so the adapter may
need to use push/pull output drivers. Also, with weak pullups it may be advisable to
drive signals to both levels (push/pull) to minimize rise times. Use the reset_config
trst type and srst type parameters to say how to drive reset signals.
• Special initialization ... Targets sometimes need special JTAG initialization sequences
to handle chip-specific issues (not limited to errata). For example, certain JTAG com-
mands might need to be issued while the system as a whole is in a reset state (SRST
active) but the JTAG scan chain is usable (TRST inactive). Many systems treat com-
bined assertion of SRST and TRST as a trigger for a harder reset than SRST alone.
Such custom reset handling is discussed later in this chapter.
There can also be other issues. Some devices don’t fully conform to the JTAG specifications.
Trivial system-specific differences are common, such as SRST and TRST using slightly
different names. There are also vendors who distribute key JTAG documentation for their
chips only to developers who have signed a Non-Disclosure Agreement (NDA).
Sometimes there are chip-specific extensions like a requirement to use the normally-optional
TRST signal (precluding use of JTAG adapters which don’t pass TRST through), or needing
extra steps to complete a TAP reset.
In short, SRST and especially TRST handling may be very finicky, needing to cope with
both architecture and board specific constraints.
• Possible trst type driver modes for the test reset signal (TRST) are the default
trst_push_pull, and trst_open_drain. Most boards connect this signal to a
pulldown, so the JTAG TAPs never leave reset unless they are hooked up to a
JTAG adapter.
• Possible srst type driver modes for the system reset signal (SRST) are the default
srst_open_drain, and srst_push_pull. Most boards connect this signal to a
pullup, and allow the signal to be pulled low by various events including system
powerup and pressing a reset button.
10 TAP Declaration
Test Access Ports (TAPs) are the core of JTAG. TAPs serve many roles, including:
• Debug Target A CPU TAP can be used as a GDB debug target
• Flash Programing Some chips program the flash directly via JTAG. Others do it indi-
rectly, making a CPU do it.
• Program Download Using the same CPU support GDB uses, you can initialize a DRAM
controller, download code to DRAM, and then start running that code.
• Boundary Scan Most chips support boundary scan, which helps test for board assembly
problems like solder bridges and missing connections
OpenOCD must know about the active TAPs on your board(s). Setting up the TAPs is
the core task of your configuration files. Once those TAPs are set up, you can pass their
names to code which sets up CPUs and exports them as GDB targets, probes flash memory,
performs low-level JTAG operations, and more.
For example, the ST Microsystems STR912 chip has three separate TAPs1 . To configure
those taps, target/str912.cfg includes commands something like this:
jtag newtap str912 flash ... params ...
jtag newtap str912 cpu ... params ...
jtag newtap str912 bs ... params ...
Actual config files use a variable instead of literals like str912, to support more than one
chip of each type. See Chapter 6 [Config File Guidelines], page 20.
jtag names [Command]
Returns the names of all current TAPs in the scan chain. Use jtag cget or jtag
tapisenabled to examine attributes and state of each TAP.
foreach t [jtag names] {
puts [format "TAP: %s\n" $t]
}
scan_chain [Command]
Displays the TAPs in the scan chain configuration, and their status. The set of TAPs
listed by this command is fixed by exiting the OpenOCD configuration stage, but
systems with a JTAG router can enable or disable TAPs dynamically.
• -irmask NUMBER
A mask used with -ircapture to verify that instruction scans work correctly.
Such scans are not used by OpenOCD except to verify that there seems to be no
problems with JTAG scan chain operations.
If you need some action after each JTAG reset, which isn’t actually specific to any TAP
(since you can’t yet trust the scan chain’s contents to be accurate), you might:
jtag configure CHIP.jrc -event post-reset {
echo "JTAG Reset done"
... non-scan jtag operations to be done after reset
}
Chapter 10: TAP Declaration 57
10.7 Autoprobing
TAP configuration is the first thing that needs to be done after interface and reset con-
figuration. Sometimes it’s hard finding out what TAPs exist, or how they are identified.
Vendor documentation is not always easy to find and use.
To help you get past such problems, OpenOCD has a limited autoprobing ability to look at
the scan chain, doing a blind interrogation and then reporting the TAPs it finds. To use this
mechanism, start the OpenOCD server with only data that configures your JTAG interface,
and arranges to come up with a slow clock (many devices don’t support fast JTAG clocks
right when they come out of reset).
For example, your openocd.cfg file might have:
source [find interface/olimex-arm-usb-tiny-h.cfg]
reset_config trst_and_srst
jtag_rclk 8
When you start the server without any TAPs configured, it will attempt to autoconfigure
the TAPs. There are two parts to this:
1. TAP discovery ... After a JTAG reset (sometimes a system reset may be needed too),
each TAP’s data registers will hold the contents of either the IDCODE or BYPASS
register. If JTAG communication is working, OpenOCD will see each TAP, and report
what -expected-id to use with it.
2. IR Length discovery ... Unfortunately JTAG does not provide a reliable way to find out
the value of the -irlen parameter to use with a TAP that is discovered. If OpenOCD
can discover the length of a TAP’s instruction register, it will report it. Otherwise you
may need to consult vendor documentation, such as chip data sheets or BSDL files.
In many cases your board will have a simple scan chain with just a single device. Here’s
what OpenOCD reported with one board that’s a bit more complex:
clock speed 8 kHz
There are no enabled taps. AUTO PROBING MIGHT NOT WORK!!
AUTO auto0.tap - use "jtag newtap auto0 tap -expected-id 0x2b900f0f ..."
AUTO auto1.tap - use "jtag newtap auto1 tap -expected-id 0x07926001 ..."
AUTO auto2.tap - use "jtag newtap auto2 tap -expected-id 0x0b73b02f ..."
AUTO auto0.tap - use "... -irlen 4"
AUTO auto1.tap - use "... -irlen 4"
AUTO auto2.tap - use "... -irlen 6"
no gdb ports allocated as no target has been specified
Given that information, you should be able to either find some existing config files to use,
or create your own. If you create your own, you would configure from the bottom up: first
a target.cfg file with these TAPs, any targets associated with them, and any on-chip
resources; then a board.cfg with off-chip resources, clocking, and so forth.
Chapter 11: CPU Configuration 59
11 CPU Configuration
This chapter discusses how to set up GDB debug targets for CPUs. You can also access
these targets without GDB (see Chapter 16 [Architecture and Core Commands], page 96,
and [Target State handling], page 91) and through various kinds of NAND and NOR flash
commands. If you have multiple CPUs you can have multiple such targets.
We’ll start by looking at how to examine the targets you have, then look at how to add one
more target and how to configure it.
To avoid being confused by the variety of ARM based cores, remember this key point:
ARM is a technology licencing company. (See: http://www.arm.com.) The CPU name
used by OpenOCD will reflect the CPU design that was licenced, not a vendor brand which
incorporates that design. Name prefixes like arm7, arm9, arm11, and cortex reflect design
generations; while names like ARMv4, ARMv5, ARMv6, and ARMv7 reflect an architecture
version implemented by a CPU design.
addresses needed. At this writing, OpenOCD doesn’t have much MMU intelli-
gence.
It’s often very useful to define a reset-init event handler. For systems that are normally
used with a boot loader, common tasks include updating clocks and initializing memory
controllers. That may be needed to let you write the boot loader into flash, in order to
“de-brick” your board; or to load programs into external DDR memory without having run
the boot loader.
target create target name type configparams... [Command]
This command creates a GDB debug target that refers to a specific JTAG tap. It
enters that target into a list, and creates a new command (target_name) which is
used for various purposes including additional configuration.
• target name ... is the name of the debug target. By convention this should be
the same as the dotted.name of the TAP associated with this target, which must
be specified here using the -chain-position dotted.name configparam.
This name is also used to create the target object command, referred to here as
$target_name, and in other places the target needs to be identified.
• type ... specifies the target type. See [target types], page 60.
• configparams ... all parameters accepted by $target_name configure are per-
mitted. If the target is big-endian, set it here with -endian big. If the variant
matters, set it here with -variant.
You must set the -chain-position dotted.name here.
$target_name configure configparams... [Command]
The options accepted by this command may also be specified as parameters to target
create. Their values can later be queried one at a time by using the $target_name
cget command.
Warning: changing some of these after setup is dangerous. For example, moving a
target from one TAP to another; and changing its endianness or variant.
• -chain-position dotted.name – names the TAP used to access this target.
• -endian (big|little) – specifies whether the CPU uses big or little endian
conventions
• -event event name event body – See [Target Events], page 64. Note that this
updates a list of named event handlers. Calling this twice with two different
event names assigns two different handlers, but calling it twice with the same
event name assigns only one handler.
• -variant name – specifies a variant of the target, which OpenOCD needs to
know about.
• -work-area-backup (0|1) – says whether the work area gets backed up; by
default, it is not backed up. When possible, use a working area that doesn’t need
to be backed up, since performing a backup slows down operations. For example,
the beginning of an SRAM block is likely to be used by most build systems, but
the end is often unused.
• -work-area-size size – specify work are size, in bytes. The same size applies
regardless of whether its physical or virtual address is being used.
Chapter 11: CPU Configuration 63
• -work-area-phys address – set the work area base address to be used when no
MMU is active.
• -work-area-virt address – set the work area base address to be used when an
MMU is active. Do not specify a value for this except on targets with an MMU.
The value should normally correspond to a static mapping for the -work-area-
phys address, set up by the current operating system.
• -rtos rtos type – enable rtos support for target, rtos type can be one of
auto|eCos|ThreadX| FreeRTOS|linux.
• gdb-detach
When GDB disconnects
• gdb-end
When the target has halted and GDB is not doing anything (see early halt)
• gdb-flash-erase-start
Before the GDB flash process tries to erase the flash
• gdb-flash-erase-end
After the GDB flash process has finished erasing the flash
• gdb-flash-write-start
Before GDB writes to the flash
• gdb-flash-write-end
After GDB writes to the flash
• gdb-start
Before the target steps, gdb is trying to start/resume the target
• halted
The target has halted
• reset-assert-pre
Issued as part of reset processing after reset_init was triggered but before either
SRST alone is re-asserted on the scan chain, or reset-assert is triggered.
• reset-assert
Issued as part of reset processing after reset-assert-pre was triggered. When such a
handler is present, cores which support this event will use it instead of asserting SRST.
This support is essential for debugging with JTAG interfaces which don’t include an
SRST line (JTAG doesn’t require SRST), and for selective reset on scan chains that
have multiple targets.
• reset-assert-post
Issued as part of reset processing after reset-assert has been triggered. or the target
asserted SRST on the entire scan chain.
• reset-deassert-pre
Issued as part of reset processing after reset-assert-post has been triggered.
• reset-deassert-post
Issued as part of reset processing after reset-deassert-pre has been triggered and
(if the target is using it) after SRST has been released on the scan chain.
• reset-end
Issued as the final step in reset processing.
• reset-init
Used by reset init command for board-specific initialization. This event fires after
reset-deassert-post.
This is where you would configure PLLs and clocking, set up DRAM so you can down-
load programs that don’t fit in on-chip SRAM, set up pin multiplexing, and so on.
(You may be able to switch to a fast JTAG clock rate here, after the target clocks are
fully set up.)
• reset-start
Issued as part of reset processing before reset_init is called.
Chapter 11: CPU Configuration 67
This is the most robust place to use jtag_rclk or adapter_khz to switch to a low
JTAG clock rate, when reset disables PLLs needed to use a fast clock.
• resume-start
Before any target is resumed
• resume-end
After all targets have resumed
• resumed
Target has resumed
Chapter 12: Flash Commands 68
12 Flash Commands
OpenOCD has different commands for NOR and NAND flash; the “flash” command works
with NOR flash, while the “nand” command works with NAND flash. This partially reflects
different hardware technologies: NOR flash usually supports direct CPU instruction and
data bus access, while data from a NAND flash must be copied to memory before it can be
used. (SPI flash must also be copied to memory before use.) However, the documentation
also uses “flash” as a generic term; for example, “Put flash configuration in board-specific
files”.
Flash Steps:
1. Configure via the command flash bank
Do this in a board-specific configuration file, passing parameters as needed by the
driver.
2. Operate on the flash via flash subcommand
Often commands to manipulate the flash are typed by a human, or run via a script in
some automated way. Common tasks include writing a boot loader, operating system,
or other data.
3. GDB Flashing
Flashing via GDB requires the flash be configured via “flash bank”, and the GDB flash
features be enabled. See [GDB Configuration], page 35.
Many CPUs have the ablity to “boot” from the first flash bank. This means that mis-
programming that bank can “brick” a system, so that it can’t boot. JTAG tools, like
OpenOCD, are often then used to “de-brick” the board by (re)installing working boot
firmware.
• target ... Names the target used to issue commands to the flash controller.
• driver options ... drivers may support, or require, additional parameters. See
the driver-specific documentation for more information.
Note: This command is not available after OpenOCD initialization has
completed. Use it in board specific configuration files, not interactively.
Also, when flash protection is important, you must re-apply it after it has
been removed by the unlock flag.
Chapter 12: Flash Commands 71
external SPI flash devices. Depending on specific device and board configuration, up
to 4 external flash devices can be connected.
SMI makes the flash content directly accessible in the CPU address space; each exter-
nal device is mapped in a memory bank. CPU can directly read data, execute code
and boot from SMI banks. Normal OpenOCD commands like mdw can be used to
display the flash content.
The setup command only requires the base parameter in order to identify the memory
bank. All other parameters are ignored. Additional information, like flash size, are
detected automatically.
flash bank $_FLASHNAME stmsmi 0xf8000000 0 0 0 $_TARGETNAME
The predefined parameters base, size, chip width and bus width of the flash bank
command are ignored. Flash size and sector layout are auto-configured by the driver.
The driver has one additional mandatory parameter: The CPU clock rate (in kHz)
at the time the flash operations will take place. Most of the time this will not be the
crystal frequency, but a higher PLL frequency. The reset-init event handler in the
board script is usually the place where you start the PLL.
The driver rejects flashless devices (currently the LPC2930).
The EEPROM in LPC2900 devices is not mapped directly into the address space. It
must be handled much more like NAND flash memory, and will therefore be handled
by a separate lpc2900_eeprom driver (not yet available).
Sector protection in terms of the LPC2900 is handled transparently. Every time a
sector needs to be erased or programmed, it is automatically unprotected. What is
shown as protection status in the flash info command, is actually the LPC2900
sector security. This is a mechanism to prevent a sector from ever being erased or
programmed again. As this is an irreversible mechanism, it is handled by a spe-
cial command (lpc2900 secure_sector), and not by the standard flash protect
command.
Example for a 125 MHz clock frequency:
flash bank $_FLASHNAME lpc2900 0 0 0 0 $_TARGETNAME 125000
Some lpc2900-specific commands are defined. In the following command list, the
bank parameter is the bank number as obtained by the flash banks command.
The index sector of the flash is a write-only sector. It cannot be erased! In order to
guard against unintentional write access, all following commands need to be preceeded
by a successful call to the password command:
• master bank The bank that this virtual address refers to.
So in the following example addresses 0xbfc00000 and 0x9fc00000 refer to the flash
bank defined at address 0x1fc00000. Any cmds executed on the virtual banks are
actually performed on the physical banks.
flash bank $_FLASHNAME pic32mx 0x1fc00000 0 0 0 $_TARGETNAME
flash bank vbank0 virtual 0xbfc00000 0 0 0 $_TARGETNAME $_FLASHNAME
flash bank vbank1 virtual 0x9fc00000 0 0 0 $_TARGETNAME $_FLASHNAME
Before we run any commands using the str9xpec driver we must first disable the str9 core.
This example assumes the str9xpec driver has been configured for flash bank 0.
# assert srst, we do not want core running
# while accessing str9xpec flash driver
jtag_reset 0 1
# turn off target polling
poll off
# disable str9 core
str9xpec enable_turbo 0
# read option bytes
str9xpec options_read 0
# re-enable str9 core
str9xpec disable_turbo 0
poll on
reset halt
The above example will read the str9 option bytes. When performing a unlock remember
that you will not be able to halt the str9 - it has been locked. Halting the core is not required
for the str9xpec driver as mentioned above, just issue the commands above manually or
from a telnet prompt.
Chapter 12: Flash Commands 80
12.5 mFlash
12.5.1 mFlash Configuration
mflash bank soc base RST pin target [Config Command]
Configures a mflash for soc host bank at address base. The pin number format
depends on the host GPIO naming convention. Currently, the mflash driver supports
s3c2440 and pxa270.
Example for s3c2440 mflash where RST pin is GPIO B1:
Chapter 12: Flash Commands 81
• no oob * parameter
Output file holds only page data; OOB is discarded.
• oob_raw
Output file interleaves page data and OOB data; the file will be longer than
"length" by the size of the spare areas associated with each data page. Note that
this kind of "raw" access is different from what’s implied by nand raw_access,
which just controls whether a hardware-aware access method is used.
• oob_only
Output file has only raw OOB data, and will be smaller than "length" since it
will contain only the spare areas associated with each data page.
nand erase num [offset length] [Command]
Erases blocks on the specified NAND device, starting at the specified offset and con-
tinuing for length bytes. Both of those values must be exact multiples of the device’s
block size, and the region they specify must fit entirely in the chip. If those param-
eters are not specified, the whole NAND chip will be erased. The num parameter is
the value shown by nand list.
NOTE: This command will try to erase bad blocks, when told to do so, which will
probably invalidate the manufacturer’s bad block marker. For the remainder of the
current server session, nand info will still report that the block “is” bad.
nand write num filename offset [option...] [Command]
Writes binary data from the file into the specified NAND device, starting at the
specified offset. Those pages should already have been erased; you can’t change zero
bits to one bits. The num parameter is the value shown by nand list.
Use a complete path name for filename, so you don’t depend on the directory used to
start the OpenOCD server.
The offset must be an exact multiple of the device’s page size. All data in the file
will be written, assuming it doesn’t run past the end of the device. Only full pages
are written, and any extra space in the last page will be filled with 0xff bytes. (That
includes OOB data, if that’s being written.)
NOTE: At the time this text was written, bad blocks are ignored. That is, this routine
will not skip bad blocks, but will instead try to write them. This can cause problems.
Provide at most one option parameter. With some NAND drivers, the meanings of
these parameters may change if nand raw_access was used to disable hardware ECC.
• no oob * parameter
File has only page data, which is written. If raw acccess is in use, the OOB area
will not be written. Otherwise, if the underlying NAND controller driver has a
write_page routine, that routine may write the OOB with hardware-computed
ECC data.
• oob_only
File has only raw OOB data, which is written to the OOB area. Each page’s data
area stays untouched. This can be a dangerous option, since it can invalidate the
ECC data. You may need to force raw access to use this mode.
• oob_raw
File interleaves data and OOB data, both of which are written If raw access is
Chapter 13: NAND Flash Commands 85
enabled, the data is written first, then the un-altered OOB. Otherwise, if the
underlying NAND controller driver has a write_page routine, that routine may
modify the OOB before it’s written, to include hardware-computed ECC data.
• oob_softecc
File has only page data, which is written. The OOB area is filled with 0xff,
except for a standard 1-bit software ECC code stored in conventional locations.
You might need to force raw access to use this mode, to prevent the underlying
driver from applying hardware ECC.
• oob_softecc_kw
File has only page data, which is written. The OOB area is filled with 0xff, except
for a 4-bit software ECC specific to the boot ROM in Marvell Kirkwood SoCs.
You might need to force raw access to use this mode, to prevent the underlying
driver from applying hardware ECC.
At this writing, this driver includes write_page and read_page methods. Using nand
raw_access to disable those methods will prevent use of hardware ECC in the MLC
controller mode, but won’t change SLC behavior.
14 PLD/FPGA Commands
Programmable Logic Devices (PLDs) and the more flexible Field Programmable Gate Ar-
rays (FPGAs) are both types of programmable hardware. OpenOCD can support program-
ming them. Although PLDs are generally restrictive (cells are less functional, and there are
no special purpose cells for memory or computational tasks), they share the same OpenOCD
infrastructure. Accordingly, both are called PLDs here.
pld device driver name tap name [driver options] [Config Command]
Defines a new PLD device, supported by driver driver name, using the TAP named
tap name. The driver may make use of any driver options to configure its behavior.
15 General Commands
The commands documented in this chapter here are common commands that you, as a
human, may want to type and see the output of. Configuration type commands are docu-
mented elsewhere.
Intent:
• Source Of Commands
OpenOCD commands can occur in a configuration script (discussed elsewhere) or typed
manually by a human or supplied programatically, or via one of several TCP/IP Ports.
• From the human
A human should interact with the telnet interface (default port: 4444) or via GDB
(default port 3333).
To issue commands from within a GDB session, use the monitor command, e.g. use
monitor poll to issue the poll command. All output is relayed through the GDB
session.
• Machine Interface The Tcl interface’s intent is to be a machine interface. The default
Tcl port is 5555.
shutdown [Command]
Close the OpenOCD daemon, disconnecting all clients (GDB, telnet, other).
that operation also puts the core into a low power mode by gating the
core clock; but the core clock is needed to detect JTAG clock transitions.
One partial workaround uses adaptive clocking: when the core is inter-
rupted the operation completes, then JTAG clocks are accepted at least
until the interrupt handler completes. However, this workaround is often
unusable since the processor, board, and JTAG adapter must all support
adaptive JTAG clocking. Also, it can’t work until an interrupt is issued.
A more complete workaround is to not use that operation while you work
with a JTAG debugger. Tasking environments generaly have idle loops
where the body is the wait for interrupt operation. (On older cores, it
is a coprocessor action; newer cores have a wfi instruction.) Such loops
can just remove that operation, at the cost of higher power consumption
(because the CPU is needlessly clocked).
resume [address] [Command]
Resume the target at its current code position, or the optional address if it is provided.
OpenOCD will wait 5 seconds for the target to resume.
step [address] [Command]
Single-step the target at its current code position, or the optional address if it is
provided.
reset [Command]
reset run [Command]
reset halt [Command]
reset init [Command]
Perform as hard a reset as possible, using SRST if possible. All defined targets will
be reset, and target events will fire during the reset sequence.
The optional parameter specifies what should happen after the reset. If there is no
parameter, a reset run is executed. The other options will not work on all systems.
See Chapter 9 [Reset Configuration], page 48.
− run Let the target run
− halt Immediately halt the target
− init Immediately halt the target, and execute the reset-init script
soft_reset_halt [Command]
Requesting target halt and executing a soft reset. This is often used when a target
cannot be reset and halted. The target, after reset is released begins to execute code.
OpenOCD attempts to stop the CPU and then sets the program counter back to the
reset vector. Unfortunately the code that was executed may have left the hardware
in an unknown state.
ip [Command]
No description provided.
ls [Command]
No description provided.
mac [Command]
No description provided.
meminfo [Command]
Display available RAM memory on OpenOCD host. Used in OpenOCD regression
testing scripts.
peek [Command]
No description provided.
poke [Command]
No description provided.
rm filename [Command]
Unlinks the file filename.
version [Command]
Displays a string identifying the version of this OpenOCD server.
Several of the parameters must reflect the trace port capabilities, which are a func-
tion of silicon capabilties (exposed later using etm info) and of what hardware is
connected to that port (such as an external pod, or ETB). The width must be either
4, 8, or 16, except with ETMv3.0 and newer modules which may also support 1, 2,
24, 32, 48, and 64 bit widths. (With those versions, etm info also shows whether the
selected port width and mode are supported.)
The mode must be normal, multiplexed, or demultiplexed. The clocking must be
half or full.
Warning: With ETMv3.0 and newer, the bits set with the mode and
clocking parameters both control the mode. This modified mode does not
map to the values supported by previous ETM modules, so this syntax
is subject to change.
Note: You can see the ETM registers using the reg command. Not all
possible registers are present in every ETM. Most of the registers are
write-only, and are used to configure what CPU activities are traced.
etm tracemode [type context id bits cycle accurate branch output] [Command]
Displays what data that ETM will collect. If arguments are provided, first configures
that data. When the configuration changes, tracing is stopped and any buffered trace
data is invalidated.
• type ... describing how data accesses are traced, when they pass any ViewData
filtering that that was set up. The value is one of none (save nothing), data
(save data), address (save addresses), all (save data and addresses)
• context id bits ... 0, 8, 16, or 32
• cycle accurate ... enable or disable cycle-accurate instruction tracing. Before
ETMv3, enabling this causes much extra data to be recorded.
• branch output ... enable or disable. Disable this unless you need to try recon-
structing the instruction trace stream without an image of the code.
At this writing, September 2009, there are no Tcl utility procedures to help set up any
common tracing scenarios.
resources, so long as you’re not concerned with code that branches directly to those
hardware vectors.
This always finishes by listing the current configuration. If parameters are provided, it
first reconfigures the vector catch hardware to intercept all of the hardware vectors,
none of them, or a list with one or more of the following: reset undef swi pabt dabt
irq fiq.
initialized the vector table, but before exceptions are enabled. A breakpoint can be used to
accomplish this once the appropriate location in the start-up code has been identified. A
watchpoint over the vector table region is helpful in finding the location if you’re not sure.
Note that the same situation exists any time the vector table is modified by the system
software.
The debug handler must be placed somewhere in the address space using the xscale
debug_handler command. The allowed locations for the debug handler are either (0x800 -
0x1fef800) or (0xfe000800 - 0xfffff800). The default value is 0xfe000800.
XScale has resources to support two hardware breakpoints and two watchpoints. However,
the following restrictions on watchpoint functionality apply: (1) the value and mask argu-
ments to the wp command are not supported, (2) the watchpoint length must be a power
of two and not less than four, and can not be greater than the watchpoint address, and
(3) a watchpoint with a length greater than four consumes all the watchpoint hardware
resources. This means that at any one time, you can have enabled either two watchpoints
with a length of four, or one watchpoint with a length greater than four.
These commands are available to XScale based CPUs, which are implementations of the
ARMv5TE architecture.
Linux-ARM kernels have a “Kernel low-level debugging via EmbeddedICE DCC channel”
option (CONFIG DEBUG ICEDCC, depends on CONFIG DEBUG LL) which uses this
mechanism to deliver messages before a serial console can be activated. This is not the
same format used by libdcc. Other software, such as the U-Boot boot loader, sometimes
does the same thing.
17 JTAG Commands
Most general purpose JTAG commands have been presented earlier. (See [JTAG Speed],
page 46, Chapter 9 [Reset Configuration], page 48, and Chapter 10 [TAP Declaration],
page 53.) Lower level JTAG commands, as presented here, may be needed to work with
targets which require special attention during operations such as reset or initialization.
To use these commands you will need to understand some of the basics of JTAG, including:
• A JTAG scan chain consists of a sequence of individual TAP devices such as a CPUs.
• Control operations involve moving each TAP through the same standard state machine
(in parallel) using their shared TMS and clock signals.
• Data transfer involves shifting data through the chain of instruction or data registers
of each TAP, writing new register values while the reading previous ones.
• Data register sizes are a function of the instruction active in a given TAP, while in-
struction register sizes are fixed for each TAP. All TAPs support a BYPASS instruction
with a single bit data register.
• The way OpenOCD differentiates between TAP devices is by shifting different instruc-
tions into (and out of) their instruction registers.
flush_count [Command]
Returns the number of times the JTAG queue has been flushed. This may be used
for performance tuning.
For example, flushing a queue over USB involves a minimum latency, often several
milliseconds, which does not change with the amount of data which is written. You
may be able to identify performance problems by finding tasks which waste bandwidth
by flushing small transfers too often, instead of batching them into larger operations.
irscan [tap instruction]+ [-endstate tap state] [Command]
For each tap listed, loads the instruction register with its associated numeric
instruction. (The number of bits in that instruction may be displayed using the
scan_chain command.) For other TAPs, a BYPASS instruction is loaded.
When tap state is specified, the JTAG state machine is left in that state. For example
irpause might be specified, so the data register can be loaded before re-entering the
run/idle state. If the end state is not specified, the run/idle state is entered.
Note: OpenOCD currently supports only a single field for instruction reg-
ister values, unlike data register values. For TAPs where the instruction
register length is more than 32 bits, portable scripts currently must issue
only BYPASS instructions.
jtag_reset trst srst [Command]
Set values of reset signals. The trst and srst parameter values may be 0, indicating
that reset is inactive (pulled or driven high), or 1, indicating it is active (pulled or
driven low). The reset_config command should already have been used to configure
how the board and JTAG adapter treat these two signals, and to say if either signal
is even present. See Chapter 9 [Reset Configuration], page 48.
Note that TRST is specially handled. It actually signifies JTAG’s reset state. So if
the board doesn’t support the optional TRST signal, or it doesn’t support it along
with the specified SRST value, JTAG reset is triggered with TMS and TCK signals
instead of the TRST signal. And no matter how that JTAG reset is triggered, once the
scan chain enters reset with TRST inactive, TAP post-reset events are delivered
to all TAPs with handlers for that event.
pathmove start state [next state ...] [Command]
Start by moving to start state, which must be one of the stable states. Unless it is the
only state given, this will often be the current state, so that no TCK transitions are
needed. Then, in a series of single state transitions (conforming to the JTAG state
machine) shift to each next state in sequence, one per TCK cycle. The final state
must also be stable.
runtest num_cycles [Command]
Move to the run/idle state, and execute at least num cycles of the JTAG clock
(TCK). Instructions often need some time to execute before they take effect.
verify_ircapture (enable|disable) [Command]
Verify values captured during ircapture and returned during IR scans. Default
is enabled, but this can be overridden by verify_jtag. This flag is ignored when
validating JTAG chain configuration.
Chapter 17: JTAG Commands 111
The OpenOCD sources also include two utility scripts for working with XSVF; they are not
currently installed after building the software. You may find them useful:
• svf2xsvf ... converts SVF files into the extended XSVF syntax understood by the xsvf
command; see notes below.
• xsvfdump ... converts XSVF files into a text output format; understands the OpenOCD
extensions.
The input format accepts a handful of non-standard extensions. These include three op-
codes corresponding to SVF extensions from Lattice Semiconductor (LCOUNT, LDELAY,
LDSR), and two opcodes supporting a more accurate translation of SVF (XTRST, XWAIT-
STATE). If xsvfdump shows a file is using those opcodes, it probably will not be usable with
other XSVF tools.
Chapter 19: TFTP 113
19 TFTP
If OpenOCD runs on an embedded host(as ZY1000 does), then TFTP can be used to access
files on PCs (either the developer’s PC or some other PC).
The way this works on the ZY1000 is to prefix a filename by "/tftp/ip/" and append the
TFTP path on the TFTP server (tftpd). For example,
load_image /tftp/10.0.0.96/c:\temp\abc.elf
will load c:\temp\abc.elf from the developer pc (10.0.0.96) into memory as if the file was
hosted on the embedded host.
In order to achieve decent performance, you must choose a TFTP server that supports a
packet size bigger than the default packet size (512 bytes). There are numerous TFTP
servers out there (free and commercial) and you will have to do a bit of googling to find
something that fits your requirements.
Chapter 20: GDB and OpenOCD 114
(gdb) load
Loading section .vectors, size 0x100 lma 0x20000000
Loading section .text, size 0x5a0 lma 0x20000100
Loading section .data, size 0x18 lma 0x200006a0
Start address 0x2000061c, load size 1720
Transfer rate: 22 KB/sec, 573 bytes/write.
(gdb) continue
Continuing.
...
You could then interrupt the GDB session to make the program break, type where to show
the stack, list to show the code around the program counter, step through code, set
breakpoints or watchpoints, and so on.
gdb_memory_map disable
For this to function correctly a valid flash configuration must also be set in OpenOCD. For
faster performance you should also configure a valid working area.
Informing GDB of the memory map of the target will enable GDB to protect any flash
areas of the target and use hardware breakpoints by default. This means that the
OpenOCD option gdb_breakpoint_override is not required when using a memory map.
See [gdb breakpoint override], page 35.
To view the configured memory map in GDB, use the GDB command info mem All other
unassigned addresses within GDB are treated as RAM.
GDB 6.8 and higher set any memory area not in the memory map as inaccessible. This can
be changed to the old behaviour by using the following GDB command
set mem inaccessible-by-default off
If gdb_flash_program enable is also used, GDB will be able to program any flash memory
using the vFlash interface.
GDB will look at the target memory map when a load command is given, if any areas to
be programmed lie within the target flash area the vFlash packets will be used.
If the target needs configuring before GDB programming, an event script can be executed:
$_TARGETNAME configure -event EVENTNAME BODY
To verify any flash programming the GDB command compare-sections can be used.
22 FAQ
1. RTCK, also known as: Adaptive Clocking - What is it?
>
3. Missing: cygwin1.dll OpenOCD complains about a missing cygwin1.dll.
Make sure you have Cygwin installed, or at least a version of OpenOCD that claims
to come with all the necessary DLLs. When using Cygwin, try launching OpenOCD
from the Cygwin shell.
4. Breakpoint Issue I’m trying to set a breakpoint using GDB (or a frontend like
Insight or Eclipse), but OpenOCD complains that "Info: arm7 9 common.c:213
arm7 9 add breakpoint(): sw breakpoint requested, but software breakpoints not
enabled".
GDB issues software breakpoints when a normal breakpoint is requested, or to imple-
ment source-line single-stepping. On ARMv4T systems, like ARM7TDMI, ARM720T
Chapter 22: FAQ 122
or ARM920T, software breakpoints consume one of the two available hardware break-
points.
5. LPC2000 Flash When erasing or writing LPC2000 on-chip flash, the operation fails at
random.
Make sure the core frequency specified in the flash lpc2000 line matches the clock
at the time you’re programming the flash. If you’ve specified the crystal’s frequency,
make sure the PLL is disabled. If you’ve specified the full core speed (e.g. 60MHz),
make sure the PLL is enabled.
6. Amontec Chameleon When debugging using an Amontec Chameleon in its JTAG Accel-
erator configuration, I keep getting "Error: amt jtagaccel.c:184 amt wait scan busy():
amt jtagaccel timed out while waiting for end of scan, rtck was disabled".
Make sure your PC’s parallel port operates in EPP mode. You might have to try
several settings in your PC BIOS (ECP, EPP, and different versions of those).
7. Data Aborts When debugging with OpenOCD and GDB (plain GDB, Insight, or
Eclipse), I get lots of "Error: arm7 9 common.c:1771 arm7 9 read memory(): memory
read caused data abort".
The errors are non-fatal, and are the result of GDB trying to trace stack frames beyond
the last valid frame. It might be possible to prevent this by setting up a proper "initial"
stack frame, if you happen to know what exactly has to be done, feel free to add this
here.
Simple: In your startup code - push 8 registers of zeros onto the stack before calling
main(). What GDB is doing is “climbing” the run time stack by reading various values
on the stack using the standard call frame for the target. GDB keeps going - until one of
2 things happen #1 an invalid frame is found, or #2 some huge number of stackframes
have been processed. By pushing zeros on the stack, GDB gracefully stops.
Debugging Interrupt Service Routines - In your ISR before you call your C code, do
the same - artifically push some zeros onto the stack, remember to pop them off when
the ISR is done.
Also note: If you have a multi-threaded operating system, they often do not in the
intrest of saving memory waste these few bytes. Painful...
8. JTAG Reset Config I get the following message in the OpenOCD console (or log file):
"Warning: arm7 9 common.c:679 arm7 9 assert reset(): srst resets test logic, too".
This warning doesn’t indicate any serious problem, as long as you don’t want to debug
your core right out of reset. Your .cfg file specified jtag_reset trst_and_srst srst_
pulls_trst to tell OpenOCD that either your board, your debugger or your target uC
(e.g. LPC2000) can’t assert the two reset signals independently. With this setup, it’s
not possible to halt the core right out of reset, everything else should work fine.
9. USB Power When using OpenOCD in conjunction with Amontec JTAGkey and the
Yagarto toolchain (Eclipse, arm-elf-gcc, arm-elf-gdb), the debugging seems to be un-
stable. When single-stepping over large blocks of code, GDB and OpenOCD quit with
an error message. Is there a stability issue with OpenOCD?
No, this is not a stability issue concerning OpenOCD. Most users have solved this issue
by simply using a self-powered USB hub, which they connect their Amontec JTAGkey
to. Apparently, some computers do not provide a USB power supply stable enough for
the Amontec JTAGkey to be operated.
Chapter 22: FAQ 123
259, page 651/681, the “TDI” pin is connected to the boundary scan TAP, which then
connects to the Cortex-M3 TAP, which then connects to the TDO pin.
Thus, the proper order for the STM32 chip is: (1) The Cortex-M3, then (2) The
boundary scan TAP. If your board includes an additional JTAG chip in the scan chain
(for example a Xilinx CPLD or FPGA) you could place it before or after the STM32
chip in the chain. For example:
• OpenOCD TDI(output) -> STM32 TDI Pin (BS Input)
• STM32 BS TDO (output) -> STM32 Cortex-M3 TDI (input)
• STM32 Cortex-M3 TDO (output) -> SM32 TDO Pin
• STM32 TDO Pin (output) -> Xilinx TDI Pin (input)
• Xilinx TDO Pin -> OpenOCD TDO (input)
The “jtag device” commands would thus be in the order shown below. Note:
• jtag newtap Xilinx tap -irlen ...
• jtag newtap stm32 cpu -irlen ...
• jtag newtap stm32 bs -irlen ...
• # Create the debug target and say where it is
• target create stm32.cpu -chain-position stm32.cpu ...
15. SYSCOMP Sometimes my debugging session terminates with an error. When I
look into the log file, I can see these error messages: Error: arm7 9 common.c:561
arm7 9 execute sys speed(): timeout waiting for SYSCOMP
TODO.
Chapter 23: Tcl Crash Course 125
• [square-brackets]
[square-brackets] are command substitutions. It operates much like Unix Shell ‘back-
ticks‘. The result of a [square-bracket] operation is exactly 1 string. Remember Rule
#1 - Everything is a string. These two statements are roughly identical:
# bash example
X=‘date‘
echo "The Date is: $X"
# Tcl example
set X [date]
puts "The Date is: $X"
• “double-quoted-things”
“double-quoted-things” are just simply quoted text. $VARIABLES and [square-
brackets] are expanded in place - the result however is exactly 1 string. Remember
Rule #1 - Everything is a string
set x "Dinner"
puts "It is now \"[date]\", $x is in 1 hour"
• {Curly-Braces}
{Curly-Braces} are magic: $VARIABLES and [square-brackets] are parsed, but are
NOT expanded or executed. {Curly-Braces} are like ’single-quote’ operators in BASH
shell scripts, with the added feature: {curly-braces} can be nested, single quotes can
not. {{{this is nested 3 times}}} NOTE: [date] is a bad example; at this writing,
Jim/OpenOCD does not have a date command.
int
MyForCommand( void *interp,
int argc,
char **argv )
{
if( argc != 5 ){
SetResult( interp, "WRONG number of parameters");
return ERROR;
}
// Return no error
SetResult( interp, "" );
return SUCCESS;
}
Every other command IF, WHILE, FORMAT, PUTS, EXPR, everything works in the same
basic way.
NAME. It should find and return the full path to a file with that name; it uses an
internal search path. The RESULT is a string, which is substituted into the command
line in place of the bracketed find command. (Don’t try to use a FILENAME which
includes the "#" character. That character begins Tcl comments.)
2. The source command is executed with the resulting filename; it reads a file and exe-
cutes as a script.
under this License. If a section does not fit the above definition of Secondary then it is
not allowed to be designated as Invariant. The Document may contain zero Invariant
Sections. If the Document does not identify any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are listed, as Front-Cover
Texts or Back-Cover Texts, in the notice that says that the Document is released under
this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy, represented
in a format whose specification is available to the general public, that is suitable for
revising the document straightforwardly with generic text editors or (for images com-
posed of pixels) generic paint programs or (for drawings) some widely available drawing
editor, and that is suitable for input to text formatters or for automatic translation to
a variety of formats suitable for input to text formatters. A copy made in an otherwise
Transparent file format whose markup, or absence of markup, has been arranged to
thwart or discourage subsequent modification by readers is not Transparent. An image
format is not Transparent if used for any substantial amount of text. A copy that is
not “Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain ascii without
markup, Texinfo input format, LaTEX input format, SGML or XML using a publicly
available DTD, and standard-conforming simple HTML, PostScript or PDF designed
for human modification. Examples of transparent image formats include PNG, XCF
and JPG. Opaque formats include proprietary formats that can be read and edited
only by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for output purposes only.
The “Title Page” means, for a printed book, the title page itself, plus such following
pages as are needed to hold, legibly, the material this License requires to appear in the
title page. For works in formats which do not have any title page as such, “Title Page”
means the text near the most prominent appearance of the work’s title, preceding the
beginning of the body of the text.
A section “Entitled XYZ” means a named subunit of the Document whose title either
is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in
another language. (Here XYZ stands for a specific section name mentioned below, such
as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve
the Title” of such a section when you modify the Document means that it remains a
section “Entitled XYZ” according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that
this License applies to the Document. These Warranty Disclaimers are considered to
be included by reference in this License, but only as regards disclaiming warranties:
any other implication that these Warranty Disclaimers may have is void and has no
effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially or
noncommercially, provided that this License, the copyright notices, and the license
notice saying this License applies to the Document are reproduced in all copies, and
Appendix A: The GNU Free Documentation License. 133
that you add no other conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further copying of the copies
you make or distribute. However, you may accept compensation in exchange for copies.
If you distribute a large enough number of copies you must also follow the conditions
in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly
display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have printed covers) of
the Document, numbering more than 100, and the Document’s license notice requires
Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all
these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify you as the publisher
of these copies. The front cover must present the full title with all words of the title
equally prominent and visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve the title of the
Document and satisfy these conditions, can be treated as verbatim copying in other
respects.
If the required texts for either cover are too voluminous to fit legibly, you should put
the first ones listed (as many as fit reasonably) on the actual cover, and continue the
rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100,
you must either include a machine-readable Transparent copy along with each Opaque
copy, or state in or with each Opaque copy a computer-network location from which
the general network-using public has access to download using public-standard network
protocols a complete Transparent copy of the Document, free of added material. If
you use the latter option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this Transparent copy will
remain thus accessible at the stated location until at least one year after the last time
you distribute an Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the Document well
before redistributing any large number of copies, to give them a chance to provide you
with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under the conditions
of sections 2 and 3 above, provided that you release the Modified Version under precisely
this License, with the Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever possesses a copy of
it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct from that of the
Document, and from those of previous versions (which should, if there were any,
be listed in the History section of the Document). You may use the same title as
a previous version if the original publisher of that version gives permission.
Appendix A: The GNU Free Documentation License. 134
B. List on the Title Page, as authors, one or more persons or entities responsible for
authorship of the modifications in the Modified Version, together with at least five
of the principal authors of the Document (all of its principal authors, if it has fewer
than five), unless they release you from this requirement.
C. State on the Title page the name of the publisher of the Modified Version, as the
publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications adjacent to the other
copyright notices.
F. Include, immediately after the copyright notices, a license notice giving the public
permission to use the Modified Version under the terms of this License, in the form
shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections and required Cover
Texts given in the Document’s license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled “History”, Preserve its Title, and add to it an item
stating at least the title, year, new authors, and publisher of the Modified Version
as given on the Title Page. If there is no section Entitled “History” in the Docu-
ment, create one stating the title, year, authors, and publisher of the Document
as given on its Title Page, then add an item describing the Modified Version as
stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for public access to
a Transparent copy of the Document, and likewise the network locations given in
the Document for previous versions it was based on. These may be placed in the
“History” section. You may omit a network location for a work that was published
at least four years before the Document itself, or if the original publisher of the
version it refers to gives permission.
K. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title
of the section, and preserve in the section all the substance and tone of each of the
contributor acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered in their text and
in their titles. Section numbers or the equivalent are not considered part of the
section titles.
M. Delete any section Entitled “Endorsements”. Such a section may not be included
in the Modified Version.
N. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in
title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or appendices that qualify
as Secondary Sections and contain no material copied from the Document, you may at
your option designate some or all of these sections as invariant. To do this, add their
titles to the list of Invariant Sections in the Modified Version’s license notice. These
titles must be distinct from any other section titles.
Appendix A: The GNU Free Documentation License. 135
You may add a section Entitled “Endorsements”, provided it contains nothing but
endorsements of your Modified Version by various parties—for example, statements of
peer review or that the text has been approved by an organization as the authoritative
definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up
to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified
Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be
added by (or through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or by arrangement
made by the same entity you are acting on behalf of, you may not add another; but
you may replace the old one, on explicit permission from the previous publisher that
added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission
to use their names for publicity for or to assert or imply endorsement of any Modified
Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this License,
under the terms defined in section 4 above for modified versions, provided that you
include in the combination all of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your combined work in its license
notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical
Invariant Sections may be replaced with a single copy. If there are multiple Invariant
Sections with the same name but different contents, make the title of each such section
unique by adding at the end of it, in parentheses, the name of the original author or
publisher of that section if known, or else a unique number. Make the same adjustment
to the section titles in the list of Invariant Sections in the license notice of the combined
work.
In the combination, you must combine any sections Entitled “History” in the vari-
ous original documents, forming one section Entitled “History”; likewise combine any
sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You
must delete all sections Entitled “Endorsements.”
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents released
under this License, and replace the individual copies of this License in the various
documents with a single copy that is included in the collection, provided that you
follow the rules of this License for verbatim copying of each of the documents in all
other respects.
You may extract a single document from such a collection, and distribute it individu-
ally under this License, provided you insert a copy of this License into the extracted
document, and follow this License in all other respects regarding verbatim copying of
that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate and independent
documents or works, in or on a volume of a storage or distribution medium, is called
Appendix A: The GNU Free Documentation License. 136
an “aggregate” if the copyright resulting from the compilation is not used to limit the
legal rights of the compilation’s users beyond what the individual works permit. When
the Document is included in an aggregate, this License does not apply to the other
works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document,
then if the Document is less than one half of the entire aggregate, the Document’s Cover
Texts may be placed on covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form. Otherwise they
must appear on printed covers that bracket the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may distribute translations
of the Document under the terms of section 4. Replacing Invariant Sections with
translations requires special permission from their copyright holders, but you may
include translations of some or all Invariant Sections in addition to the original versions
of these Invariant Sections. You may include a translation of this License, and all the
license notices in the Document, and any Warranty Disclaimers, provided that you
also include the original English version of this License and the original versions of
those notices and disclaimers. In case of a disagreement between the translation and
the original version of this License or a notice or disclaimer, the original version will
prevail.
If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “His-
tory”, the requirement (section 4) to Preserve its Title (section 1) will typically require
changing the actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as expressly
provided for under this License. Any other attempt to copy, modify, sublicense or
distribute the Document is void, and will automatically terminate your rights under
this License. However, parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such parties remain in full
compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of the GNU Free
Documentation License from time to time. Such new versions will be similar in spirit
to the present version, but may differ in detail to address new problems or concerns.
See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document
specifies that a particular numbered version of this License “or any later version”
applies to it, you have the option of following the terms and conditions either of that
specified version or of any later version that has been published (not as a draft) by
the Free Software Foundation. If the Document does not specify a version number of
this License, you may choose any version ever published (not as a draft) by the Free
Software Foundation.
Appendix A: The GNU Free Documentation License. 137
A dotted name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
about . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
adaptive clocking . . . . . . . . . . . . . . . . . . . . . . . . . 47, 120
Architecture Specific Commands . . . . . . . . . . . . . . . 96
E
ARM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 ETB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
ARM semihosting . . . . . . . . . . . . . . . . . . . . . . . . . 17, 100 ETM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
ARM11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 event, reset-init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
ARM7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 56, 65
ARM720T. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
ARM9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
ARM920T. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
F
ARM926ej-s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 faq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
ARM966E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 flash configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
ARMv4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 flash erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
ARMv5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 flash programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
ARMv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 flash protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
ARMv7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 flash reading. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
at91sam3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 flash writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
at91sam4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 FPGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
autoprobe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 FTDI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
B G
board config file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 114
breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 GDB configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
GDB server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
GDB target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
C
CFI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 H
command line options . . . . . . . . . . . . . . . . . . . . . . . . . 11
commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Common Flash Interface . . . . . . . . . . . . . . . . . . . . . . . 71
config command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
config file, board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
I
config file, interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 image dumping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
config file, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 image loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
config file, target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 init board procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . 27
config file, user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 init targets procedure . . . . . . . . . . . . . . . . . . . . . . . . . 31
configuration stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Connecting to GDB . . . . . . . . . . . . . . . . . . . . . . . . . . 114 interface config file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Core Specific Commands . . . . . . . . . . . . . . . . . . . . . . 96
Cortex-M3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
CPU type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 J
CPU variant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Jim-Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
jrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
JTAG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 46
D JTAG autoprobe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
DAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 JTAG Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
DCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 107 JTAG Route Controller . . . . . . . . . . . . . . . . . . . . . . . . 57
Debug Access Port . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
developers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
directory search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 L
disassemble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 libdcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
dongles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Linux-ARM DCC support . . . . . . . . . . . . . . . . . . . . 107
OpenOCD Concept Index 139
logfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 str9xpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
SVF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
SWD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
M
memory access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
message level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
T
mFlash commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 TAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
mFlash Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 80 TAP configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
TAP declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
TAP events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
N TAP naming convention . . . . . . . . . . . . . . . . . . . . . . . 54
TAP state names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
NAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
target config file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
NAND configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
target events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
NAND erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
target initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
NAND other commands . . . . . . . . . . . . . . . . . . . . . . . 85
target type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
NAND programming . . . . . . . . . . . . . . . . . . . . . . . 84, 85
target, current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
NAND reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
target, list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
NAND verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
tcl. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
NAND writing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Tcl Scripting API . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Tcl scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
O TCP port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
object command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 TFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96, 107
translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
P Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
PLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
printer port. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 U
profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 USB Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Programming using GDB . . . . . . . . . . . . . . . . . . . . . 115 user config file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
R V
reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 variable names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Reset Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 vector catch . . . . . . . . . . . . . . . . 16, 101, 105, 106, 107
reset-init handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 vector table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
RTCK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 47, 120
W
S watchpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
scan chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 wiggler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Serial Peripheral Interface . . . . . . . . . . . . . . . . . . . . . 46
Serial Vector Format . . . . . . . . . . . . . . . . . . . . . . . . . 112 X
Serial Wire Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Xilinx Serial Vector Format . . . . . . . . . . . . . . . . . . . 112
server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 XScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
SMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 XSVF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
SMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29, 116
SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
STMicroelectronics Serial Memory Interface . . . . 71 Z
stmsmi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 zy1000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Command and Driver Index 140
$ at91rm9200. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
$target_name arp_examine . . . . . . . . . . . . . . . . . . . . 63 at91sam3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
$target_name arp_halt . . . . . . . . . . . . . . . . . . . . . . . 63 at91sam3 gpnvm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
$target_name arp_poll . . . . . . . . . . . . . . . . . . . . . . . 63 at91sam3 gpnvm clear . . . . . . . . . . . . . . . . . . . . . . . . . 72
$target_name arp_reset . . . . . . . . . . . . . . . . . . . . . . 63 at91sam3 gpnvm set . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
$target_name arp_waitstate . . . . . . . . . . . . . . . . . . 63 at91sam3 gpnvm show . . . . . . . . . . . . . . . . . . . . . . . . . . 73
$target_name array2mem . . . . . . . . . . . . . . . . . . . . . . 63 at91sam3 info. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
$target_name cget . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 at91sam3 slowclk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
$target_name configure . . . . . . . . . . . . . . . . . . . . . . 62 at91sam4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
$target_name curstate . . . . . . . . . . . . . . . . . . . . . . . 64 at91sam7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
$target_name eventlist . . . . . . . . . . . . . . . . . . . . . . 64 at91sam7 gpnvm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
$target_name invoke-event . . . . . . . . . . . . . . . . . . . 64 at91sam9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
$target_name mdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 at91sam9 ale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
$target_name mdh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 at91sam9 ce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
$target_name mdw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 at91sam9 cle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
$target_name mem2array . . . . . . . . . . . . . . . . . . . . . . 63 at91sam9 rdy_busy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
$target_name mwb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 avr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
$target_name mwh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
$target_name mww . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 B
bp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
A
adapter_khz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 C
adapter_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
adapter_nsrst_assert_width . . . . . . . . . . . . . . . . . 49 cat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
adapter_nsrst_delay . . . . . . . . . . . . . . . . . . . . . . . . . 49 cfi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
add_script_search_dir . . . . . . . . . . . . . . . . . . . . . . . 91 cortex_m3 maskisr . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
aduc702x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 cortex_m3 reset_config . . . . . . . . . . . . . . . . . . . . . 107
amt_jtagaccel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 cortex_m3 vector_catch . . . . . . . . . . . . . . . . . . . . . 107
append_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 cp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
arm core_state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
arm disassemble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
arm mcr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
D
arm mrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 dap apid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
arm reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 dap apsel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
arm semihosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 dap baseaddr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
arm-jtag-ew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 dap info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
arm11 memwrite burst . . . . . . . . . . . . . . . . . . . . . . . . 105 dap memaccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
arm11 memwrite error_fatal . . . . . . . . . . . . . . . . . 105 davinci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
arm11 step_irq_enable . . . . . . . . . . . . . . . . . . . . . . 105 debug_level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
arm11 vcr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 drscan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
arm7_9 dbgrq. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 dummy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 99
arm7_9 dcc_downloads . . . . . . . . . . . . . . . . . . . . . . . 101 dump_image. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
arm7_9 fast_memory_access . . . . . . . . . . . . . . . . . . 101
arm720t cp15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
arm9 vector_catch . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 E
arm920t cache_info . . . . . . . . . . . . . . . . . . . . . . . . . . 102 echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
arm920t cp15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 ep93xx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
arm920t cp15i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 etb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
arm920t read_cache . . . . . . . . . . . . . . . . . . . . . . . . . . 102 etb config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
arm920t read_mmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 etb trigger_percent . . . . . . . . . . . . . . . . . . . . . . . . . . 99
arm926ejs cache_info . . . . . . . . . . . . . . . . . . . . . . . 102 etm analyze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
arm966e cp15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 etm config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
armjtagew_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 etm dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Command and Driver Index 141
M
I mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 mdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
init_reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 mdh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 mdw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
interface transports . . . . . . . . . . . . . . . . . . . . . . . . 38 meminfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Command and Driver Index 142
mflash bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 R
mflash config boot . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 rbp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
mflash config pll . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
mflash config storage . . . . . . . . . . . . . . . . . . . . . . . . 81 remote_bitbang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
mflash dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 remote_bitbang_host . . . . . . . . . . . . . . . . . . . . . . . . . 41
mflash probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 remote_bitbang_port . . . . . . . . . . . . . . . . . . . . . . . . . 41
mflash write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
mwb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 reset halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
mwh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 reset init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
mww . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 reset run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
mx3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 reset_config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
mxc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 resume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
mxc biswap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 rlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
rm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
rtck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
N runtest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
nand check_bad_blocks . . . . . . . . . . . . . . . . . . . . . . . 85 rwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
nand device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
nand dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
nand erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 S
nand info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 s3c2410 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
nand list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 s3c2412 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
nand probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 s3c2440 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
nand raw_access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 s3c2443 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
nand verify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 s3c6400 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
nand write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 scan_chain. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
O sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
soft_reset_halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
90
92
ocl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 stellaris . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
oocd_trace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 stellaris recover bank_id . . . . . . . . . . . . . . . . . . . 77
oocd_trace config . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
oocd_trace resync . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 stlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
oocd_trace status . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 stlink_api. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
opendous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 stlink_device_desc . . . . . . . . . . . . . . . . . . . . . . . . . . 45
orion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 stlink_layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
stlink_serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
P stlink_vid_pid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
stm32f1x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
77
parport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 stm32f1x lock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
parport_cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 stm32f1x options_read . . . . . . . . . . . . . . . . . . . . . . . 77
parport_port . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 42, 44 stm32f1x options_write . . . . . . . . . . . . . . . . . . . . . . 77
parport_toggling_time . . . . . . . . . . . . . . . . . . . . . . . 44 stm32f1x unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
parport_write_on_exit . . . . . . . . . . . . . . . . . . . . . . . 44 stm32f2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
pathmove . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 stmsmi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
peek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 str7x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
pic32mx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 str7x disable_jtag . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
pic32mx pgm_word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 str9x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
pic32mx unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 str9x flash_config . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
pld device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 str9xpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
pld devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 str9xpec disable_turbo . . . . . . . . . . . . . . . . . . . . . . 80
pld load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 str9xpec enable_turbo . . . . . . . . . . . . . . . . . . . . . . . 80
poke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 str9xpec lock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
poll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 str9xpec options_cmap . . . . . . . . . . . . . . . . . . . . . . . 80
power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 str9xpec options_lvdsel . . . . . . . . . . . . . . . . . . . . . 80
presto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 str9xpec options_lvdthd . . . . . . . . . . . . . . . . . . . . . 80
presto_serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 str9xpec options_lvdwarn . . . . . . . . . . . . . . . . . . . . 80
profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 str9xpec options_read . . . . . . . . . . . . . . . . . . . . . . . 80
Command and Driver Index 143
str9xpec options_write . . . . . . . . . . . . . . . . . . . . . . 80 V
str9xpec part_id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 verify_image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
str9xpec unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 verify_ircapture. . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
svf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 verify_jtag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
swd newdap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
swd wcr trn prescale . . . . . . . . . . . . . . . . . . . . . . . . . 46
virt2phys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
virtex2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
T virtex2 read_stat . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
virtual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
target count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 vsllink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
target create. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
target current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
target names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 W
target number. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
wait_halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
target types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
wp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
target_request debugmsgs . . . . . . . . . . . . . . . . . . . 108
targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
tcl_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
telnet_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
X
test_image. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 xscale analyze_trace . . . . . . . . . . . . . . . . . . . . . . . 104
tms470 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 xscale cache_clean_address . . . . . . . . . . . . . . . . 104
tms470 flash_keyset . . . . . . . . . . . . . . . . . . . . . . . . . . 78 xscale cache_info . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
tms470 osc_mhz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 xscale cp15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
tms470 plldis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 xscale dcache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
trace history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 xscale debug_handler . . . . . . . . . . . . . . . . . . . . . . . 104
trace point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 xscale dump_trace . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
transport list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 xscale icache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
transport select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 xscale mmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
trunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 xscale trace_buffer . . . . . . . . . . . . . . . . . . . . . . . . 104
xscale trace_image . . . . . . . . . . . . . . . . . . . . . . . . . . 105
xscale vector_catch . . . . . . . . . . . . . . . . . . . . . . . . 105
U xscale vector_table . . . . . . . . . . . . . . . . . . . . . . . . 105
ulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 xsvf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
usb_blaster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41, 42
usb_blaster_device_desc . . . . . . . . . . . . . . . . . . . . . 41
usb_blaster_vid_pid . . . . . . . . . . . . . . . . . . . . . . . . . 41 Z
usbprog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 ZY1000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45