+In the above, the "default" name target0 is 'target0'.
+
+ Example:
+
+ From the (gdb) prompt, one can type this:
+
+@verbatim
+ (gdb) mon target0 configure -endian big
+@end verbatim
+
+ And change target0 to 'big-endian'. This is a contrived example,
+ specifically for this document - don't expect changing endian
+ 'mid-operation' to work you should set the endian at creation.
+
+Known options [30/august/2008] are:
+@itemize
+@item
+[Mandatory 'create' Options]
+ @itemize
+ @item
+ type arm7tdmi|arm720|etc ...
+ @item
+ chain-position NUMBER
+ @item
+ endian ENDIAN
+ @end itemize
+@item
+Optional
+ @itemize
+ @item
+ event EVENTNAME "tcl-action"
+ @item
+ reset RESETACTION
+ @item
+ work-area-virt ADDR
+ @item
+ work-area-phys ADDR
+ @item
+ work-area-size ADDR
+ @item
+ work-area-backup BOOLEAN
+ @end itemize
+@end itemize
+Hint: To get a list of available options, try this:
+@verbatim
+ (gdb) mon target0 cget -BLAHBLAHBLAH
+@end verbatim
+
+ the above causes an error - and a helpful list of valid options.
+
+One can query any of the above options at run time, for example:
+@verbatim
+ (gdb) mon target0 cget -OPTION [param]
+@end verbatim
+
+Example TCL script
+
+@verbatim
+ # For all targets...
+ set c [target count]
+ for { set x 0 } { $x < $c } { incr x ] {
+ set n [target number $x]
+ set t [$n cget -type]
+ set e [$n cget -endian]
+ puts [format "%d: %s, %s, endian: %s\n" $x $n $t $n]
+ }
+@end verbatim
+
+Might produce:
+
+@verbatim
+ 0: pic32chip, mips_m4k, endain: little
+ 1: arm7, arm7tdmi, endian: big
+ 2: blackfin, bf534, endian: little
+@end verbatim
+
+Notice the above example is not target0, target1, target2 Why? Because in this contrived multi-target example -
+more human understandable target names might be helpful.
+
+For example these two are the same:
+
+@verbatim
+ (gdb) mon blackfin configure -event FOO {puts "Hi mom"}
+@end verbatim
+
+or:
+
+@verbatim
+ (gdb) mon [target number 2] configure -event FOO {puts "Hi mom"}
+@end verbatim
+
+In the second case, we use [] to get the command name of target #2, in this contrived example - it is "blackfin".
+
+Two important configuration options are:
+
+ "-event" and "-reset"
+
+The "-reset" option specifies what should happen when the chip is reset, for example should it 'halt', 're-init',
+or what.
+
+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
+
+@subsubsection Overview
+@cindex Overview
+At various points in time - certain 'target' events happen. You can create a custom event action to occur at that time.
+For example - after reset, the PLLs and CLOCKs may need to be reconfigured, or perhaps the SDRAM needs to be re-initialized.
+Often the easiest way to do that is to create a simple script file containing the series of (mww [poke memory]) commands
+you would type by hand, to reconfigure the target clocks. You could specify the "event action" like this:
+
+@verbatim
+ (gdb) mon target0 configure -event reset-init "script cfg.clocks"
+@end verbatim
+
+In the above example, when the event "reset-init" occurs, the "action-string" will be evaluated as if you typed it at the
+console:
+@itemize
+@item @b{Option1} - The simple approach (above) is to create a script file with lots of "mww" (memory write word) commands
+ to configure your targets clocks and/or external memory;
+@item @b{Option2} - You can instead create a fancy TCL procedure and invoke that procedure instead of sourcing a file [In fact,
+ "script" is a TCL procedure that loads a file].
+@end itemize
+
+@subsubsection Details
+@cindex Details
+There are many events one could use, to get a current list of events type the following invalid command, you'll get a helpful
+"runtime error" message, see below [list valid as of 30/august/2008]:
+
+@verbatim
+(gdb) mon target0 cget -event FAFA
+Runtime error, file "../../../openocd23/src/helper/command.c", line 433:
+ -event: Unknown: FAFA, try one of: old-pre_reset,
+ old-gdb_program_config, old-post_reset, halted,
+ resumed, resume-start, resume-end, reset-start,
+ reset-assert-pre, reset-assert-post,
+ reset-deassert-pre, reset-deassert-post,
+ reset-halt-pre, reset-halt-post, reset-wait-pre,
+ reset-wait-post, reset-init, reset-end,
+ examine-start, examine-end, debug-halted,
+ debug-resumed, gdb-attach, gdb-detach,
+ gdb-flash-write-start, gdb-flash-write-end,
+ gdb-flash-erase-start, gdb-flash-erase-end,
+ resume-start, resume-ok, or resume-end
+@end verbatim
+
+NOTE: The event-names "old-*" are deprecated and exist only to help old scripts continue to function, and the old "target_script"
+command to work. Please do not rely on them.
+
+These are some other important names:
+@itemize
+@item gdb-flash-erase-start
+@item gdb-flash-erase-end
+@item gdb-flash-write-start
+@item gdb-flash-write-end
+@end itemize
+
+These occur when GDB/OpenOCD attempts to erase & program the FLASH chip via GDB. For example - some PCBs may have a simple GPIO
+pin that acts like a "flash write protect" you might need to write a script that disables "write protect".
+
+To get a list of current 'event actions', type the following command:
+
+@verbatim
+ (gdb) mon target0 eventlist
+
+ Event actions for target (0) target0
+
+ Event | Body
+ ------------------------- | ----------------------------------------
+ old-post_reset | script event/sam7x256_reset.script
+@end verbatim
+
+Here is a simple example for all targets:
+
+@verbatim
+ (gdb) mon foreach x [target names] { $x eventlist }
+@end verbatim
+
+The above uses some TCL tricks:
+@enumerate a
+@item foreach VARIABLE LIST BODY
+@item to generate the list, we use [target names]
+@item the BODY, contains $x - the loop variable and expands to the target specific name
+@end enumerate
+
+Recalling the earlier discussion - the "object command" there are other things you can
+do besides "configure" the target.
+
+Note: Many of these commands exist as "global" commands, and they also exist as target
+specific commands. For example, the "mww" (memory write word) operates on the current
+target if you have more then 1 target, you must switch. In contrast to the normal
+commands, these commands operate on the specific target. For example, the command "mww"
+writes data to the *current* command line target.
+
+Often, you have only a single target - but if you have multiple targets (ie: a PIC32
+and an at91sam7 - your reset-init scripts might get a bit more complicated, ie: you must
+specify which of the two chips you want to write to. Writing 'pic32' clock configuration
+to an at91sam7 does not work).
+
+The commands are [as of 30/august/2008]:
+@verbatim
+ TNAME mww ADDRESS VALUE
+ TNAME mwh ADDRESS VALUE
+ TNAME mwb ADDRESS VALUE
+ Write(poke): 32, 16, 8bit values to memory.
+
+ TNAME mdw ADDRESS VALUE
+ TNAME mdh ADDRESS VALUE
+ TNAME mdb ADDRESS VALUE
+ Human 'hexdump' with ascii 32, 16, 8bit values
+
+ TNAME mem2array [see mem2array command]
+ TNAME array2mem [see array2mem command]
+
+ TNAME curstate
+ Returns the current state of the target.
+
+ TNAME examine
+ See 'advanced target reset'
+ TNAME poll
+ See 'advanced target reset'
+ TNAME reset assert
+ See 'advanced target reset'
+ TNAME reset deassert
+ See 'advanced target reset'
+ TNAME halt
+ See 'advanced target reset'
+ TNAME waitstate STATENAME
+ See 'advanced target reset'
+@end verbatim
+