On Tuesday 19 January 2010, Øyvind Harboe wrote:
> On Tue, Jan 19, 2010 at 9:33 PM, David Brownell <[email protected]> wrote:
> > On Tuesday 19 January 2010, Øyvind Harboe wrote:
> >> When I type "help cfi", I would have liked to see the command syntax
> >> for flash bank cfi...
> >>
> >> My idea was to invoke help_add_command() from flash/nor/tcl.c and
> >> introduce a help & usage text for each of the drivers.
> >>
> >> Any thoughts on this one?
> >
> > Find out why the current flash/nor/tcl.c helptext isn't showing up...
>
> I'm not talking about helptext for the active flash driver, but help
> on flash drivers which I have not added to the config script.
Oh, I think I see what you're saying. Once a driver is activated,
its specific commands have "help" output; fine.
BUT ... there's no way to find out what magic parameters any given
driver needs in "flash bank drivername ... ":
{
.name = "bank",
.handler = &handle_flash_bank_command,
.mode = COMMAND_CONFIG,
.usage = "bank_id driver_name base_address size_bytes "
"chip_width_bytes bus_width_bytes target "
"[driver_options ...]",
.help = "Define a new bank with the given name, "
"using the specified NOR flash driver.",
},
Those "[driver_options]" are invisible ... and (correct me if I'm
wrong) that's what you want to see.
If that's correct, I think you shouldn't plan on separate usage
and helptext for each driver. The drivers are after all invisible
except in the context of "flash bank". Just have a way to present the
driver options.
Related problem: there's no way to list all the NOR drivers!
One possible solution: add a "usage" string to "struct flash_driver",
and a new "flash driver_list" command which lists all the drivers
and their usage strings.
- Dave
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development