Next: JTAG Commands, Previous: Flash Configuration, Up: Top
The commands documented in this chapter here are common commands that you a human may want to type and see the output of. Configuration type commands are documented elsewhere.
Intent:
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.
Wait for n milliseconds before resuming. Useful in connection with script files
(script command and target_script configuration).
Close the OpenOCD daemon, disconnecting all clients (GDB, Telnet, Other).
Display or adjust debug level to n<0-3>
Default disabled. Set default behaviour of OpenOCD to be "fast and dangerous". For instance ARM7/9 DCC memory
downloads and fast memory access will work if the JTAG interface isn't too fast and
the core doesn't run at a too low frequency. Note that this option only changes the default
and that the indvidual options, like DCC memory downloads, can be enabled and disabled
individually.
The target specific "dangerous" optimisation tweaking options may come and go as more robust and user friendly ways are found to ensure maximum throughput and robustness with a minimum of configuration.
Typically the "fast enable" is specified first on the command line:
openocd -c "fast enable" -c "interface dummy" -f target/str710.cfg
Redirect logging to <file> (default: stderr)
Execute commands from <file>
Also see: “source [find FILENAME]”
Turn power switch to target on/off.
No arguments: print status.
Not all interfaces support this.
Access a single register by its number[#] or by its [name].
No arguments: list all available registers for the current target.
Number or name argument: display a register
Number or name and value arguments: set register value
Poll the target for its current state. If the target is in debug mode, architecture
specific information about the current state is printed. An optional parameter
allows continuous polling to be enabled and disabled.
Send a halt request to the target and wait for it to halt for up to [ms] milliseconds.
Default [ms] is 5 seconds if no arg given.
Optional arg ms is a timeout in milliseconds. Using 0 as the [ms]
will stop OpenOCD from waiting.
Wait for the target to enter debug mode. Optional [ms] is
a timeout in milliseconds. Default [ms] is 5 seconds if no
arg given.
Resume the target at its current code position, or at an optional address.
OpenOCD will wait 5 seconds for the target to resume.
Single-step the target at its current code position, or at an optional address.
Perform a hard-reset. The optional parameter specifies what should happen after the reset.
With no arguments a "reset run" is executed
Requesting target halt and executing a soft reset. This often used
when a target cannot be reset and halted. The target, after reset is
released begins to execute code. OpenOCD attempts to stop the CPU and
then sets the Program counter back at the reset vector. Unfortunatlly
that code that was executed may have left hardware in an unknown
state.
display available ram memory.
These commands allow accesses of a specific size to the memory system. Often these are used to configure the current target in some special way. For example - one may need to write certian values to the SDRAM controller to enable SDRAM.
load_image <file> <address> [bin|ihex|elf]
Load image <file> to target memory at <address>
fast_load_image <file> <address> [bin|ihex|elf]
Normally you should be using load_image or GDB load. However, for
testing purposes or when IO overhead is significant(OpenOCD running on embedded
host), then storing the image in memory and uploading the image to the target
can be a way to upload e.g. multiple debug sessions when the binary does not change.
Arguments as load_image, but image is stored in OpenOCD host
memory, i.e. does not affect target. This approach is also useful when profiling
target programming performance as IO and target programming can easily be profiled
seperately.
fast_load
Loads image stored in memory by fast_load_image to current target. Must be preceeded by fast_load_image.
dump_image <file> <address> <size>
Dump <size> bytes of target memory starting at <address> to a
(binary) <file>.
verify_image <file> <address> [bin|ihex|elf]
Verify <file> against target memory starting at <address>.
This will first attempt comparison using a crc checksum, if this fails it will try a binary compare.
Profiling samples the CPU PC as quickly as OpenOCD is able, which will be used as a random sampling of PC.
These commands are specific to ARM architecture v4 and v5, like all ARM7/9 systems or Intel XScale (XScale isn't supported yet).
These commands are specific to ARM7 and ARM9 targets, like ARM7TDMI, ARM720t, ARM920t or ARM926EJ-S.
Can also be used on other arm9 based cores, arm966, arm920t and arm926ejs.
The following commands give direct access to the core, and are most likely only useful while debugging OpenOCD.
OpenOCD can handle certain target requests, currently debugmsg are only supported for arm7_9 and cortex_m3. See libdcc in the contrib dir for more details.