Next: , Previous: Flash Configuration, Up: Top


14 General Commands

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:

14.1 Daemon Commands

14.1.1 sleep [msec]


Wait for n milliseconds before resuming. Useful in connection with script files (script command and target_script configuration).

14.1.2 shutdown


Close the OpenOCD daemon, disconnecting all clients (GDB, Telnet, Other).

14.1.3 debug_level [n]


Display or adjust debug level to n<0-3>

14.1.4 fast [enable|disable]


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

14.1.5 log_output <file>


Redirect logging to <file> (default: stderr)

14.1.6 script <file>


Execute commands from <file> Also see: “source [find FILENAME]”

14.2 Target state handling

14.2.1 power <on|off>


Turn power switch to target on/off. No arguments: print status. Not all interfaces support this.

14.2.2 reg [#|name] [value]


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

14.2.3 poll [on|off]


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.

14.2.4 halt [ms]


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.

14.2.5 wait_halt [ms]


Wait for the target to enter debug mode. Optional [ms] is a timeout in milliseconds. Default [ms] is 5 seconds if no arg given.

14.2.6 resume [address]


Resume the target at its current code position, or at an optional address. OpenOCD will wait 5 seconds for the target to resume.

14.2.7 step [address]


Single-step the target at its current code position, or at an optional address.

14.2.8 reset [run|halt|init]


Perform a hard-reset. The optional parameter specifies what should happen after the reset.

With no arguments a "reset run" is executed

14.2.9 soft_reset_halt


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.

14.3 Memory access commands

14.3.1 meminfo

display available ram memory.

14.3.2 Memory Peek/Poke type commands

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.

  1. To change the current target see the “targets” (plural) command
  2. In system level scripts these commands are depricated, please use the TARGET object versions.

14.4 Image Loading Commands

14.4.1 load_image

load_image <file> <address> [bin|ihex|elf]
Load image <file> to target memory at <address>

14.4.2 fast_load_image

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.

14.4.3 fast_load

fast_load
Loads image stored in memory by fast_load_image to current target. Must be preceeded by fast_load_image.

14.4.4 dump_image

dump_image <file> <address> <size>
Dump <size> bytes of target memory starting at <address> to a (binary) <file>.

14.4.5 verify_image

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.

14.5 Breakpoint commands

14.6 Misc Commands

14.7 Target Specific Commands

14.8 Architecture Specific Commands

14.8.1 ARMV4/5 specific commands

These commands are specific to ARM architecture v4 and v5, like all ARM7/9 systems or Intel XScale (XScale isn't supported yet).

14.8.2 ARM7/9 specific commands

These commands are specific to ARM7 and ARM9 targets, like ARM7TDMI, ARM720t, ARM920t or ARM926EJ-S.

14.8.3 ARM720T specific commands

14.8.4 ARM9TDMI specific commands

14.8.5 ARM966E specific commands

14.8.6 ARM920T specific commands

14.8.7 ARM926EJS specific commands

14.8.8 CORTEX_M3 specific commands

14.9 Debug commands

The following commands give direct access to the core, and are most likely only useful while debugging OpenOCD.

14.10 Target Requests

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.