3 About Jim-Tcl
OpenOCD uses a small “Tcl Interpreter” known as Jim-Tcl.
This programming language provides a simple and extensible
command interpreter.
All commands presented in this Guide are extensions to Jim-Tcl.
You can use them as simple commands, without needing to learn
much of anything about Tcl.
Alternatively, you can write Tcl programs with them.
You can learn more about Jim at its website, http://jim.tcl.tk.
There is an active and responsive community, get on the mailing list
if you have any questions. Jim-Tcl maintainers also lurk on the
OpenOCD mailing list.
- Jim vs. Tcl
Jim-Tcl is a stripped down version of the well known Tcl language,
which can be found here: http://www.tcl.tk. Jim-Tcl has far
fewer features. Jim-Tcl is several dozens of .C files and .H files and
implements the basic Tcl command set. In contrast: Tcl 8.6 is a
4.2 MB .zip file containing 1540 files.
- Missing Features
Our practice has been: Add/clone the real Tcl feature if/when
needed. We welcome Jim-Tcl improvements, not bloat. Also there
are a large number of optional Jim-Tcl features that are not
enabled in OpenOCD.
- Scripts
OpenOCD configuration scripts are Jim-Tcl Scripts. OpenOCD’s
command interpreter today is a mixture of (newer)
Jim-Tcl commands, and the (older) original command interpreter.
- Commands
At the OpenOCD telnet command line (or via the GDB monitor command) one
can type a Tcl for() loop, set variables, etc.
Some of the commands documented in this guide are implemented
as Tcl scripts, from a startup.tcl file internal to the server.
- Historical Note
Jim-Tcl was introduced to OpenOCD in spring 2008. Fall 2010,
before OpenOCD 0.5 release, OpenOCD switched to using Jim-Tcl
as a Git submodule, which greatly simplified upgrading Jim-Tcl
to benefit from new features and bugfixes in Jim-Tcl.
- Need a crash course in Tcl?
See Tcl Crash Course.