fix syntax error.
[fw/openocd] / doc / openocd.texi
index 551b62c5459c8591b2b73a14796510ea02d8cb08..160efa650814842466ee3506f686481ef71c2c38 100644 (file)
@@ -51,6 +51,7 @@ This manual documents edition @value{EDITION} of the Open On-Chip Debugger
 * Commands::          OpenOCD Commands
 * Sample Scripts::    Sample Target Scripts
 * GDB and OpenOCD::   Using GDB and OpenOCD
+* TCL and OpenOCD::   Using TCL and OpenOCD
 * Upgrading::         Deprecated/Removed Commands
 * FAQ::               Frequently Asked Questions
 * License::           GNU Free Documentation License
@@ -126,8 +127,8 @@ a FTDI FT2232 based interface:
 homepage (@uref{www.amontec.com}), as the JTAGkey uses a non-standard VID/PID. 
 @end itemize
 
-Please note that the ftdi2232 variant (using libftdi) isn't supported under Cygwin.
-You have to use the ftd2xx variant (using FTDI's D2XX) on Cygwin.
+libftdi is supported under windows. Versions earlier than 0.13 will require patching.
+see contrib/libftdi for more details.
 
 In general, the D2XX driver provides superior performance (several times as fast),
 but has the draw-back of being binary-only - though that isn't that bad, as it isn't
@@ -176,6 +177,8 @@ build properly.}
 @option{--enable-presto_libftdi}
 @item
 @option{--enable-presto_ftd2xx}
+@item
+@option{--enable-jlink}
 @end itemize
 
 If you want to access the parallel port using the PPDEV interface you have to specify
@@ -196,7 +199,7 @@ locations, i.e. /usr/include, /usr/lib.
 @cindex --debug_level
 @cindex --logfile
 @cindex --search
-OpenOCD runs as a daemon, waiting for connections from clients (Telnet or GDB).
+OpenOCD runs as a daemon, waiting for connections from clients (Telnet, GDB, Other).
 Run with @option{--help} or @option{-h} to view the available command line switches.
 
 It reads its configuration by default from the file openocd.cfg located in the current
@@ -259,12 +262,17 @@ Set to <@var{enable}> to cause OpenOCD to send the memory configuration to gdb w
 requested. gdb will then know when to set hardware breakpoints, and program flash
 using the gdb load command. @option{gdb_flash_program enable} will also need enabling
 for flash programming to work.
-Default behaviour is <@var{disable}>
+Default behaviour is <@var{enable}>
 @item @b{gdb_flash_program} <@var{enable|disable}>
 @cindex gdb_flash_program
 Set to <@var{enable}> to cause OpenOCD to program the flash memory when a
 vFlash packet is received.
 Default behaviour is <@var{enable}>
+ at item @b{tcl_port} <@var{number}>
+ at cindex tcl_port
+Port on which to listen for incoming TCL syntax. This port is intended as
+a simplified RPC connection that can be used by clients to issue commands
+and get the output from the TCL engine.
 @item @b{daemon_startup} <@var{mode}>
 @cindex daemon_startup
 @option{mode} can either @option{attach} or @option{reset}
@@ -312,6 +320,10 @@ usbprog is a freely programmable USB adapter.
 @item @b{gw16012}
 Gateworks GW16012 JTAG programmer.
 @end itemize
+@itemize @minus
+@item @b{jlink}
+Segger jlink usb adapter
+@end itemize
 @end itemize
 
 @itemize @bullet
@@ -326,6 +338,7 @@ is optional, in which case the reset speed is used.
 @item wiggler: maximum speed / @var{number}
 @item ft2232: 6MHz / (@var{number}+1)
 @item amt jtagaccel: 8 / 2**@var{number}
+@item jlink: maximum speed in kHz (0-12000), 0 will use RTCK
 @end itemize
 
 Note: Make sure the jtag clock is no more than @math{1/6th × CPU-Clock}. This is
@@ -481,7 +494,10 @@ OOCDLink
 
 @item @b{ft2232_vid_pid} <@var{vid}> <@var{pid}>
 The vendor ID and product ID of the FTDI FT2232 device. If not specified, the FTDI
-default values are used. This command is not available on Windows. 
+default values are used. Multiple <@var{vid}>, <@var{pid}> pairs may be given, eg.
+@smallexample
+ft2232_vid_pid 0x0403 0xcff8 0x15ba 0x0003
+@end smallexample
 @item @b{ft2232_latency} <@var{ms}>
 On some systems using ft2232 based JTAG interfaces the FT_Read function call in
 ft2232_read() fails to return the expected number of bytes. This can be caused by
@@ -552,9 +568,11 @@ unavailable for some time during startup (like the STR7 series), you can't use
 
 @item @b{target_script} <@var{target#}> <@var{event}> <@var{script_file}>
 @cindex target_script
-Event is either @option{reset}, @option{post_halt}, @option{pre_resume} or @option{gdb_program_config}
+Event is one of the following:
+@option{pre_reset}, @option{reset}, @option{post_reset}, @option{post_halt},
+@option{pre_resume} or @option{gdb_program_config}.
+@option{post_reset} and @option{reset} will produce the same results.
 
-TODO: describe exact semantic of events
 @item @b{run_and_halt_time} <@var{target#}> <@var{time_in_ms}>
 @cindex run_and_halt_time
 The amount of time the debugger should wait after releasing reset before it asserts
@@ -725,13 +743,17 @@ at91sam9260.cfg  nslu2.cfg     sam7x256.cfg    wi-9c.cfg
 @chapter Commands
 @cindex commands
 
-OpenOCD allows user interaction through a telnet interface
-(default: port 4444) and a GDB server (default: port 3333). The command line interpreter
+OpenOCD allows user interaction through a GDB server (default: port 3333),
+a telnet interface (default: port 4444), and a TCL interface (default: port 5555). The command line interpreter
 is available from both the telnet interface and a GDB session. To issue commands to the
 interpreter from within a GDB session, use the @option{monitor} command, e.g. use
 @option{monitor poll} to issue the @option{poll} command. All output is relayed through the
 GDB session.
 
+The TCL interface is used as a simplified RPC mechanism that feeds all the
+input into the TCL interpreter and returns the output from the evaluation of
+the commands.
+
 @section Daemon
 
 @itemize @bullet
@@ -742,7 +764,7 @@ Wait for n milliseconds before resuming. Useful in connection with script files
 
 @item @b{shutdown}
 @cindex shutdown
-Close the OpenOCD daemon, disconnecting all clients (GDB, Telnet). 
+Close the OpenOCD daemon, disconnecting all clients (GDB, Telnet, Other). 
 
 @item @b{debug_level} [@var{n}]
 @cindex debug_level
@@ -1020,6 +1042,16 @@ write stm32 option bytes.
 mass erase flash memory. 
 @end itemize
 
+@subsection Stellaris specific commands
+@cindex Stellaris specific commands
+These are flash specific commands when using the Stellaris driver.
+@itemize @bullet
+@item @b{stellaris mass_erase} <@var{num}>
+@cindex stellaris mass_erase
+mass erase flash memory. 
+@end itemize
+
 @page
 @section Architecture Specific Commands
 @cindex Architecture Specific Commands
@@ -1334,6 +1366,39 @@ target_script 0 gdb_program_config config.script
 To verify any flash programming the gdb command @option{compare-sections}
 can be used.
 
+@node TCL and OpenOCD
+@chapter TCL and OpenOCD
+@cindex TCL and OpenOCD
+OpenOCD embeds a TCL interpreter (see JIM) for command parsing and scripting
+support.
+
+The TCL interpreter can be invoked from the interactive command line, files, and a network port.
+
+The command and file interfaces are fairly straightforward, while the network
+port is geared toward intergration with external clients. A small example
+of an external TCL script that can connect to openocd is shown below.
+
+@verbatim
+# Simple tcl client to connect to openocd
+puts "Use empty line to exit"
+set fo [socket 127.0.0.1 5555]
+puts -nonewline stdout "> "
+flush stdout
+while {[gets stdin line] >= 0} {
+    if {$line eq {}} break
+    puts $fo $line
+    flush $fo
+    gets $fo line
+    puts $line
+    puts -nonewline stdout "> "
+    flush stdout
+}
+close $fo
+@end verbatim
+
+This script can easily be modified to front various GUIs or be a sub
+component of a larger framework for control and interaction.
+
 @node Upgrading
 @chapter Deprecated/Removed Commands
 @cindex Deprecated/Removed Commands