1 Plan for hosted scripting support in OpenOCD
2 ============================================
4 What scripting will not do
5 ==========================
6 It is not the intention that normal OpenOCD users will
7 use tcl scripting extensively, write lots of clever scripts,
8 or contribute back to OpenOCD.
10 The scripting support is intended for developers of OpenOCD.
12 Target scripts can contain new procedures that end users may
13 tinker to their needs without really understanding tcl.
15 Since end users are not expected to mess with the scripting
16 language, the choice of language is not terribly important
17 to those same end users.
19 Jim Tcl was chosen as it was easy to integrate, works
20 great in an embedded environment and Øyvind Harboe
21 had experience with it.
25 Default implementation of procedures in tcl/procedures.tcl.
27 - Polymorphic commands for target scripts.
28 - there will be added some commands in Tcl that the target
30 - produce <productionfile> <serialnumber>. Default implementation
31 is to ignore serial number and write a raw binary file
32 to beginning of first flash. Target script can dictate
33 file format and structure of serialnumber. Tcl allows
34 an argument to consit of e.g. a list so the structure of
35 the serial number is not limited to a single string.
36 - reset handling. Precise control of how srst, trst &
38 - replace some parts of the current command line handler.
39 This is only to simplify the implementation of OpenOCD
40 and will have no externally visible consequences.
41 Tcl has an advantage in that it's syntax is backwards
42 compatible with the current OpenOCD syntax.
43 - external scripting. Low level tcl functions will be defined
44 that return machine readable output. These low level tcl
45 functions constitute the tcl api. flash_banks is such
46 a low level tcl proc. "flash banks" is an example of
47 a command that has human readable output. The human
48 readable output is expected to change inbetween versions
49 of OpenOCD. The output from flash_banks may not be
50 in the preferred form for the client. The client then
51 has two choices a) parse the output from flash_banks
52 or b) write a small piece of tcl to output the
53 flash_banks output to a more suitable form. The latter may