Øyvind Harboe wrote:
> I'm hoping Duane will step in here and help out :-)
>
Item 1:
It sounds like you want options from from the "dos/unix" command line in
a batch file format. Why don't you _dynamically_ create the
configuration file: "openocd.cfg" - with your command line parameters
inside it. You could for example - create a "perl" script - that (a)
parses your command line options, (b) creates an "openocd.cfg" file then
(c) executes openocd with the "-f <CONFIGFILENAME> option" pointing at
your temporary 'openocd.cfg' file.
At this point, you have "openocd commands" - and 'getopt' is out of the
questions.
Item 2: -
If you want to use JIM based commands ... {and I don't think it is what
you want}
{Historical note: When OpenOCD was written 'JIM-TCL' did not exist, some
commands are "JIM" commands, some commands are old-school}
This item talks about JIM commands.
For examples of how to do JIM options & commands, take a look at the
file: "target.c" - look for the function that impliments the target
command. Also - search around the code for a common (local) variable
name "goi" - stands for "Get Option Info" - it is a bit ugly (I wrote
it) i was trying to make it easier to create common option handling
sequences in some common way. [Jim.c - by default - does everything
'in-line' ]
There are options/methods to handle "Enumerations" - Options with
numbers, etc.
Another file too look at would be the "jtag.c" file - where the taps are
created.
Item 3: - Old School Commands
Best choice, since you are looking at NAND stuff is look at how the
${SRC}/flash/nand.c commands are handled
Also - I believe David has done quite a bit of work with the Nand code.
Or look at the other <FOOBAR>_nand.c files
=Duane
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development