Re: [Openocd-development] (nor) flash broken

2009-12-07 Thread David Brownell
> > > > I thought I'd try "mem info" in GDB.  Nothing.  Why?
> > 
> > The first thing I tried, by the way, was
> > 
> > gdb_memory_map enable
> > 
> > but that failed with extreme rudeness.  :(
> 
> How so? :)

Immediate exit during startup.


___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] (nor) flash broken

2009-12-06 Thread Zach Welch
On Sun, 2009-12-06 at 20:34 -0800, David Brownell wrote:
> On Sunday 06 December 2009, Zach Welch wrote:
> > On Sun, 2009-12-06 at 18:05 -0800, David Brownell wrote:
> > > I thought I'd try "mem info" in GDB.  Nothing.  Why?
> 
> The first thing I tried, by the way, was
> 
>   gdb_memory_map enable
> 
> but that failed with extreme rudeness.  :(

How so? :)

[snip]
> > > So I add that missing call, and now I see the various flash
> > > commands again, and "flash banks" gives output ... curious
> > > and not-helpful output, but output.  (This command used to
> > > be post-processed by some TCL stuff.)
> >
> > The post-processing stuff is problematic, in so far as it's no longer
> > possible to wrap second-tier commands as it was in the past.  Honestly,
> > total feature compatibility will be difficult to reinstate, but I am not
> > sure that anyone uses this feature at present. 
> 
> Which feature ... "flash banks"?  I use it to see what's
> been set up.  There's no other way to get *concise* data.

The "'flash banks' gets mapped to 'flash_banks'" feature.

> (I'd think this should not be problematic.  If there's
> already an override TCL script registered, don't define
> a new one.)

This would be fine, except there is no longer a means to directly
override anything but top-level commands.  All sub-commands are called
through the dispatching mechanism of the top-level placeholder handler.

To rectify this new deficiency, I was thinking about supporting a
"command hook" syntax such as: 'command hook -post flash banks {...}',
which allows the script to associate post-processing functions to the
results of any given command.

This would be fairly easy to implement, and it would allow us to avoid
using override scripts for built-in commands.  It offers a clean
mechanism for pre/post-processing, and this could even be disabled in
certain contexts (e.g. 'command raw flash banks' to run the command
without any hook scripts).  Users already know how to write script with
callbacks, so a mechanism for calling script before/after the built-in
command seems plausible.  

However, this is not required in the current situation.  I have pushed a
patch that renames the existing 'flash banks' as 'flash list', replacing
replaces the TCL flash_banks wrapper with equivalent built-in C code.
As far as users will be concerned, nothing should appear to have changed
in this command  Script writers may have further beefs with me.

> Though I'd actually prefer to see a subset of what the
> "flash info" command shows, for each bank:  skip all the
> per-block status (most of which is "don't know" until you
> check a few things, and the rest of which is repetitive),
> but give more detailed info about each bank.

For now, I've just fixed the regression in apparent behavior.  Feel free
to continue tweaking things from here.

--Z

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] (nor) flash broken

2009-12-06 Thread Zach Welch
On Sun, 2009-12-06 at 19:55 -0800, Zach Welch wrote:
> On Sun, 2009-12-06 at 18:05 -0800, David Brownell wrote:
> > I thought I'd try "mem info" in GDB.  Nothing.  Why?
> > 
> > Well, "flash banks" doesn't show anything any more.  Why?
> > 
> > Nothing calls flash_bank_add() ... handle_flash_bank_command()
> > just leaks the structure it filled out.
> 
> Whoops that must be a "minor" refactoring think-o.  When I moved the
> functionality and added the new helper, I must have forgot to call it.
> Sorry. :(

Pushed the fix.

> > So I add that missing call, and now I see the various flash
> > commands again, and "flash banks" gives output ... curious
> > and not-helpful output, but output.  (This command used to
> > be post-processed by some TCL stuff.)
> 
> The post-processing stuff is problematic, in so far as it's no longer
> possible to wrap second-tier commands as it was in the past.  Honestly,
> total feature compatibility will be difficult to reinstate, but I am not
> sure that anyone uses this feature at present.  I recognized this
> problem at some point, but there were bigger things on my radar.  
> 
> I have conceive of 'command' module upgrade that would be provide the
> same functionality, but I would prefer to see if this is actually a
> problem that needs to be solve in the general case.  For now, I think it
> might be best to recreate the flash banks wrapper functionality in the C
> handler.  Thoughts, before I dive into this?

Too late.  I pushed a patch (with a braindead wrong comment), so we can
get the old output with 'flash_banks'.  I suppose that a real solution
is in order, but I cannot think of how to restore this without rather
drastic measures.  Comments?

> > But now I can't "flash probe 0" ... why?
> 
> Given the amount of change that's occurred in that module lately, it
> would be nice to know when I broke it.  I will try to figure it out from
> casual inspection, but I probably need more details on this one.

I tested it here.  Naturally, it works fine for me with the above fixes
in place.  Until I hear more, I am not going to investigate this piece
of the puzzle further.

--Z
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] (nor) flash broken

2009-12-06 Thread David Brownell
On Sunday 06 December 2009, Zach Welch wrote:
> On Sun, 2009-12-06 at 18:05 -0800, David Brownell wrote:
> > I thought I'd try "mem info" in GDB.  Nothing.  Why?

The first thing I tried, by the way, was

gdb_memory_map enable

but that failed with extreme rudeness.  :(


> > Well, "flash banks" doesn't show anything any more.  Why?
> > 
> > Nothing calls flash_bank_add() ... handle_flash_bank_command()
> > just leaks the structure it filled out.
> 
> Whoops that must be a "minor" refactoring think-o.  When I moved the
> functionality and added the new helper, I must have forgot to call it.
> Sorry. :(

It happens ... but this is the kind of thing that makes
me certain that we need more than just a couple of weeks
of testing in the RC phase.  Too much has changed for me
to believe there aren't a bunch more problems lurking.

Notice for example what arm720 and arm920 are now doing
when you try to write a coprocessor register.  They're
trying to write it using the *READ* instruction ...


> > So I add that missing call, and now I see the various flash
> > commands again, and "flash banks" gives output ... curious
> > and not-helpful output, but output.  (This command used to
> > be post-processed by some TCL stuff.)
>
> The post-processing stuff is problematic, in so far as it's no longer
> possible to wrap second-tier commands as it was in the past.  Honestly,
> total feature compatibility will be difficult to reinstate, but I am not
> sure that anyone uses this feature at present. 

Which feature ... "flash banks"?  I use it to see what's
been set up.  There's no other way to get *concise* data.

(I'd think this should not be problematic.  If there's
already an override TCL script registered, don't define
a new one.)

Though I'd actually prefer to see a subset of what the
"flash info" command shows, for each bank:  skip all the
per-block status (most of which is "don't know" until you
check a few things, and the rest of which is repetitive),
but give more detailed info about each bank.

- Dave
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] (nor) flash broken

2009-12-06 Thread Zach Welch
On Sun, 2009-12-06 at 18:05 -0800, David Brownell wrote:
> I thought I'd try "mem info" in GDB.  Nothing.  Why?
> 
> Well, "flash banks" doesn't show anything any more.  Why?
> 
> Nothing calls flash_bank_add() ... handle_flash_bank_command()
> just leaks the structure it filled out.

Whoops that must be a "minor" refactoring think-o.  When I moved the
functionality and added the new helper, I must have forgot to call it.
Sorry. :(

> So I add that missing call, and now I see the various flash
> commands again, and "flash banks" gives output ... curious
> and not-helpful output, but output.  (This command used to
> be post-processed by some TCL stuff.)

The post-processing stuff is problematic, in so far as it's no longer
possible to wrap second-tier commands as it was in the past.  Honestly,
total feature compatibility will be difficult to reinstate, but I am not
sure that anyone uses this feature at present.  I recognized this
problem at some point, but there were bigger things on my radar.  

I have conceive of 'command' module upgrade that would be provide the
same functionality, but I would prefer to see if this is actually a
problem that needs to be solve in the general case.  For now, I think it
might be best to recreate the flash banks wrapper functionality in the C
handler.  Thoughts, before I dive into this?

> But now I can't "flash probe 0" ... why?

Given the amount of change that's occurred in that module lately, it
would be nice to know when I broke it.  I will try to figure it out from
casual inspection, but I probably need more details on this one.

> ... that's enough debugging for now.  Zach?

I am in the middle of a new series to add multiple interface support
that is coming along nicely, but I'll pause shortly and look into this
problem further.  Sorry for the noise and confusion.

--Z

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] (nor) flash broken

2009-12-06 Thread David Brownell
I thought I'd try "mem info" in GDB.  Nothing.  Why?

Well, "flash banks" doesn't show anything any more.  Why?

Nothing calls flash_bank_add() ... handle_flash_bank_command()
just leaks the structure it filled out.

So I add that missing call, and now I see the various flash
commands again, and "flash banks" gives output ... curious
and not-helpful output, but output.  (This command used to
be post-processed by some TCL stuff.)

But now I can't "flash probe 0" ... why?

... that's enough debugging for now.  Zach?

- Dave
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development