Openocd
Openocd
Short Contents
About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 OpenOCD Developer Resources . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Debug Adapter Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 About Jim-Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5 OpenOCD Project Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6 Config File Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7 Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8 Debug Adapter Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9 Reset Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
10 TAP Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
11 CPU Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
12 Flash Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
13 Flash Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
14 PLD/FPGA Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
15 General Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
16 Architecture and Core Commands . . . . . . . . . . . . . . . . . . . . . . 144
17 JTAG Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
18 Boundary Scan Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
19 Utility Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
20 GDB and OpenOCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
21 Tcl Scripting API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
22 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
23 Tcl Crash Course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
A The GNU Free Documentation License. . . . . . . . . . . . . . . . . . . 206
OpenOCD Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Command and Driver Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Running. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1 Simple setup, no customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2 What OpenOCD does as it starts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7 Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.1 Configuration Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.2 Entering the Run Stage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.3 TCP/IP Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.4 GDB Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.5 Event Polling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9 Reset Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
9.1 Types of Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
9.2 SRST and TRST Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
9.3 Commands for Handling Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
9.4 Custom Reset Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
iv
10 TAP Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
10.1 Scan Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
10.2 TAP Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
10.3 TAP Declaration Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
10.4 Other TAP commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
10.5 TAP Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
10.6 Enabling and Disabling TAPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
10.7 Autoprobing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
10.8 DAP declaration (ARMv6-M, ARMv7 and ARMv8 targets) . . . 71
11 CPU Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
11.1 Target List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
11.2 Target CPU Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
11.3 Target Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
11.4 Other $target name Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
11.5 Target Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
12 Flash Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
12.1 Flash Configuration Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
12.2 Preparing a Target before Flash Programming . . . . . . . . . . . . . . . . 86
12.3 Erasing, Reading, Writing to Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
12.4 Other Flash commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
12.5 Flash Driver List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
12.5.1 External Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
12.5.2 Internal Flash (Microcontrollers) . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.6 NAND Flash Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
12.6.1 NAND Configuration Commands . . . . . . . . . . . . . . . . . . . . . . . 124
12.6.2 Erasing, Reading, Writing to NAND Flash . . . . . . . . . . . . . . 125
12.6.3 Other NAND commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
12.6.4 NAND Driver List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
22 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
vii
About
OpenOCD was created by Dominic Rath as part of a 2005 diploma thesis written at the
University of Applied Sciences Augsburg (http://www.hs-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 connect directly 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 supports only 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), Cortex-M3 (Stellaris
LM3, STMicroelectronics STM32 and Energy Micro EFM32) and Intel Quark (x10xx)
based cores to be debugged via the GDB protocol.
Flash Programming: Flash writing is supported for external CFI-compatible NOR flashes
(Intel and AMD/Spansion command set) and several internal flashes (LPC1700, LPC1800,
LPC2000, LPC4300, AT91SAM7, AT91SAM3U, STR7x, STR9x, LM3, STM32x and
EFM32). Preliminary support for various NAND flash controllers (LPC3180, Orion,
S3C24xx, more) is included.
About 2
OpenOCD IRC
Support can also be found on irc: irc://irc.libera.chat/openocd
3
test, discuss and vote for changes in Gerrit. The feedback provides the basis for a maintainer
to eventually submit the change to the main Git repository.
The HACKING file, also available as the Patch Guide in the Doxygen Developer Manual,
contains basic information about how to connect a repository to Gerrit, prepare and push
patches. Patch authors are expected to maintain their changes while they’re in Gerrit,
respond to feedback and if necessary rework and push improved versions of the change.
• signalyzer
See: http://www.signalyzer.com
• Stellaris Eval Boards
See: http://www.ti.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.
• TI/Luminary ICDI
See: http://www.ti.com - TI/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 (http://www.ethernut.de/en/hardware/turtelizer/index.
html), 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
• opendous
Link http://code.google.com/p/opendous/wiki/JTAG FT2232H-based (OpenHard-
ware).
• JTAG-lock-pick Tiny 2
Link http://www.distortec.com/jtag-lock-pick-tiny-2 FT232H-based
• GW16042
Link: http://shop.gateworks.com/index.php?route=product/product&
path=70_80&product_id=64 FT2232H-based
• STLINK-V3PWR
This is available standalone. Beside the debugger functionality, the probe includes a
SMU (source measurement unit) aimed at analyzing power consumption during code
execution. The SMU is not supported by OpenOCD.
Link: http://www.st.com/stlink-v3pwr
For info the original ST-LINK enumerates using the mass storage usb class; however, its
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
• estick
Link: http://code.google.com/p/estick-jtag/
• Keil ULINK v1
Link: http://www.keil.com/ulink1/
• TI XDS110 Debug Probe
Link: https://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/
emu_xds110.html
Link: https://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/
emu_xds_software_package_download.html#xds110-support-utilities
2.12 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.
• bcm2835gpio
A BCM2835-based board (e.g. Raspberry Pi) using the GPIO pins of the expansion
header.
• imx gpio
A NXP i.MX-based board (e.g. Wandboard) using the GPIO pins (should work on any
i.MX processor).
• am335xgpio
A Texas Instruments AM335x-based board (e.g. BeagleBone Black) using the GPIO
pins of the expansion headers.
• jtag vpi
A JTAG driver acting as a client for the JTAG VPI server interface.
Link: http://github.com/fjullien/jtag_vpi
• vdebug
A driver for Cadence virtual Debug Interface to emulated or simulated targets. It
implements a client connecting to the vdebug server, which in turn communicates with
the emulated or simulated RTL model through a transactor. The driver supports JTAG
and DAP-level transports.
• jtag dpi
A JTAG driver acting as a client for the SystemVerilog Direct Programming Interface
(DPI) for JTAG devices. DPI allows OpenOCD to connect to the JTAG interface of
a hardware model written in SystemVerilog, for example, on an emulation model of
target hardware.
• xlnx pcie xvc
A JTAG driver exposing Xilinx Virtual Cable over PCI Express to OpenOCD as
JTAG/SWD interface.
• linuxgpiod
A bitbang JTAG driver using Linux GPIO through library libgpiod.
• sysfsgpio
A bitbang JTAG driver using Linux legacy sysfs GPIO. This is deprecated from Linux
v5.3; prefer using linuxgpiod.
• esp usb jtag
A JTAG driver to communicate with builtin debug modules of Espressif ESP32-C3 and
ESP32-S3 chips using OpenOCD.
11
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,
you can write Tcl programs with them.
You can learn more about Jim at its website, http://jim.tcl.tk. 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 the (older) original 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 199.
12
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. An example rules file that works for many common adapters
is shipped with OpenOCD in the contrib directory. MS-Windows needs complex and con-
fusing 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
The first found file with a matching file name will be used.
Note: Don’t try to use configuration script names or paths which include the
"#" character. That character begins Tcl comments.
Chapter 4: Running 13
6. Power up the target board. Unless you just let the magic smoke escape, you’re now
ready to set up the OpenOCD server so you can use JTAG to work with that board.
Talk with the OpenOCD server using telnet (telnet localhost 4444 on many systems) or
GDB. See Chapter 20 [GDB and OpenOCD], page 186.
When you write config files, separate the reusable parts (things every user of that interface,
chip, or board needs) from ones specific to your environment and debugging approach.
• 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_m vector_catch) can be a time-saver 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 177.)
• 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 33.
# 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
Chapter 5: OpenOCD Project Setup 18
debugger provide your system console and a file system, helping with early debugging
or providing a more capable environment for sometimes-complex tasks like installing
system firmware onto NAND or SPI flash.
• 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 177.
3
As a more polite alternative, some processors have special debug-oriented registers which can be used to
change various features including how the low power states are clocked while debugging. The STM32
DBGMCU CR register is an example; at the cost of extra power consumption, JTAG can be used during
low power states.
Chapter 5: OpenOCD Project Setup 20
Such explicit configuration is common, and not limited to booting from NAND. You
might also need to set jumpers to start booting using code loaded from an MMC/SD
card; external SPI flash; Ethernet, UART, or USB links; NOR flash; OneNAND flash;
some external host; or various other sources.
• 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.
21
OpenOCD. If you have a boot loader, its source code will help; so will configura-
tion files for other JTAG tools (see [Translating Configuration Files], page 30).
Some of this code could probably be shared between different boards. For example, setting
up a DRAM controller often doesn’t differ by much except the bus width (16 bits or 32?)
and memory timings, so a reusable TCL procedure loaded by the target.cfg file might
take those as parameters. Similarly with oscillator, PLL, and clock setup; and disabling the
watchdog. Structure the code cleanly, and provide comments to help the next developer
doing such work. (You might be that next person trying to reuse init code!)
The last thing normally done in a reset-init handler is probing whatever flash memory
was configured. For most chips that needs to be done while the associated target is halted,
either because JTAG memory access uses the CPU or to prevent conflicting CPU access.
Just as init_targets, the init_board procedure can be overridden by “next level” script
(which sources the original), allowing greater code reuse.
### board_file.cfg ###
proc enable_fast_clock {} {
# enables fast on-board clock source
# configures the chip to use it
}
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 58.
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 24.)
Chapter 6: Config File Guidelines 30
7 Server 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.
If this command does not appear in any startup/configuration file OpenOCD executes
the command for you after processing all configuration files and/or command line
options.
NOTE: This command normally occurs near the end of your openocd.cfg file to
force OpenOCD to “initialize” and make the targets ready. For example: If your
openocd.cfg file needs to read/write memory on your target, init must occur before
the memory read/write commands. This includes nand probe.
init calls the following internal OpenOCD commands to initialize corresponding
subsystems:
target init [Config Command]
transport init [Command]
dap init [Command]
flash init [Config Command]
nand init [Config Command]
pld init [Config Command]
tpiu init [Command]
At last, init executes all the commands that are specified in the TCL list
post init commands. The commands are executed in the same order they occupy in
the list. If one of the commands fails, then the error is propagated and OpenOCD
fails too.
lappend post_init_commands {echo "OpenOCD successfully initialized."}
lappend post_init_commands {echo "Have fun with OpenOCD !"}
noinit [Config Command]
Prevent OpenOCD from implicit init call at the end of startup. Allows issuing
configuration commands over telnet or Tcl connection. When you are done with
configuration use init to enter the run stage.
jtag_init [Overridable Procedure]
This is invoked at server startup to verify that it can talk to the scan chain (list of
TAPs) which has been configured.
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).
armjtagew_info [Command]
Logs some status
both a data GPIO and an output-enable GPIO can be specified for each signal. The
following output buffer configurations are supported:
− Push-pull with one FTDI output as (non-)inverted data line
− Open drain with one FTDI output as (non-)inverted output-enable
− Tristate with one FTDI output as (non-)inverted data line and another FTDI
output as (non-)inverted output-enable
− Unbuffered, using the FTDI GPIO as a tristate output directly by switching data
and direction as necessary
These interfaces have several commands, used to configure the driver before initializ-
ing the JTAG scan chain:
ftdi vid_pid [vid pid]+ [Config Command]
The vendor ID and product ID of the adapter. Up to eight [vid, pid] pairs may
be given, e.g.
ftdi vid_pid 0x0403 0xcff8 0x15ba 0x0003
ftdi device_desc description [Config Command]
Provides the USB device description (the iProduct string) of the adapter. If
not specified, the device description is ignored during device selection.
ftdi channel channel [Config Command]
Selects the channel of the FTDI device to use for MPSSE operations. Most
adapters use the default, channel 0, but there are exceptions.
ftdi layout_init data direction [Config Command]
Specifies the initial values of the FTDI GPIO data and direction registers. Each
value is a 16-bit number corresponding to the concatenation of the high and low
FTDI GPIO registers. The values should be selected based on the schematics
of the adapter, such that all signals are set to safe levels with minimal impact
on the target system. Avoid floating inputs, conflicting outputs and initially
asserted reset signals.
ftdi layout_signal name [-data|-ndata data mask] [Command]
[-input|-ninput input mask] [-oe|-noe oe mask]
[-alias|-nalias name]
Creates a signal with the specified name, controlled by one or more FTDI
GPIO pins via a range of possible buffer connections. The masks are FTDI
GPIO register bitmasks to tell the driver the connection and type of the output
buffer driving the respective signal. data mask is the bitmask for the pin(s)
connected to the data input of the output buffer. -ndata is used with inverting
data inputs and -data with non-inverting inputs. The -oe (or -noe) option
tells where the output-enable (or not-output-enable) input to the output buffer
is connected. The options -input and -ninput specify the bitmask for pins to
be read with the method ftdi get_signal.
Both data mask and oe mask need not be specified. For example, a simple
open-collector transistor driver would be specified with -oe only. In that case
the signal can only be set to drive low or to Hi-Z and the driver will complain
Chapter 8: Debug Adapter Configuration 42
if the signal is set to drive high. Which means that if it’s a reset signal, reset_
config must be specified as srst_open_drain, not srst_push_pull.
A special case is provided when -data and -oe is set to the same bitmask. Then
the FTDI pin is considered being connected straight to the target without any
buffer. The FTDI pin is then switched between output and input as necessary
to provide the full set of low, high and Hi-Z characteristics. In all other cases,
the pins specified in a signal definition are always driven by the FTDI.
If -alias or -nalias is used, the signal is created identical (or with data
inverted) to an already specified signal name.
For example adapter definitions, see the configuration files shipped in the
interface/ftdi directory.
User can change default pinout by supplying configuration commands with GPIO
numbers or RS232 signal names. GPIO numbers correspond to bit numbers in FTDI
GPIO register. They differ from physical pin numbers. For details see actual FTDI
chip datasheets. Every JTAG line must be configured to unique GPIO number dif-
ferent than any other JTAG line, even those lines that are sometimes not used like
TRST or SRST.
FT232R
− bit 7 - RI
− bit 6 - DCD
− bit 5 - DSR
− bit 4 - DTR
− bit 3 - CTS
− bit 2 - RTS
− bit 1 - RXD
− bit 0 - TXD
These interfaces have several commands, used to configure the driver before initializ-
ing the JTAG scan chain:
state: 0x15 for TXD RTS DTR as outputs (1), others as inputs (0). Higher
byte is usually 0 to disable bitbang mode. When kernel driver reattaches, serial
port should continue to work. Value 0xFFFF disables sending control word
and serial port, then kernel driver will not reattach. If not specified, default
0xFFFF is used.
remote_bitbang [Interface Driver]
Drive JTAG and SWD 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 and SWD.
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.
remote_bitbang use_remote_sleep (on|off) [Config Command]
If this option is enabled, delays will not be executed locally but instead for-
warded to the remote host. This is useful if the remote host performs its own
request queuing rather than executing requests immediately.
This is disabled by default. This option must only be enabled if the given
remote bitbang host supports receiving the delay information.
For example, to connect remotely via TCP to the host foobar you might have some-
thing like:
adapter driver remote_bitbang
remote_bitbang port 3335
remote_bitbang host foobar
And if you also wished to enable remote sleeping:
adapter driver remote_bitbang
remote_bitbang port 3335
remote_bitbang host foobar
remote_bitbang use_remote_sleep on
To connect to another process running locally via UNIX sockets with socket named
mysocket:
adapter driver 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:
Chapter 8: Debug Adapter Configuration 45
the ADC sampling of the reference voltage 1.2V and the last 4 bytes represent
the ADC sampling of half the target’s supply voltage.
> st-link cmd 8 0xf7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0xf1 0x05 0x00 0x00 0x0b 0x08 0x00 0x00
The result can be converted to Volts (ignoring the most significant bytes, always
zero)
> set a [st-link cmd 8 0xf7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
> set n [expr {[lindex $a 4] + 256 * [lindex $a 5]}]
> set d [expr {[lindex $a 0] + 256 * [lindex $a 1]}]
> echo [expr {2 * 1.2 * $n / $d}]
3.24891518738
swd) or [st link dap interface], page 50, (in which case the command is transport select
dapdirect_swd).
The newer SWD devices (SW-DP v2 or SWJ-DP v2) support the multi-drop extension of
SWD protocol: two or more devices can be connected to one SWD adapter. SWD transport
works in multi-drop mode if [dap create], page 71, is configured with both -dp-id and
-instance-id parameters regardless how many DAPs are created.
Not all adapters and adapter drivers support SWD multi-drop. Only the following adapter
drivers are SWD multi-drop capable: cmsis dap (use an adapter with CMSIS-DAP version
2.0), ftdi, all bitbang based.
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 speed, 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 58.) 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.
reset_config signals options to say when either of those signals is not connected.
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 requirements
that all reset pulses last for at least a certain amount of time; and reset buttons
commonly have hardware debouncing. Use the adapter srst 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.
support this feature, STM32 and STR9 are examples. This feature is useful if
you are unable to connect to your target due to incorrect options byte config or
illegal program execution.
The optional trst type and srst type parameters allow the driver mode of each reset
line to be specified. These values only affect JTAG interfaces with support for different
driver modes, like the Amontec JTAGkey and JTAG Accelerator. Also, they are
necessarily ignored if the relevant signal (TRST or SRST) is not connected.
• 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
power-up 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 Programming Some chips program the flash directly via JTAG. Others do it
indirectly, 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 STMicroelectronics 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 typically use a variable such as $_CHIPNAME instead of literals like str912,
to support more than one chip of each type. See Chapter 6 [Config File Guidelines], page 21.
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.
• -ignore-syspwrupack
Specify this to ignore the CSYSPWRUPACK bit in the ARM DAP DP
CTRL/STAT register during initial examination and when checking the sticky
error bit. This bit is normally checked after setting the CSYSPWRUPREQ bit,
but some devices do not set the ack bit until sometime later.
• -ir-bypass NUMBER
Vendor specific bypass instruction, required by some hierarchical JTAG routers
where the normal BYPASS instruction bypasses the whole router and a vendor
specific bypass instruction is required to access child nodes.
• tap-enable
The TAP needs to be enabled. This handler should implement jtag tapenable by
issuing the relevant JTAG commands.
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
}
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
Chapter 10: TAP Declaration 71
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.
Use value only syntax if you want to set the new CSW pattern as a whole. The
example sets HPROT1 bit (required by Cortex-M) and clears the rest of the pattern:
kx.dap apcsw 0x2000000
If mask is also used, the CSW pattern is changed only on bit positions where the
mask bit is 1. The following example sets HPROT3 (cacheable) and leaves the rest
of the pattern intact. It configures memory access through DCache on Cortex-M7.
set CSW_HPROT3_CACHEABLE [expr {1 << 27}]
samv.dap apcsw $CSW_HPROT3_CACHEABLE $CSW_HPROT3_CACHEABLE
Another example clears SPROT bit and leaves the rest of pattern intact:
set CSW_SPROT [expr {1 << 30}]
samv.dap apcsw 0 $CSW_SPROT
Note: If you want to check the real value of CSW, not CSW pattern, use xxx.dap
apreg 0. See [DAP subcommand apreg], page 72.
Warning: Some of the CSW bits are vital for working memory transfer. If you set a
wrong CSW pattern and MEM-AP stopped working, use the following example with
a proper dap name:
xxx.dap apcsw default
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 144,
and [Target State handling], page 136) 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.
The two main things to configure after target creation are a work area, which usually has
target-specific defaults even if the board setup code overrides them later; and event handlers
(see [Target Events], page 81), which tend to be much more board-specific. The key steps
you use might look something like this
dap create mychip.dap -chain-position mychip.cpu
target create MyTarget cortex_m -dap mychip.dap
MyTarget configure -work-area-phys 0x08000 -work-area-size 8096
MyTarget configure -event reset-deassert-pre { jtag_rclk 5 }
MyTarget configure -event reset-init { myboard_reinit }
You should specify a working area if you can; typically it uses some on-chip SRAM. Such
a working area can speed up many things, including bulk writes to target memory; flash
operations like checking to see if memory needs to be erased; GDB memory checksumming;
and more.
Warning: On more complex chips, the work area can become inaccessible when
application code (such as an operating system) enables or disables the MMU.
For example, the particular MMU context used to access the virtual address
will probably matter ... and that context might not have easy access to other
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... [Config 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 75.
• configparams ... all parameters accepted by $target_name configure are per-
mitted. If the target is big-endian, set it here with -endian big.
You must set the -chain-position dotted.name or -dap dap_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.
• -chain-position dotted.name – names the TAP used to access this target.
Chapter 11: CPU Configuration 78
• -dap dap name – names the DAP used to access this target. See [DAP declara-
tion], page 71, on how to create and manage DAP instances.
• -endian (big|little) – specifies whether the CPU uses big or little endian
conventions
• -event event name event body – See [Target Events], page 81. 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.
Current target is temporarily overridden to the event issuing target before handler
code starts and switched back after handler is done.
• -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.
• -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,
none, eCos, ThreadX, FreeRTOS, linux, ChibiOS, embKernel, mqx, uCOS-III,
nuttx, RIOT, Zephyr, rtkernel See [RTOS Support], page 189.
• -defer-examine – skip target examination at initial JTAG chain scan and after a
reset. A manual call to arp examine is required to access the target for debugging.
• -ap-num ap number – set DAP access port for target. On ADIv5 DAP
ap number is the numeric index of the DAP AP the target is connected to.
On ADIv6 DAP ap number is the base address of the DAP AP the target is
connected to. Use this option with systems where multiple, independent cores
are connected to separate access ports of the same DAP.
• -cti cti name – set Cross-Trigger Interface (CTI) connected to the target. Cur-
rently, only the aarch64 target makes use of this option, where it is a mandatory
configuration for the target run control. See [ARM Cross-Trigger Interface],
page 147, for instruction on how to declare and control a CTI instance.
• -gdb-port number – see command gdb_port for the possible values of the pa-
rameter number, which are not only numeric values. Use this option to override,
for this target only, the global parameter set with command gdb_port. See
[command gdb port], page 33.
• -gdb-max-connections number – EXPERIMENTAL: set the maximum number
of GDB connections that are allowed for the target. Default is 1. A negative value
for number means unlimited connections. See See [Using GDB as a non-intrusive
memory inspector], page 188.
Chapter 11: CPU Configuration 79
The programmer’s model matches the -command option used in Tcl/Tk buttons and events.
The two examples below act the same, but one creates and invokes a small procedure while
the other inlines it.
proc my_init_proc { } {
echo "Disabling watchdog..."
mww 0xfffffd44 0x00008000
}
mychip.cpu configure -event reset-init my_init_proc
mychip.cpu configure -event reset-init {
echo "Disabling watchdog..."
mww 0xfffffd44 0x00008000
}
The following target events are defined:
• debug-halted
The target has halted for debug reasons (i.e.: breakpoint)
• debug-resumed
The target has resumed (i.e.: GDB said run)
• early-halted
Occurs early in the halt process
• examine-start
Before target examine is called.
• examine-end
After target examine is called with no errors.
• examine-fail
After target examine fails.
• gdb-attach
When GDB connects. Issued before any GDB communication with the target starts.
GDB expects the target is halted during attachment. See [GDB as a non-intrusive
memory inspector], page 188, how to connect GDB to running target. The event
can be also used to set up the target so it is possible to probe flash. Probing flash
is necessary during GDB connect if you want to use see [programming using GDB],
page 188. Another use of the flash memory map is for GDB to automatically choose
hardware or software breakpoints depending on whether the breakpoint is in RAM or
read only memory. Default is halt
• 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 (default is reset init)
• gdb-flash-erase-end
After the GDB flash process has finished erasing the flash
• gdb-flash-write-start
Before GDB writes to the flash
Chapter 11: CPU Configuration 83
• gdb-flash-write-end
After GDB writes to the flash (default is reset halt)
• 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-start was triggered but before either
SRST alone is 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 the first step in reset processing before reset-assert-pre is called.
This is the most robust place to use jtag_rclk or adapter speed 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
• step-start
Before a target is single-stepped
Chapter 11: CPU Configuration 84
• step-end
After single-step has completed
• trace-config
After target hardware trace configuration was changed
• semihosting-user-cmd-0x100
The target made a semihosting call with user-defined operation number 0x100
• semihosting-user-cmd-0x101
The target made a semihosting call with user-defined operation number 0x101
• semihosting-user-cmd-0x102
The target made a semihosting call with user-defined operation number 0x102
• semihosting-user-cmd-0x103
The target made a semihosting call with user-defined operation number 0x103
• semihosting-user-cmd-0x104
The target made a semihosting call with user-defined operation number 0x104
• semihosting-user-cmd-0x105
The target made a semihosting call with user-defined operation number 0x105
• semihosting-user-cmd-0x106
The target made a semihosting call with user-defined operation number 0x106
• semihosting-user-cmd-0x107
The target made a semihosting call with user-defined operation number 0x107
Note: OpenOCD events are not supposed to be preempt by another event, but
this is not enforced in current code. Only the target event resumed is executed
with polling disabled; this avoids polling to trigger the event halted, reversing
the logical order of execution of their handlers. Future versions of OpenOCD
will prevent the event preemption and will disable the schedule of polling during
the event execution. Do not rely on polling in any event handler; this means,
don’t expect the status of a core to change during the execution of the handler.
The event handler will have to enable polling or use $target_name arp_poll
to check if the core has changed status.
85
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 34.
Many CPUs have the ability 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.
flash banks [Command]
Prints a one-line summary of each device that was declared using flash bank, num-
bered from zero. Note that this is the plural form; the singular form is a very different
command.
flash list [Command]
Retrieves a list of associative arrays for each device that was declared using flash
bank, numbered from zero. This returned list can be manipulated easily from within
scripts.
flash probe num [Command]
Identify the flash, or validate the parameters of the configured flash. Operation
depends on the flash type. The num parameter is a value shown by flash banks.
Most flash commands will implicitly autoprobe the bank; flash drivers can distinguish
between probing and autoprobing, but most don’t bother.
Some flash chips implement software protection against accidental writes, since such buggy
writes could in some cases “brick” a system. For such systems, erasing and writing may
require sector protection to be disabled first. Examples include CFI flash such as “Intel
Advanced Bootblock flash”, and AT91SAM7 on-chip flash. See [flash protect], page 89.
flash erase_sector num first last [Command]
Erase sectors in bank num, starting at sector first up to and including last. Sector
numbering starts at 0. Providing a last sector of last specifies "to the end of the
flash bank". The num parameter is a value shown by flash banks.
flash erase_address [pad] [unlock] address length [Command]
Erase sectors starting at address for length bytes. Unless pad is specified, address
must begin a flash sector, and address + length − 1 must end a sector. Specifying
pad erases extra data at the beginning and/or end of the specified region, as needed
to erase only full sectors. The flash bank to use is inferred from the address, and the
specified length must stay within that bank. As a special case, when length is zero
and address is the start of the bank, the whole flash is erased. If unlock is specified,
then the flash is unprotected before erase starts.
flash filld address double-word length [Command]
flash fillw address word length [Command]
flash fillh address halfword length [Command]
flash fillb address byte length [Command]
Fills flash memory with the specified double-word (64 bits), word (32 bits), halfword
(16 bits), or byte (8-bit) pattern, starting at address and continuing for length units
(word/halfword/byte). No erasure is done before writing; when needed, that must be
done before issuing this command. Writes are done in blocks of up to 1024 bytes, and
each write is verified by reading back the data and comparing it to what was written.
The flash bank to use is inferred from the address of each block, and the specified
length must stay within that bank.
flash mdw addr [count] [Command]
flash mdh addr [count] [Command]
flash mdb addr [count] [Command]
Display contents of address addr, as 32-bit words (mdw), 16-bit halfwords (mdh), or
8-bit bytes (mdb). If count is specified, displays that many units. Reads from flash
using the flash driver, therefore it enables reading from a bank not mapped in target
address space. The flash bank to use is inferred from the address of each block, and
the specified length must stay within that bank.
flash write_bank num filename [offset] [Command]
Write the binary filename to flash bank num, starting at offset bytes from the be-
ginning of the bank. If offset is omitted, start at the beginning of the flash bank. The
num parameter is a value shown by flash banks.
flash read_bank num filename [offset [length]] [Command]
Read length bytes from the flash bank num starting at offset and write the contents to
the binary filename. If offset is omitted, start at the beginning of the flash bank. If
length is omitted, read the remaining bytes from the flash bank. The num parameter
is a value shown by flash banks.
Chapter 12: Flash Commands 88
The num parameter is a value shown by flash banks. This command will first query
the hardware, it does not print cached and possibly stale information.
“write protect” pin on the flash chip. The CFI driver can use a target-specific working
area to significantly speed up operation.
The CFI driver can accept the following optional parameters, in any order:
• jedec probe ... is used to detect certain non-CFI flash ROMs, like AM29LV010
and similar types.
• x16 as x8 ... when a 16-bit flash is hooked up to an 8-bit bus.
• bus swap ... when data bytes in a 16-bit flash needs to be swapped.
• data swap ... when data bytes in a 16-bit flash needs to be swapped when writing
data values (i.e. not CFI commands).
To configure two adjacent banks of 16 MBytes each, both sixteen bits (two bytes)
wide on a sixteen bit bus:
flash bank $_FLASHNAME cfi 0x00000000 0x01000000 2 2 $_TARGETNAME
flash bank $_FLASHNAME cfi 0x01000000 0x01000000 2 2 $_TARGETNAME
To configure one bank of 32 MBytes built from two sixteen bit (two byte) wide parts
wired in parallel to create a thirty-two bit (four byte) bus with doubled throughput:
flash bank $_FLASHNAME cfi 0x00000000 0x02000000 2 4 $_TARGETNAME
jtagspi [Flash Driver]
Several FPGAs and CPLDs can retrieve their configuration (bitstream) from a SPI
flash connected to them. To access this flash from the host, some FPGA device pro-
vides dedicated JTAG instructions, while other FPGA devices should be programmed
with a special proxy bitstream that exposes the SPI flash on the device’s JTAG in-
terface. The flash can then be accessed through JTAG.
Since signalling between JTAG and SPI is compatible, all that is required for a proxy
bitstream is to connect TDI-MOSI, TDO-MISO, TCK-CLK and activate the flash
chip select when the JTAG state machine is in SHIFT-DR.
Such a bitstream for several Xilinx FPGAs can be found in contrib/loaders/flash/fpga/xilinx_
bscan_spi.py. It requires migen (https://github.com/m-labs/migen) and a
Xilinx toolchain to build.
This mechanism with a proxy bitstream can also be used for FPGAs from Intel and
Efinix. FPGAs from Lattice and Cologne Chip have dedicated JTAG instructions and
procedure to connect the JTAG to the SPI signals and don’t need a proxy bitstream.
Support for these devices with dedicated procedure is provided by the pld drivers.
For convenience the PLD drivers will provide the USERx code for FPGAs with a
proxy bitstream. Currently the following PLD drivers are able to support jtagspi:
• Efinix: proxy-bitstream
• Gatemate: dedicated procedure
• Intel/Altera: proxy-bitstream
• Lattice: dedicated procedure supporting ECP2, ECP3, ECP5, Certus and Certus
Pro devices
• AMD/Xilinx: proxy-bitstream
This flash bank driver requires a target on a JTAG tap and will access that tap
directly. Since no support from the target is needed, the target can be a "testee"
Chapter 12: Flash Commands 91
dummy. Since the target does not expose the flash memory mapping, target com-
mands that would otherwise be expected to access the flash will not work. These
include all *_image and $target_name m* commands as well as program. Equiva-
lent functionality is available through the flash write_bank, flash read_bank, and
flash verify_bank commands.
According to device size, 1- to 4-byte addresses are sent. However, some flash chips
additionally have to be switched to 4-byte addresses by an extra command, see below.
• ir ... is loaded into the JTAG IR to map the flash as the JTAG DR. For the
bitstreams generated from xilinx_bscan_spi.py this is the USER1 instruction.
target create $_TARGETNAME testee -chain-position $_CHIPNAME.tap
set _USER1_INSTR_CODE 0x02
flash bank $_FLASHNAME jtagspi 0x0 0 0 0 \
$_TARGETNAME $_USER1_INSTR_CODE
• The option -pld name is used to have support from the PLD driver of pld device
name. The name is the name of the pld device given during creation of the pld
device. Pld device names are shown by the pld devices command.
target create $_TARGETNAME testee -chain-position $_CHIPNAME.tap
set _JTAGSPI_CHAIN_ID $_CHIPNAME.pld
flash bank $_FLASHNAME jtagspi 0x0 0 0 0 \
$_TARGETNAME -pld $_JTAGSPI_CHAIN_ID
jtagspi set bank id name total size page size read cmd [Command]
unused pprg cmd mass erase cmd sector size sector erase cmd
Sets flash parameters: name human readable string, total size size in bytes,
page size is write page size. read cmd and pprg cmd are commands for
read and page program, respectively. mass erase cmd, sector size and
sector erase cmd are optional.
jtagspi set 0 w25q128 0x1000000 0x100 0x03 0 0x02 0xC7 0x10000 0xD8
jtagspi cmd bank id resp num cmd byte ... [Command]
Sends command cmd byte and at most 20 following bytes and reads resp num
bytes afterwards. E.g. for ’Enter 4-byte address mode’
jtagspi cmd 0 0 0xB7
jtagspi always_4byte bank id [ on | off ] [Command]
Some devices use 4-byte addresses for all commands except the legacy 0x03
read regardless of device size. This command controls the corresponding hack.
xcf [Flash Driver]
Xilinx FPGAs can be configured from specialized flash ICs named Platform Flash. It
is (almost) regular NOR flash with erase sectors, program pages, etc. The only differ-
ence is special registers controlling its FPGA specific behavior. They must be properly
configured for successful FPGA loading using additional xcf driver command:
xcf ccb <bank id> [Command]
command accepts additional parameters:
• external|internal ... selects clock source.
Chapter 12: Flash Commands 92
stmqspi set bank id name total size page size read cmd [Command]
fread cmd pprg cmd mass erase cmd sector size sector erase cmd
Set flash parameters: name human readable string, total size size in bytes,
page size is write page size. read cmd, fread cmd and pprg cmd are commands
for reading and page programming. fread cmd is used in DPI and QPI modes,
read cmd in normal SPI (single line) mode. mass erase cmd, sector size and
sector erase cmd are optional.
This command is required if chip id is not hardcoded yet and e.g. for EEPROMs
or FRAMs which don’t support an id command.
In dual mode parameters of both chips are set identically. The parameters refer
to a single chip, so the whole bank gets twice the specified capacity etc.
All Apollo chips have two flash banks of the same size. In all cases the first flash bank
starts at location 0, and the second bank starts after the first.
# Flash bank 0
flash bank $_FLASHNAME ambiqmicro 0 0x00040000 0 0 $_TARGETNAME
# Flash bank 1 - same size as bank0, starts after bank 0.
flash bank $_FLASHNAME ambiqmicro 0x00040000 0x00040000 0 0 \
$_TARGETNAME
Flash is programmed using custom entry points into the bootloader. This is the only
way to program the flash as no flash control registers are available to the user.
The ambiqmicro driver adds some additional commands:
are written immediately but only take effect on MCU reset. EEPROM emu-
lation requires additional firmware support and the minimum EEPROM size
may not be the same as the minimum that the hardware supports. Set the
EEPROM size to 0 in order to disable this feature.
at91samd eeprom
at91samd eeprom 1024
at91samd bootloader [Command]
Shows or sets the bootloader size configuration, stored in the User Row of the
Flash. This is called the BOOTPROT region. When setting, the bootloader size
must be specified in bytes and it must be one of the permitted sizes according
to the datasheet. Settings are written immediately but only take effect on MCU
reset. Setting the bootloader size to 0 disables bootloader protection.
at91samd bootloader
at91samd bootloader 16384
at91samd dsu_reset_deassert [Command]
This command releases internal reset held by DSU and prepares reset vector
catch in case of reset halt. Command is used internally in event reset-deassert-
post.
at91samd nvmuserrow [Command]
Writes or reads the entire 64 bit wide NVM user row register which is located at
0x804000. This register includes various fuses lock-bits and factory calibration
data. Reading the register is done by invoking this command without any
arguments. Writing is possible by giving 1 or 2 hex values. The first argument
is the register value to be written and the second one is an optional changemask.
Every bit which value in changemask is 0 will stay unchanged. The lock- and
reserved-bits are masked out and cannot be changed.
# Read user row
>at91samd nvmuserrow
NVMUSERROW: 0xFFFFFC5DD8E0C788
# Write 0xFFFFFC5DD8E0C788 to user row
>at91samd nvmuserrow 0xFFFFFC5DD8E0C788
# Write 0x12300 to user row but leave other bits and low
# byte unchanged
>at91samd nvmuserrow 0x12345 0xFFF00
at91sam3 [Flash Driver]
All members of the AT91SAM3 microcontroller family from Atmel include internal
flash and use ARM’s Cortex-M3 core. The driver currently (6/22/09) recognizes the
AT91SAM3U[1/2/4][C/E] chips. Note that the driver was orginaly developed and
tested using the AT91SAM3U4E, using a SAM3U-EK eval board. Support for other
chips in the family was cribbed from the data sheet. Note to future readers/updaters:
Please remove this worrisome comment after other chips are confirmed.
The AT91SAM3U4[E/C] (256K) chips have two flash banks; most other chips have
one flash bank. In all cases the flash banks are at the following fixed locations:
# Flash bank 0 - all chips
Chapter 12: Flash Commands 98
nal flash memory. The driver automatically recognizes these chips using the chip
identification registers, and autoconfigures itself.
flash bank $_FLASHNAME bluenrg-x 0 0 0 0 $_TARGETNAME
Note that when users ask to erase all the sectors of the flash, a mass erase command
is used which is faster than erasing each single sector one by one.
flash erase_sector 0 0 last # It will perform a mass erase
Triggering a mass erase is also useful when users want to disable readout protection.
• -sim-base addr ... base of System Integration Module where chip identification
resides. Driver tries known locations if option is omitted.
flash bank $_FLASHNAME kinetis 0 0 0 0 $_TARGETNAME
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 preceded
by a successful call to the password command:
flash info 0
#0 : lpc2900 at 0x20000000, size 0x000c0000, (...)
# 0: 0x00000000 (0x2000 8kB) not protected
# 1: 0x00002000 (0x2000 8kB) protected
# 2: 0x00004000 (0x2000 8kB) not protected
${TARGET}.cm0
flash bank super_flash_user_cm0 psoc6 0x16000800 0 0 0 \
${TARGET}.cm0
flash bank super_flash_nar_cm0 psoc6 0x16001A00 0 0 0 \
${TARGET}.cm0
flash bank super_flash_key_cm0 psoc6 0x16005A00 0 0 0 \
${TARGET}.cm0
flash bank super_flash_toc2_cm0 psoc6 0x16007C00 0 0 0 \
${TARGET}.cm0
The internal bootloader stored in ROM is in charge of loading and verifying the image
from flash, or enter ISP mode. The programmed image must start at the beginning of
the flash and contain a valid header and a matching CRC32 checksum. Additionally,
the image header contains a "Code Read Protection" (CRP) word which indicates
whether SWD access is enabled, as well as whether ISP mode is enabled. Therefore,
it is possible to program an image that disables SWD and ISP making it impossible
to program another image in the future through these interfaces, or even debug the
current image. While this is a valid use case for production deployments where the
chips are locked down, by default this driver doesn’t allow such images that disable
the SWD interface. To program such images see the qn908x allow_brick command.
Apart from the CRP field which is located in the image header, the last page of
the flash memory contains a "Flash lock and protect" descriptor which allows to
individually protect each 2 KiB page, as well as disabling SWD access to the flash and
RAM. If this access is disabled it is not possible to read, erase or program individual
pages from the SWD interface or even access the read-only "Flash information page"
with information about the bootloader version and flash size. However when this
protection is in place, it is still possible to mass erase the whole chip and then program
a new image, for which you can use the qn908x mass_erase.
Example:
flash bank $FLASHNAME qn908x 0x01000000 0 0 0 $TARGETNAME calc_checksum
Parameters:
• calc_checksum optional parameter to compute the required checksum of the first
bytes in the vector table.
Note: If the checksum in the header of your image is invalid and
you don’t provide the calc_checksum option the boot ROM will not
boot your image and it may render the flash inaccessible. On the
other hand, if you use this option to compute the checksum keep in
mind that verify_image will fail on those four bytes of the checksum
since those bytes in the flash will have the updated checksum.
Note that some devices have been found that have a flash size register that contains
an invalid value, to workaround this issue you can override the probed value used by
the flash driver.
flash bank $_FLASHNAME stm32f1x 0 0x20000 0 0 $_TARGETNAME
If you have a target with dual flash banks then define the second bank as per the
following example.
flash bank $_FLASHNAME stm32f1x 0x08080000 0 0 0 $_TARGETNAME
Some stm32f1x-specific commands are defined:
If you use OTP (One-Time Programmable) memory define it as a second bank as per
the following example.
flash bank $_FLASHNAME stm32f2x 0x1FFF7800 0 0 0 $_TARGETNAME
Note that some devices have been found that have a flash size register that contains
an invalid value, to workaround this issue you can override the probed value used by
the flash driver.
flash bank $_FLASHNAME stm32f2x 0 0x20000 0 0 $_TARGETNAME
Some stm32f2x-specific commands are defined:
Note that some devices have been found that have a flash size register that contains
an invalid value, to workaround this issue you can override the probed value used by
the flash driver.
flash bank $_FLASHNAME stm32h7x 0 0x20000 0 0 $_TARGETNAME
Some stm32h7x-specific commands are defined:
Note that some devices have been found that have a flash size register that contains
an invalid value, to workaround this issue you can override the probed value used by
the flash driver. If you use 0 as the bank base address, it tells the driver to autodetect
the bank location assuming you’re configuring the second bank.
flash bank $_FLASHNAME stm32lx 0x08000000 0x20000 0 0 $_TARGETNAME
Some stm32lx-specific commands are defined:
Note that some devices have been found that have a flash size register that contains
an invalid value, to workaround this issue you can override the probed value used by
the flash driver. However, specifying a wrong value might lead to a completely wrong
flash layout, so this feature must be used carefully.
flash bank $_FLASHNAME stm32l4x 0x08000000 0x40000 0 0 $_TARGETNAME
Some stm32l4x-specific commands are defined:
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
adapter assert srst
# 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 re-
member 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.
Several str9xpec-specific commands are defined:
str9xpec disable_turbo num [Command]
Restore the str9 into JTAG chain.
str9xpec enable_turbo num [Command]
Enable turbo mode, will simply remove the str9 from the chain and talk directly
to the embedded flash controller.
str9xpec lock num [Command]
Lock str9 device. The str9 will only respond to an unlock command that will
erase the device.
str9xpec part_id num [Command]
Prints the part identifier for bank num.
str9xpec options_cmap num (bank0|bank1) [Command]
Configure str9 boot bank.
str9xpec options_lvdsel num (vdd|vdd_vddq) [Command]
Configure str9 lvd source.
str9xpec options_lvdthd num (2.4v|2.7v) [Command]
Configure str9 lvd threshold.
str9xpec options_lvdwarn bank (vdd|vdd_vddq) [Command]
Configure str9 lvd reset warning source.
str9xpec options_read num [Command]
Read str9 option bytes.
Chapter 12: Flash Commands 123
NOTE: At the time this text was written, the largest NAND flash fully supported by
OpenOCD is 2 GiBytes (16 GiBits). This is because the variables used to hold offsets and
lengths are only 32 bits wide. (Larger chips may work in some cases, unless an offset or
length is larger than 0xffffffff, the largest 32-bit unsigned integer.) Some larger devices
will work, since they are actually multi-chip modules with two smaller chips and individual
chipselect lines.
By default, only page data is saved to the specified file. Use an oob option parameter
to save OOB data:
• 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 access 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.
Chapter 12: Flash Commands 127
• oob_raw
File interleaves data and OOB data, both of which are written If raw access is
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.
nand verify num filename offset [option...] [Command]
Verify the binary data in the file has been programmed to the specified NAND device,
starting at the specified offset. 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 read and compared to the contents of the flash, assuming it doesn’t run past
the end of the device. As with nand write, only full pages are verified, so any extra
space in the last page will be filled with 0xff bytes.
The same options accepted by nand write, and the file will be processed similarly to
produce the buffers that can be compared against the contents produced from nand
dump.
NOTE: This will not work when the underlying NAND controller driver’s write_
page routine must update the OOB with a hardware-computed ECC before the data
is written. This limitation may be removed in a future release.
For the next two commands, it is assumed that the pins have already been properly
configured for input or output.
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.
13 Flash Programming
OpenOCD implements numerous ways to program the target flash, whether internal or ex-
ternal. Programming can be achieved by either using [Programming using GDB], page 188,
or using the commands given in [Flash Programming Commands], page 86.
To simplify using the flash commands directly a jimtcl script is available that handles
the programming and verify stage. OpenOCD will program/verify/reset the target and
optionally shutdown.
The script is executed as follows and by default the following actions will be performed.
1. ’init’ is executed.
2. ’reset init’ is called to reset and halt the target, any ’reset init’ scripts are executed.
3. flash write_image is called to erase and write any flash using the filename given.
4. If the preverify parameter is given, the target is "verified" first and only flashed if
this fails.
5. verify_image is called if verify parameter is given.
6. reset run is called if reset parameter is given.
7. OpenOCD is shutdown if exit parameter is given.
An example of usage is given below. See [program], page 89.
# program and verify using elf/hex/s19. verify and reset
# are optional parameters
openocd -f board/stm32f3discovery.cfg \
-c "program filename.elf verify reset exit"
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 create pld name driver name -chain-position tap name [Config Command]
[driver options]
Creates a new PLD device, supported by driver driver name, assigning pld name for
further reference. -chain-position tap name names the TAP used to access this
target. 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 programmatically, 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 6666.
It is possible to specify, in the TCL list pre shutdown commands , a set of commands
to be automatically executed before shutdown , e.g.:
lappend pre_shutdown_commands {echo "Goodbye, my friend ..."}
lappend pre_shutdown_commands {echo "see you soon !"}
The commands in the list will be executed (in the same order they occupy in the list)
before OpenOCD exits. If one of the commands in the list fails, then the remaining
commands are not executed anymore while OpenOCD will proceed to quit.
With both number/name and value: set register’s value. Writes may be held in a
writeback cache internal to OpenOCD, so that setting the value marks the register as
dirty instead of immediately flushing that value. Resuming CPU execution (including
by single stepping) or otherwise activating the relevant module will flush such values.
Cores may have surprisingly many registers in their Debug and trace infrastructure:
> reg
===== ARM registers
(0) r0 (/32): 0x0000D3C2 (dirty)
(1) r1 (/32): 0xFD61F31C
(2) r2 (/32)
...
(164) ETM_contextid_comparator_mask (/32)
>
set_reg dict [Command]
Set register values of the target.
• dict ... Tcl dictionary with pairs of register names and values.
For example, the following command sets the value 0 to the program counter (pc)
register and 0x1000 to the stack pointer (sp) register:
set_reg {pc 0 sp 0x1000}
get_reg [-force] list [Command]
Get register values from the target and return them as Tcl dictionary with pairs
of register names and values. If option "-force" is set, the register values are read
directly from the target, bypassing any caching.
• list ... List of register names
For example, the following command retrieves the values from the program counter
(pc) and stack pointer (sp) register:
get_reg {pc sp}
write_memory address width data [’phys’] [Command]
This function provides an efficient way to write to the target memory from a Tcl
script.
• address ... target memory address
• width ... memory access bit size, can be 8, 16, 32 or 64
• data ... Tcl list with the elements to write
• [’phys’] ... treat the memory address as physical instead of virtual address
For example, the following command writes two 32 bit words into the target memory
at address 0x20000000:
write_memory 0x20000000 32 {0xdeadbeef 0x00230500}
read_memory address width count [’phys’] [Command]
This function provides an efficient way to read the target memory from a Tcl script.
A Tcl list containing the requested memory elements is returned by this function.
• address ... target memory address
Chapter 15: General Commands 138
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 60.
− run Let the target run
Chapter 15: General Commands 139
The data transfer between host and target device is organized through unidirectional
up/down-channels for target-to-host and host-to-target communication, respectively.
Note: The current implementation does not respect channel buffer flags. They
are used to determine what happens when writing to a full buffer, for example.
Channels are exposed via raw TCP/IP connections. One or more RTT servers can be
assigned to each channel to make them accessible to an unlimited number of TCP/IP
connections.
rtt setup address size ID [Command]
Configure RTT for the currently selected target. Once RTT is started, OpenOCD
searches for a control block with the identifier ID starting at the memory address
address within the next size bytes.
rtt start [Command]
Start RTT. If the control block location is not known, OpenOCD starts searching for
it.
rtt stop [Command]
Stop RTT.
rtt polling_interval [interval] [Command]
Display the polling interval. If interval is provided, set the polling interval. The
polling interval determines (in milliseconds) how often the up-channels are checked
for new data.
rtt channels [Command]
Display a list of all channels and their properties.
rtt channellist [Command]
Return a list of all channels and their properties as Tcl list. The list can be manipu-
lated easily from within scripts.
rtt server start port channel [message] [Command]
Start a TCP server on port for the channel channel. When message is not empty, it
will be sent to a client when it connects.
rtt server stop port [Command]
Stop the TCP sever with port port.
The following example shows how to setup RTT using the SEGGER RTT implementation
on the target device.
resume
Several of the parameters must reflect the trace port capabilities, which are a func-
tion of silicon capabilities (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 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.
cti create cti name -dap dap name -ap-num apn -baseaddr [Command]
base address
Creates a CTI instance cti name on the DAP instance dap name on MEM-AP apn.
On ADIv5 DAP apn is the numeric index of the DAP AP the CTI is connected to.
On ADIv6 DAP apn is the base address of the DAP AP the CTI is connected to. The
base address must match the base address of the CTI on the respective MEM-AP.
All arguments are mandatory. This creates a new command $cti_name which is used
for various purposes including additional configuration.
Chapter 16: Architecture and Core Commands 148
In some use cases, it is useful to have SEMIHOSTING SYS EXIT return normally,
as any semihosting call, and do not break to the debugger. The standard allows
this to happen, but the condition to trigger it is a bit obscure ("by performing an
RDI Execute request or equivalent").
To make the SEMIHOSTING SYS EXIT call return normally, enable this option
(default: disabled).
arm semihosting_read_user_param [Command]
Read parameter of the semihosting call from the target. Usable in semihosting-user-
cmd-0x10* event handlers, returning a string.
When the target makes semihosting call with operation number from range 0x100-
0x107, an optional string parameter can be passed to the server. This parameter is
valid during the run of the event handlers and is accessible with this command.
arm semihosting_basedir [dir] [Command]
Set the base directory for semihosting I/O, either an absolute path or a path relative
to OpenOCD working directory. Use "." for the current directory.
This provides a huge speed increase, especially with USB JTAG cables (FT2232),
but might be unsafe if used with targets running at very low speeds, like the 32kHz
startup clock of an AT91RM9200.
the xscale vector_table command, OpenOCD will copy the value from memory to the
mini-IC every time execution resumes from a halt. This is done for both high and low
vector tables (although the table not in use may not be mapped to valid memory, and in
this case that copy operation will silently fail). This means that you will need to briefly
halt execution at some strategic point during system start-up; e.g., after the software has
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.
xscale analyze_trace [Command]
Displays the contents of the trace buffer.
xscale cache_clean_address address [Command]
Changes the address used when cleaning the data cache.
xscale cache_info [Command]
Displays information about the CPU caches.
xscale cp15 regnum [value] [Command]
Display cp15 register regnum; else if a value is provided, that value is written to that
register.
xscale debug_handler target address [Command]
Changes the address used for the specified target’s debug handler.
xscale dcache [enable|disable] [Command]
Enables or disable the CPU’s data cache.
xscale dump_trace filename [Command]
Dumps the raw contents of the trace buffer to filename.
xscale icache [enable|disable] [Command]
Enables or disable the CPU’s instruction cache.
xscale mmu [enable|disable] [Command]
Enables or disable the CPU’s memory management unit.
Chapter 16: Architecture and Core Commands 154
• -port-width port width – sets to port width the width of the synchronous par-
allel port used for trace output. Parameter used only on protocol sync. If not
specified, default value is 1.
• -formatter (0|1) – specifies if the formatter should be enabled. Parameter used
only on protocol sync. If not specified, default value is 0.
$tpiu_name enable [Command]
Uses the parameters specified by the previous $tpiu_name configure to configure
and enable the TPIU or the SWO. If required, the adapter is also configured and
enabled to receive the trace data. This command can be used before init, but it will
take effect only after the init.
$tpiu_name disable [Command]
Disable the TPIU or the SWO, terminating the receiving of the trace data.
Example usage:
1. STM32L152 board is programmed with an application that configures PLL to provide
core clock with 24MHz frequency; to use ITM output it’s enough to:
#include <libopencm3/cm3/itm.h>
...
ITM_STIM8(0) = c;
...
(the most obvious way is to use the first stimulus port for printf, for that this
ITM STIM8 assignment can be used inside write(); to make it blocking to avoid data
loss, add while (!(ITM_STIM8(0) & ITM_STIM_FIFOREADY)););
2. An FT2232H UART is connected to the SWO pin of the board;
3. Commands to configure UART for 12MHz baud rate:
$ setserial /dev/ttyUSB1 spd_cust divisor 5
$ stty -F /dev/ttyUSB1 38400
(FT2232H’s base frequency is 60MHz, spd cust allows to alias 38400 baud with our
custom divisor to get 12MHz)
4. itmdump -f /dev/ttyUSB1 -d1
5. OpenOCD invocation line:
openocd -f interface/stlink.cfg \
-c "transport select hla_swd" \
-f target/stm32l1.cfg \
-c "stm32l1.tpiu configure -protocol uart" \
-c "stm32l1.tpiu configure -traceclk 24000000 -pin-freq 12000000" \
-c "stm32l1.tpiu enable"
# Expose multiple RISC-V CSRs 128..132 under names "csr128" through "csr132":
$_TARGETNAME expose_csrs 128-132
# Expose a single RISC-V CSR number 1996 under custom name "csr_myregister":
$_TARGETNAME expose_csrs 1996=myregister
# Expose one RISC-V custom register with number 0xc020 (0xc000 + 32) under
# user-defined name "custom_myregister":
$_TARGETNAME expose_custom 32=myregister
OCD sessions for Xtensa processor and DSP targets are accessed via the Xtensa Debug
Module (XDM), which provides external connectivity either through a traditional JTAG
interface or an ARM DAP interface. If used, the DAP interface can control Xtensa targets
through JTAG or SWD probes.
executed, with the user’s debug session returning after potentially executing many in-
structions. When unmasked, a triggered interrupt will result in execution progressing
the requested number of instructions into the relevant vector/ISR code.
ters. With a numeric identifier parameter, creates a new a trace point counter and
associates it with that identifier.
Important: The identifier and the trace point number are not related except by this
command. These trace point numbers always start at zero (from server startup, or
after trace point clear) and count up from there.
179
17 JTAG Commands
Most general purpose JTAG commands have been presented earlier. (See [JTAG Speed],
page 58, Chapter 9 [Reset Configuration], page 60, and Chapter 10 [TAP Declaration],
page 65.) 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.
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.
verify_jtag (enable|disable) [Command]
Enables verification of DR and IR scans, to help detect programming errors. For IR
scans, verify_ircapture must also be enabled. Default is enabled.
• DRCAPTURE
• DRSHIFT ... stable; TDI/TDO shifting through the data register
• DREXIT1
• DRPAUSE ... stable; data register ready for update or more shifting
• DREXIT2
• DRUPDATE
• IRSELECT
• IRCAPTURE
• IRSHIFT ... stable; TDI/TDO shifting through the instruction register
• IREXIT1
• IRPAUSE ... stable; instruction register ready for update or more shifting
• IREXIT2
• IRUPDATE
Note that only six of those states are fully “stable” in the face of TMS fixed (low except
for reset) and a free-running JTAG clock. For all the others, the next TCK transition
changes to a new state.
• From drshift and irshift, clock transitions will produce side effects by changing
register contents. The values to be latched in upcoming drupdate or irupdate states
may not be as expected.
• run/idle, drpause, and irpause are reasonable choices after drscan or irscan com-
mands, since they are free of JTAG side effects.
• run/idle may have side effects that appear at non-JTAG levels, such as advancing
the ARM9E-S instruction pipeline. Consult the documentation for the TAP(s) you are
working with.
182
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.
or
Chapter 18: Boundary Scan Commands 184
Examples:
ipdbg -start -tap xc6s.tap -hub 0x02 -port 4242 -tool 4
Starts a server listening on tcp-port 4242 which connects to tool 4. The connection is
through the TAP of a Xilinx Spartan 6 on USER1 instruction (tested with a papillion pro
board).
ipdbg -start -tap 10m50.tap -hub 0x00C -vir -port 60000 -tool 1
Starts a server listening on tcp-port 60000 which connects to tool 1 (data up 1/data down 1).
The connection is through the TAP of a Intel MAX10 virtual jtag component
(sld instance index is 0; sld ir width is smaller than 5).
ipdbg -start -pld xc7.pld -port 5555 -tool 0
Starts a server listening on tcp-port 5555 which connects to tool 0 (data up 0/data down 0).
The TAP and ir value used to reach the JTAG Hub is given by the pld driver.
185
19 Utility Commands
return value (it will be terminated with 0x1a as well). This can be repeated as many times
as desired without reopening the connection.
It is not needed anymore to prefix the OpenOCD commands with ocd_ to get the results
back. But sometimes you might need the capture command.
See contrib/rpc_examples/ for specific client implementations.
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 front-end 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 196
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 - artificially 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
interest 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 reset_config 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
Chapter 22: FAQ 197
to. Apparently, some computers do not provide a USB power supply stable enough for
the Amontec JTAGkey to be operated.
Laptops running on battery have this problem too...
10. GDB Disconnects When using the Amontec JTAGkey, sometimes OpenOCD crashes
with the following error message: "Error: gdb server.c:101 gdb get char(): read:
10054". What does that mean and what might be the reason for this?
Error code 10054 corresponds to WSAECONNRESET, which means that the debugger
(GDB) has closed the connection to OpenOCD. This might be a GDB issue.
11. LPC2000 Flash In the configuration file in the section where flash device configurations
are described, there is a parameter for specifying the clock frequency for LPC2000
internal flash devices (e.g. flash bank $_FLASHNAME lpc2000 0x0 0x40000 0 0
$_TARGETNAME lpc2000_v1 14746 calc_checksum), which must be specified in
kilohertz. However, I do have a quartz crystal of a frequency that contains fractions
of kilohertz (e.g. 14,745,600 Hz, i.e. 14,745.600 kHz). Is it possible to specify real
numbers for the clock frequency?
No. The clock frequency specified here must be given as an integral number. However,
this clock frequency is used by the In-Application-Programming (IAP) routines of the
LPC2000 family only, which seems to be very tolerant concerning the given clock
frequency, so a slight difference between the specified clock frequency and the actual
clock frequency will not cause any trouble.
12. Command Order Do I have to keep a specific order for the commands in the configu-
ration file?
Well, yes and no. Commands can be given in arbitrary order, yet the devices listed
for the JTAG scan chain must be given in the right order (jtag newdevice), with the
device closest to the TDO-Pin being listed first. In general, whenever objects of the
same type exist which require an index number, then these objects must be given in
the right order (jtag newtap, targets and flash banks - a target references a jtag newtap
and a flash bank references a target).
You can use the “scan chain” command to verify and display the tap order.
Also, some commands can’t execute until after init has been processed. Such com-
mands include nand probe and everything else that needs to write to controller regis-
ters, perhaps for setting up DRAM and loading it with code.
13. JTAG TAP Order Do I have to declare the TAPS in some particular order?
Yes; whenever you have more than one, you must declare them in the same order used
by the hardware.
Many newer devices have multiple JTAG TAPs. For example: STMicroelectronics
STM32 chips have two TAPs, a “boundary scan TAP” and “Cortex-M3” TAP. Ex-
ample: The STM32 reference manual, Document ID: RM0008, Section 26.5, Figure
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:
Chapter 22: FAQ 198
As in the famous joke, the consequences of Rule #1 are profound. Once you understand
Rule #1, you will understand Tcl.
The two key items here are how “quoted things” work in Tcl. Tcl has three primary quoting
constructs, the [square-brackets] the {curly-braces} and “double-quotes”
Chapter 23: Tcl Crash Course 200
By now you should know $VARIABLES always start with a $DOLLAR sign. BTW: To set
a variable, you actually use the command “set”, as in “set VARNAME VALUE” much like
the ancient BASIC language “let x = 1” statement, but without the equal sign.
• [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.
The second helper evaluates an ascii string as a numerical expression and returns a value.
Here is an example of how the FOR command could be implemented. The pseudo code
below does not show error handling.
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.
new target is created. Remember the parsing rules. When the ascii text is parsed, the
$ TARGETNAME becomes a simple string, the name of the target which happens to
be a TARGET (object) command.
2. The 2nd parameter to the -event parameter is a TCBODY
There are 4 examples:
1. The TCLBODY is a simple string that happens to be a proc name
2. The TCLBODY is several simple commands separated by semicolons
3. The TCLBODY is a multi-line {curly-brace} quoted string
4. The TCLBODY is a string with variables that get expanded.
In the end, when the target event FOO occurs the TCLBODY is evaluated. Method
#1 and #2 are functionally identical. For Method #3 and #4 it is more interesting.
What is the TCLBODY?
Remember the parsing rules. In case #3, {curly-braces} mean the $VARS and [square-
brackets] are expanded later, when the EVENT occurs, and the text is evaluated. In
case #4, they are replaced before the “Target Object Command” is executed. This
occurs at the same time $ TARGETNAME is replaced. In case #4 the date will never
change. {BTW: [date] is a bad example; at this writing, Jim/OpenOCD does not have
a date command}
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. 208
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. 209
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. 210
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. 211
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 https://www.gnu.org/licenses/.
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. 212
A Cortex-M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
aarch64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Cortex-R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
about . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 CPU type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
adaptive clocking . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 194 CTI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
ambiqmicro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
apollo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Architecture Specific Commands . . . . . . . . . . . . . . 144 D
ARC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 DAP declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
ARM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 DCC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150, 177
ARM semihosting . . . . . . . . . . . . . . . . . . . . 18, 149, 150 developers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
ARM11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 directory search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
ARM7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 disassemble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148, 160
ARM9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150, 151 dongles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
ARM920T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 dotted name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
ARM926ej-s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
ARM966E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
ARMv4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
ARMv5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
E
ARMv6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 ETB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
ARMv7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 ETM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144, 158
ARMv8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 event, reset-init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
ARMv8-A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63, 68, 81
at91sam3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
at91sam4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
at91sam4l. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
at91samd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
F
ath79 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 faq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Atheros ath79 SPI driver . . . . . . . . . . . . . . . . . . . . . . . 95 fespi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
atsame5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Firmware recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
atsamv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 flash configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
autoprobe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 flash erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
flash programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
flash protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
B flash reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
board config file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 flash writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 FPGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
bscan spi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Freedom E SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
FTDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
C
CFI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 G
command line options . . . . . . . . . . . . . . . . . . . . . . . . . . 12 GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 186
commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 GDB configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Common Flash Interface . . . . . . . . . . . . . . . . . . . . . . . 89 GDB server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
config command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 GDB target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
config file, board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Generic JTAG2SPI driver . . . . . . . . . . . . . . . . . . . . . . 90
config file, interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
config file, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
config file, target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 H
config file, user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
configuration stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Connecting to GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 hwthread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Core Specific Commands . . . . . . . . . . . . . . . . . . . . . . 144
Cortex-A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
OpenOCD Concept Index 214
I P
image dumping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 PLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
image loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
init board procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 printer port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
init target events procedure . . . . . . . . . . . . . . . . . . . . 30 profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
init targets procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Programming using GDB . . . . . . . . . . . . . . . . . . . . . 188
initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
interface config file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
IPDBG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
IPDBG JTAG-Host server . . . . . . . . . . . . . . . . . . . . 183 Q
ITM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 QuadSPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
J
Jim-Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 R
jrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 RAM testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
jtagspi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
JTAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 57 Reset Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
JTAG autoprobe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 reset-init handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
JTAG Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
RPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
JTAG Route Controller . . . . . . . . . . . . . . . . . . . . . . . . 69
RPC Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
RPC trace output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
K RTCK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 59, 194
kinetis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
kinetis ke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 RTOS Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
L S
libdcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Linux-ARM DCC support . . . . . . . . . . . . . . . . . . . . 177 scan chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
logfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
lpcspifi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Serial Peripheral Interface . . . . . . . . . . . . . . . . . . . . . . 58
Serial Vector Format . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Serial Wire Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
M server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
memory access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Single Wire Interface Module. . . . . . . . . . . . . . . . . . . 58
message level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 SMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
microMIPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 SMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 191
MIPS32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 90
MIPS64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 SPIFI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
STMicroelectronics
QuadSPI/OctoSPI Interface . . . . . . . . . . . . . . . . . 93
N STMicroelectronics Serial Memory Interface . . . . 92
NAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 stmqspi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
NAND configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 124 stmsmi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
NAND erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 str9xpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
NAND other commands . . . . . . . . . . . . . . . . . . . . . . 127 SVF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
NAND programming . . . . . . . . . . . . . . . . . . . . . 126, 127 SWD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
NAND reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 SWD multi-drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
NAND verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 SWIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
NAND writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 swm050. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
NXP SPI Flash Interface . . . . . . . . . . . . . . . . . . . . . . . 92 SWO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156, 158
SWV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156, 158
O
object command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
OctoSPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
OpenOCD Concept Index 215
T U
USB Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
TAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
user config file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
TAP configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Using GDB as a non-intrusive
TAP declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 memory inspector . . . . . . . . . . . . . . . . . . . . . . . . . . 188
TAP events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Utility Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
TAP naming convention . . . . . . . . . . . . . . . . . . . . . . . 66
TAP state names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
target config file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
V
target events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 variable names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
vector catch . . . . . . . . . . . . . . . . 17, 151, 154, 155, 159
target initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
vector table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
target type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
target, current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
target, list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 W
Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 watchpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 wiggler. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Tcl Scripting API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Tcl scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 X
TCP port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
xcf. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
TPIU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Xilinx Platform flash driver . . . . . . . . . . . . . . . . . . . . 91
tracing . . . . . . . . . . . . . . . . . . . . . . . . . 144, 156, 158, 177 Xilinx Serial Vector Format . . . . . . . . . . . . . . . . . . . 182
translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 XScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 XSVF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
216
$ A
$cti_name ack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 aarch64 cache_info . . . . . . . . . . . . . . . . . . . . . . . . . . 159
$cti_name channel . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 aarch64 dbginit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
$cti_name dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 aarch64 disassemble . . . . . . . . . . . . . . . . . . . . . . . . . 160
$cti_name enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 aarch64 maskisr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
$cti_name read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 aarch64 smp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
$cti_name testmode . . . . . . . . . . . . . . . . . . . . . . . . . . 148 adapter assert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
$cti_name write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 adapter deassert . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
$dap_name apcsw. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 adapter driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
$dap_name apid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 adapter gpio [ tdo | tdi | tms | tck | trst |
$dap_name apreg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 swdio | swdio_dir | swclk | srst | led [
gpio_number | -chip chip_number |
$dap_name apsel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
-active-high | -active-low | -push-pull |
$dap_name baseaddr . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
-open-drain | -open-source | -pull-none |
$dap_name dpreg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
-pull-up | -pull-down | -init-inactive |
$dap_name info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
-init-active | -init-input ] ] . . . . . . . . . . . 37
$dap_name memaccess . . . . . . . . . . . . . . . . . . . . . . . . . . 72
adapter list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
$dap_name nu_npcx_quirks . . . . . . . . . . . . . . . . . . . . 73 adapter name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
$dap_name ti_be_32_quirks . . . . . . . . . . . . . . . . . . . 73 adapter serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
$target_name arp_examine . . . . . . . . . . . . . . . . . . . . 79 adapter speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
$target_name arp_halt . . . . . . . . . . . . . . . . . . . . . . . . 79 adapter srst delay. . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
$target_name arp_poll . . . . . . . . . . . . . . . . . . . . . . . . 79 adapter srst pulse_width . . . . . . . . . . . . . . . . . . . . . 61
$target_name arp_reset. . . . . . . . . . . . . . . . . . . . . . . 79 adapter transports . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
$target_name arp_waitstate . . . . . . . . . . . . . . . . . . 79 adapter usb location . . . . . . . . . . . . . . . . . . . . . . . . . 38
$target_name catch_exc . . . . . . . . . . . . . . . . . . . . . 160 add_help_text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
$target_name cget . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 add_script_search_dir . . . . . . . . . . . . . . . . . . . . . . 136
$target_name configure. . . . . . . . . . . . . . . . . . . . . . . 77 add_usage_text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
$target_name curstate . . . . . . . . . . . . . . . . . . . . . . . . 80 addreg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
$target_name debug_reason . . . . . . . . . . . . . . . . . . . 81 aduc702x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
$target_name eventlist. . . . . . . . . . . . . . . . . . . . . . . 81 am335xgpio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
$target_name get_reg . . . . . . . . . . . . . . . . . . . . . . . . . 79 am335xgpio speed_coeffs . . . . . . . . . . . . . . . . . . . . . 53
$target_name invoke-event . . . . . . . . . . . . . . . . . . . 81 ambiqmicro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
$target_name mdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 ambiqmicro mass_erase . . . . . . . . . . . . . . . . . . . . . . . . 96
$target_name mdd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 ambiqmicro page_erase . . . . . . . . . . . . . . . . . . . . . . . . 96
$target_name mdh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 ambiqmicro program_otp. . . . . . . . . . . . . . . . . . . . . . . 96
$target_name mdw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 amt_jtagaccel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
$target_name mwb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 angie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
$target_name mwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 arc add-reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
$target_name mwh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 arc add-reg-type-flags . . . . . . . . . . . . . . . . . . . . . 170
$target_name mww . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 arc add-reg-type-struct . . . . . . . . . . . . . . . . . . . . 170
$target_name pauth . . . . . . . . . . . . . . . . . . . . . . . . . . 160 arc get-reg-field . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
$target_name read_memory . . . . . . . . . . . . . . . . . . . . 80 arc jtag get-aux-reg . . . . . . . . . . . . . . . . . . . . . . . . 171
arc jtag get-core-reg . . . . . . . . . . . . . . . . . . . . . . . 171
$target_name set_reg . . . . . . . . . . . . . . . . . . . . . . . . . 79
arc jtag set-aux-reg . . . . . . . . . . . . . . . . . . . . . . . . 171
$target_name write_memory . . . . . . . . . . . . . . . . . . . 80
arc jtag set-core-reg . . . . . . . . . . . . . . . . . . . . . . . 171
$tpiu_name cget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
arc set-reg-exists . . . . . . . . . . . . . . . . . . . . . . . . . . 171
$tpiu_name configure . . . . . . . . . . . . . . . . . . . . . . . . 157
arm core_state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
$tpiu_name disable . . . . . . . . . . . . . . . . . . . . . . . . . . 158
arm disassemble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
$tpiu_name enable . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 arm mcr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
arm mrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
arm reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
arm semihosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
arm semihosting_basedir . . . . . . . . . . . . . . . . . . . . 150
arm semihosting_cmdline . . . . . . . . . . . . . . . . . . . . 149
Command and Driver Index 217
G jtag arp_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
gatemate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 jtag arp_init-reset . . . . . . . . . . . . . . . . . . . . . . . . . . 64
gdb_breakpoint_override . . . . . . . . . . . . . . . . . . . . . 34 jtag cget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
gdb_flash_program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 jtag configure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
gdb_memory_map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 jtag names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
gdb_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 jtag newtap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
gdb_report_data_abort . . . . . . . . . . . . . . . . . . . . . . . 35 jtag tapdisable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
gdb_report_register_access_error . . . . . . . . . . . 35 jtag tapenable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
gdb_save_tdesc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 jtag tapisenabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
gdb_target_description . . . . . . . . . . . . . . . . . . . . . . 35 jtag_dpi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
get_reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 jtag_dpi set_address . . . . . . . . . . . . . . . . . . . . . . . . . 54
gowin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 jtag_dpi set_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
gowin read_status . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 jtag_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
gowin read_user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 jtag_ntrst_assert_width . . . . . . . . . . . . . . . . . . . . . 62
gowin refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 jtag_ntrst_delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
gw16012 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 jtag_rclk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
jtagspi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
jtagspi always_4byte . . . . . . . . . . . . . . . . . . . . . . . . . 91
H jtagspi cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
jtagspi set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
hla . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 K
hla_command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
kinetis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
hla_device_desc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
kinetis create_banks . . . . . . . . . . . . . . . . . . . . . . . . 103
hla_layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
kinetis disable_wdog . . . . . . . . . . . . . . . . . . . . . . . . 104
hla_stlink_backend . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
kinetis fcf_source . . . . . . . . . . . . . . . . . . . . . . . . . . 103
hla_vid_pid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
kinetis fopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
kinetis mdm check_security . . . . . . . . . . . . . . . . . 103
kinetis mdm halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
I kinetis mdm mass_erase . . . . . . . . . . . . . . . . . . . . . . 103
imx_gpio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 kinetis mdm reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 kinetis nvm_partition. . . . . . . . . . . . . . . . . . . . . . . 103
init_reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 kinetis_ke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
intel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 kinetis_ke disable_wdog . . . . . . . . . . . . . . . . . . . . 104
intel set_bscan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 kinetis_ke mdm check_security . . . . . . . . . . . . . . 104
intel set_check_pos . . . . . . . . . . . . . . . . . . . . . . . . . 134 kinetis_ke mdm mass_erase . . . . . . . . . . . . . . . . . . 104
ipdbg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183, 184 kitprog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
irscan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 kitprog acquire_psoc . . . . . . . . . . . . . . . . . . . . . . . . . 47
itm port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 kitprog info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
itm ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 kitprog init_acquire_psoc . . . . . . . . . . . . . . . . . . . 47
J L
jlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 lattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
jlink config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lattice read_status . . . . . . . . . . . . . . . . . . . . . . . . . 133
jlink config ip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lattice read_user . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
jlink config mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lattice refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
jlink config reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lattice set_preload . . . . . . . . . . . . . . . . . . . . . . . . . 133
jlink config targetpower . . . . . . . . . . . . . . . . . . . . . 46 lattice write_user . . . . . . . . . . . . . . . . . . . . . . . . . . 133
jlink config usb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 linuxgpiod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
jlink config write. . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 load_image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
jlink emucom read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 log_output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
jlink emucom write. . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lpc2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
jlink freemem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lpc2000 part_id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
jlink hwstatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lpc288x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
jlink jtag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lpc2900 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
jlink usb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 lpc2900 password . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Command and Driver Index 220
R S
rbp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 s3c2410 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
read_memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 s3c2412 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 s3c2440 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
remote_bitbang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 s3c2443 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
remote_bitbang host . . . . . . . . . . . . . . . . . . . . . . . . . . 44 s3c6400 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
remote_bitbang port . . . . . . . . . . . . . . . . . . . . . . . . . . 44 scan_chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
remote_bitbang use_remote_sleep . . . . . . . . . . . . 44 set_reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
reset halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 sim3x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
sim3x lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
reset init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
sim3x mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
reset run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
sleep. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
reset_config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
soft_reset_halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
resume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
st-link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
riscv authdata_read . . . . . . . . . . . . . . . . . . . . . . . . . 169 st-link backend. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
riscv authdata_write . . . . . . . . . . . . . . . . . . . . . . . . 169 st-link cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
riscv dmi_read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 st-link vid_pid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
riscv dmi_write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 stellaris . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
riscv expose_csrs . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 stellaris recover . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
riscv expose_custom . . . . . . . . . . . . . . . . . . . . . . . . . 167 step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
riscv info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 stm32f1x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
riscv reset_delays . . . . . . . . . . . . . . . . . . . . . . . . . . 167 stm32f1x lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
riscv resume_order . . . . . . . . . . . . . . . . . . . . . . . . . . 168 stm32f1x mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . 116
riscv set_command_timeout_sec . . . . . . . . . . . . . 168 stm32f1x options_load. . . . . . . . . . . . . . . . . . . . . . . 116
riscv set_ebreakm . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 stm32f1x options_read. . . . . . . . . . . . . . . . . . . . . . . 116
riscv set_ebreaks . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 stm32f1x options_write . . . . . . . . . . . . . . . . . . . . . 116
riscv set_ebreaku . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 stm32f1x unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
riscv set_enable_virt2phys . . . . . . . . . . . . . . . . . 168 stm32f2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
riscv set_enable_virtual . . . . . . . . . . . . . . . . . . . 168 stm32f2x lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
riscv set_ir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 stm32f2x mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . 117
riscv set_mem_access . . . . . . . . . . . . . . . . . . . . . . . . 168 stm32f2x optcr2_write. . . . . . . . . . . . . . . . . . . . . . . 117
riscv set_reset_timeout_sec . . . . . . . . . . . . . . . . 168 stm32f2x options_read. . . . . . . . . . . . . . . . . . . . . . . 117
riscv use_bscan_tunnel . . . . . . . . . . . . . . . . . . . . . 168 stm32f2x options_write . . . . . . . . . . . . . . . . . . . . . 117
rlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 stm32f2x otp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
rp2040 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 stm32f2x unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
rsl10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 stm32h7x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
stm32h7x lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
rsl10 lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
stm32h7x mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . 118
rsl10 mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
stm32h7x option_read . . . . . . . . . . . . . . . . . . . . . . . . 118
rsl10 unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
stm32h7x option_write. . . . . . . . . . . . . . . . . . . . . . . 118
rtck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
stm32h7x unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
rtt channellist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
rtt channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
rtt polling_interval . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . 120
rtt server start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x option_load . . . . . . . . . . . . . . . . . . . . . . . . 120
rtt server stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x option_read . . . . . . . . . . . . . . . . . . . . . . . . 120
rtt setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x option_write. . . . . . . . . . . . . . . . . . . . . . . 120
rtt start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x otp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
rtt stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 stm32l4x trustzone . . . . . . . . . . . . . . . . . . . . . . . . . . 121
runAllMemTests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 stm32l4x unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
runtest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 stm32l4x wrp_info . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
rwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 stm32lx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
stm32lx lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
stm32lx mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . . 119
stm32lx unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
stmqspi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
stmqspi cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Command and Driver Index 222
stmqspi mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 U
stmqspi set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 ulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
stmsmi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
str7x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 usb_blaster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
str7x disable_jtag . . . . . . . . . . . . . . . . . . . . . . . . . . 121 usb_blaster firmware . . . . . . . . . . . . . . . . . . . . . . . . . 45
str9x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 usb_blaster lowlevel_driver . . . . . . . . . . . . . . . . . 45
str9x flash_config . . . . . . . . . . . . . . . . . . . . . . . . . . 121 usb_blaster pin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
str9xpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 usb_blaster vid_pid . . . . . . . . . . . . . . . . . . . . . . . . . . 45
str9xpec disable_turbo . . . . . . . . . . . . . . . . . . . . . 122 usbprog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
str9xpec enable_turbo. . . . . . . . . . . . . . . . . . . . . . . 122
str9xpec lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
str9xpec options_cmap. . . . . . . . . . . . . . . . . . . . . . . 122 V
str9xpec options_lvdsel . . . . . . . . . . . . . . . . . . . . 122 vdebug. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
str9xpec options_lvdthd . . . . . . . . . . . . . . . . . . . . 122 vdebug batching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
str9xpec options_lvdwarn . . . . . . . . . . . . . . . . . . . 122 vdebug bfm_path. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
str9xpec options_read. . . . . . . . . . . . . . . . . . . . . . . 122 vdebug mem_path. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
str9xpec options_write . . . . . . . . . . . . . . . . . . . . . 123 vdebug polling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
str9xpec part_id . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 vdebug server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
str9xpec unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 verify_image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
svf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 verify_image_checksum . . . . . . . . . . . . . . . . . . . . . . 141
swd newdap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 verify_ircapture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
swm050 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 verify_jtag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
swm050 mass_erase . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
swo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 virt2phys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
sysfsgpio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 virtex2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
virtex2 read_stat . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
virtex2 refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
virtex2 set_instr_codes . . . . . . . . . . . . . . . . . . . . 133
T virtex2 set_user_codes . . . . . . . . . . . . . . . . . . . . . 133
tap_select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 virtual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
target create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 vsllink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
target current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
target init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
target names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
W
target types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 w600 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
target_request debugmsgs . . . . . . . . . . . . . . . . . . . 177 wait_halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 wp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
tcl_notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 write_memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
tcl_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
tcl_trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
telnet_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
X
test_image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 x86_32 idb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
tms470 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 x86_32 idh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
tms470 flash_keyset . . . . . . . . . . . . . . . . . . . . . . . . . 123 x86_32 idw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
tms470 osc_megahertz . . . . . . . . . . . . . . . . . . . . . . . . 123 x86_32 iwb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
tms470 plldis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 x86_32 iwh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
tpiu create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 x86_32 iww . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
tpiu init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 156 xcf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
xcf ccb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
tpiu names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
xcf configure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
trace history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
xds110. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
trace point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
xds110 info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
transport init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
xds110 supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
transport list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
xlnx_pcie_xvc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
transport select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 xlnx_pcie_xvc config . . . . . . . . . . . . . . . . . . . . . . . . . 51
xmc1xxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
xmc4xxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
xmc4xxx flash_password . . . . . . . . . . . . . . . . . . . . . 123
Command and Driver Index 223