oyvind> Please define standalone.
spen> standalone i mean openocd + config.
This is simple to accomplish today, with these simple changes (a..e)
(A) Concatenate all ".tcl" files into a single .tcl file.
Removing all "source [find tcl/some/file/name.tcl]
(B) Name that file "openocd.tcl".
(C) Add any other TCL functions you may like for your system.
NOTE: Items (A)(B) and (C) are really "boiler plate" and could be built
auto-magically by Make.
(D) Append your existing "openocd.cfg" file to the end of "openocd.tcl"
While doing so - prefix all commands with "openocd "
For example:
OLD:
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
NEW: [today - you need to {quote} the command line]
openocd { interface ft2232 }
openocd { ft2232_device_desc "Olimex OpenOCD JTAG TINY A" }
the temporary {quote-fix} is required - so TCL sees "one big string"
not an array of many parameters.
(E) there should be a way to specify to openocd (cmd line option maybe)
that tells it to *NOT* try to read 'commands.tcl' and not issue errors.
When starting "openocd" - specify -f /path/to/my/openocd.tcl
-----
The above is one approach - I'll do one better.
-----
Take the above -
(1) using your [spen's] "specs file" suggestion
(2) convert the 'openocd.tcl' file into a "C" string in a C file.
(3) compile that file to .o
(4) take the "BINARY" that is suppose to be programed in the gadget.
(5) Compile that binary into a .o file.
(6) Link a new "custom open-ocd" executable for the factory.
(7) The "openocd build" system could create an "libopenocd" file to help with
this.
If the factory jig was "linux" - you could probably acomplish the above by:
(A) take an existing [new] openocd executable.
(B) use objcopy to create 2 new "sections" in the ELF executable.
(C) One section for the "CONFIG FILE"
(D) One sectoin for the FLASH BINARY
Then - this new openocd should be able to "open" it self (ie: fopen( argv[0],
"rb" )
and extract that info from the elf.
On windows - you could embed the information as a "resource" of some type.
Or - maybe in the same way "ZIP2EXE" works.
For a factory situation - that would be even better!
Floor persons have only 1 file to screw up.
-Duane.
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development