* Target library:: Target library
* Commands:: OpenOCD Commands
* Sample Scripts:: Sample Target Scripts
+* TFTP:: TFTP
* GDB and OpenOCD:: Using GDB and OpenOCD
* TCL and OpenOCD:: Using TCL and OpenOCD
* TCL scripting API:: Tcl scripting API
@cindex altium
Altium Universal JTAG cable.
@end itemize
-@item @b{parport_write_on_exit} <@var{on|off}>
+@item @b{parport_write_on_exit} <@var{on}|@var{off}>
@cindex parport_write_on_exit
@*This will configure the parallel driver to write a known value to the parallel
interface on exiting OpenOCD
@cindex ft2232_device_desc
@*The USB device description of the FTDI FT2232 device. If not specified, the FTDI
default value is used. This setting is only valid if compiled with FTD2XX support.
+@item @b{ft2232_serial} <@var{serial-number}>
+@cindex ft2232_serial
+@*The serial number of the FTDI FT2232 device. If not specified, the FTDI default
+values are used.
@item @b{ft2232_layout} <@var{name}>
@cindex ft2232_layout
@*The layout of the FT2232 GPIO signals used to control output-enables and reset
@item @b{cortex_m3}
@item @b{feroceon}
@item @b{xscale}
+@item @b{arm11}
@item @b{mips_m4k}
@end itemize
If you want to use a target board that is not on this list, see Adding a new
-target board
+target board.
+The @option{target types} command can be used to get the list of targets supported from within openocd.
Endianess may be @option{little} or @option{big}.
@option{pre_resume} or @option{gdb_program_config}.
@option{post_reset} and @option{reset} will produce the same results.
-@item @b{working_area} <@var{target#}> <@var{address}> <@var{size}>
-<@var{backup}|@var{nobackup}>
+@item @b{working_area} <@var{target#}> <@var{address}> <@var{size}> <@var{backup}|@var{nobackup}> [@option{virtual address}]
@cindex working_area
@*Specifies a working area for the debugger to use. This may be used to speed-up
downloads to target memory and flash operations, or to perform otherwise unavailable
Supported variants are @option{ixp42x}, @option{ixp45x}, @option{ixp46x},
@option{pxa250}, @option{pxa255}, @option{pxa26x}.
+@subsection arm11 options
+@cindex arm11 options
+
+@subsection mips_m4k options
+@cindex mips_m4k options
+Use variant @option{ejtag_srst} when debugging targets that
+do not provide a functional SRST line on the EJTAG connector.
+This causes openocd to instead use an EJTAG software reset command to reset the processor.
+You still need to enable @option{srst} on the reset configuration command to enable openocd hardware reset functionality.
+
@section Flash configuration
@cindex Flash configuration
@subsection Target state handling
@itemize @bullet
+@item @b{power} <@var{on}|@var{off}>
+@cindex reg
+@*Turn power switch to target on/off.
+No arguments: print status.
+
+
@item @b{reg} [@option{#}|@option{name}] [value]
@cindex reg
@*Access a single register by its number[@option{#}] or by its [@option{name}].
@end itemize
@subsection Memory access commands
+@itemize @bullet
+@item @b{meminfo}
+
+display available ram memory.
+@end itemize
These commands allow accesses of a specific size to the memory system:
@itemize @bullet
@item @b{mdw} <@var{addr}> [@var{count}]
@cindex load_image
@anchor{load_image}
@*Load image <@var{file}> to target memory at <@var{address}>
+@item @b{fast_load_image} <@var{file}> <@var{address}> [@option{bin}|@option{ihex}|@option{elf}]
+@cindex fast_load_image
+@anchor{fast_load_image}
+@*Normally you should be using @b{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 @b{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.
+@item @b{fast_load}
+@cindex fast_image
+@anchor{fast_image}
+@*Loads image stored in memory by @b{fast_load_image} to current target. Must be preceeded by fast_load_image.
@item @b{dump_image} <@var{file}> <@var{address}> <@var{size}>
@cindex dump_image
@anchor{dump_image}
The "-event" option less you specify a TCL command to occur when a specific event occurs.
+@subsubsection Other Target Commands
+@cindex Other Target Commands
+@itemize
+@item @b{profile} <@var{seconds}> <@var{gmon.out}>
+
+Profiling samples the CPU PC as quickly as OpenOCD is able, which will be used as a random sampling of PC.
+@end itemize
+
@subsection Target Events
@cindex Target Events
@*Translate a virtual address to a physical address.
@end itemize
+@subsection CORTEX_M3 specific commands
+@cindex CORTEX_M3 specific commands
+
+@itemize @bullet
+@item @b{cortex_m3 maskisr} <@var{on}|@var{off}>
+@cindex cortex_m3 maskisr
+@*Enable masking (disabling) interrupts during target step/resume.
+@end itemize
+
@page
@section Debug commands
@cindex Debug commands
@*Enable/disable target debugmsgs requests. debugmsgs enable messages to be sent to the debugger while the target is running.
@end itemize
+@node TFTP
+@chapter TFTP
+@cindex TFTP
+If OpenOCD runs on an embedded host(as ZY1000 does), then tftp can
+be used to access files on PCs(either developer PC or some other PC).
+
+The way this works is to prefix a filename by "/tftp/ip/" and append
+the tftp path on the tftp server(tftpd). E.g. "load_image /tftp/10.0.0.96/c:\temp\abc.elf"
+will load c:\temp\abc.elf from the developer pc (10.0.0.96) into memory as
+if the file was hosted on the embedded host.
+
+In order to achieve decent performance, you must choose a tftp server
+that supports a packet size bigger than the default packet size(512 bytes). There
+are numerous tftp servers out there(free and commercial) and you will have to do
+a bit of googling to find something that fits your requirements.
+
@node Sample Scripts
@chapter Sample Scripts
@cindex scripts
Low level commands are prefixed with "openocd_", e.g. openocd_flash_banks
is the low level API upon which "flash banks" is implemented.
+@itemize @bullet
+@item @b{ocd_mem2array} <@var{varname}> <@var{width}> <@var{addr}> <@var{nelems}>
+
+Read memory and return as a TCL array for script processing
+@item @b{ocd_array2mem} <@var{varname}> <@var{width}> <@var{addr}> <@var{nelems}>
+
+Convert a TCL array to memory locations and write the values
+@item @b{ocd_flash_banks} <@var{driver}> <@var{base}> <@var{size}> <@var{chip_width}> <@var{bus_width}> <@var{target}> [@option{driver options} ...]
+
+Return information about the flash banks
+@end itemize
+
OpenOCD commands can consist of two words, e.g. "flash banks". The
startup.tcl "unknown" proc will translate this into a tcl proc
called "flash_banks".
@chapter FAQ
@cindex faq
@enumerate
+@item Why does not backslashes in paths under Windows doesn't work?
+
+OpenOCD uses Tcl and a backslash is an escape char. Use @{ and @}
+around Windows filenames.
+
+@smallexample
+> echo \a
+
+> echo @{\a@}
+\a
+> echo "\a"
+
+>
+@end smallexample
+To
+
@item OpenOCD complains about a missing cygwin1.dll.
Make sure you have Cygwin installed, or at least a version of OpenOCD that