On Saturday 26 September 2009, Freddie Chopin wrote:
> David Brownell pisze:
> > Not clear on the status of those LPC2xxx things.  I think they'd
> > be ready to go if they didn't set up bogus clock rates...
> 
> All I'm doing is waiting for your suggestion to solve the "bug" (for me 
> that's not a bug [; ) - as I really see no other way for that stuff to 
> work without another 7 levels of abstraction just because "clock rate 
> doesn't belong to target"... Unfortunately - for LPC2xxx it does.

I don't see what you're getting at.  I looked at the datasheet for
the first chip in your patch, which says crystals can have quite a
range outside of the single 12 MHz option you provided.

Fixing this doesn't involve "7 levels of abstraction".  Just give
the crystal setting the kind of "if it's not provided" check you
give other variables ... but error if it's not set.


> If the  
> scripts are supposed to be user friendly, then I see no other way, as 
> every other suggestion is harder than the method I suggested: changing 
> the files - just like now - but this time the frequency is visible and 
> described.
> 
> So what should I do?

Take those clock rate settings out of all the target-specific
files; probably leave a one-line comment listing the variable
name and saying the caller *must* set it appropriately for their
target board.

Add a few lines to the shared setup code which tests for that
variable.  If not set, emit a diagnostic and fail.  If set,
use it the way you now use it ... and to configure the JTAG
clock rate.

I think there will need to be some LPC2xxx-specific advice
somewhere, probably the user's guide.  If you like, I can
draft it.  It'd probably take the form of a sample "openocd.cfg"
file for someone with a custom LPC-based board, with the three
lines (source interface, set clock, source target/lpc); and the
suggestion that debug-oriented LPC builds add a delay right
after startup and before starting the clock, allowing JTAG to
attach before any "real code" runs.

- Dave
 


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

Reply via email to