Definitely my last post on this thread.
On 12/04/2010 12:33 PM, Freddie Chopin wrote:
On 2010-12-04 12:05, Rolf Meeser wrote:
When doing "reset halt" (which would halt the chip immediately after
reset) the clock would be 4MHz.
Wrong. I've explained that often enough.
So you say that after reset and immediate halt the chip clock (for new
LPCs) is not 4MHz? Are you working for NXP and do you know something
that's not public? Because the manuals say something different than
you. Bootloader has nothing to do with it, as "reset halt" will
prevent it from running and changing anything.
One last time. OpenOCD cannot halt an LPC2000 immediately after reset.
It must let the CPU run, then try to gain control over the CPU as fast
as possible. How fast it can do that depends on the JTAG clock and on
delay settings.
By the time OpenOCD has taken control, the CPU may have entered ISP mode
(it does that if the flash contains no user firmware). In that case the
clock will be 14.748 MHz, and not 4 MHz anymore. If there is valid user
firmware, this firmware may have set the PLL to any value you like,
leaving you with an unknown clock frequency.
This process is not under your control. The only possible conclusion is
that you cannot have knowledge of the CPU frequency even after reset halt.
As a side note: This is the reason why PLL initialization of an LPC2000
device should first disconnect and disable the PLL before it
configures/starts/connects it again. If the device runs standalone, this
step is unnecessary (the PLL is off after reset). However, if you debug
the application via JTAG, things are different: Your JTAG box may not be
able to stop the CPU before the firmware starts the PLL. The debugger
will then just set the program counter to 0, so that it *appears* to be
the reset state. But it isn't. Running PLL initialization again on the
now already connected PLL will let your system crash.
That's a fact which you should accept. Not only because I do indeed work
for NXP.
Indeed - older LPCs don't work this way, because there is no internal
oscillator. So why change lpc2478.cfg that CAN work with default
value, and leave all older files that CAN'T?
No, the lpc2478.cfg *CANNOT* work with a default, because there is none.
You say there is none, I say there is. There's no way we can agree.
If you follow the arguments above about clock frequency uncertainty,
then with all due respect you cannot but agree :-)
lpc2103.cfg: The clock frequency is hard-coded as 12 MHz.
So you're saying is that anybody using crystals of 10, 14.756, 16,
18.432, 20, 24 MHz has to accept that flashing won't work for him?
Just because you don't mind failures here and then?
Obviously this device cannot be used with 14.765 crystal because
LPC2148 also cannot (see your paragraph above) - I don't know why is
that, but if you say so...
I haven't said so.
I said that nobody will do it. The LPC2148 will only be used by people
who want USB. That requires a 12 MHz crystal, 14.756 MHz will not work.
Besides the general nonsense of default frequencies in all these files,
I took this as an outstanding example of a config file that will fit
*ZERO* real world applications.
Changing these 5 numbers is pretty straightforward and people do that
(as OpenOCD works for them). I do. And are you saying that programming
flash with wrong speed causes it to fail LATER? Again - do you have
some secret knowledge from NXP that general public doesn't?
You do not want to write a 3-line board file to describe your
application, but you do accept having to modify predefined files, with
the risk that they get overwritten next time you update OpenOCD?
Are you teasing me?
This is not the place to teach you about flash technology. Just a simple
reminder: Flash is an analog component. Not applying a proper
programming pulse will leave a cell charged at only say 30%. Every flash
cell loses charge over time, but while the correctly handled cell keeps
its charge for 20 years, the incorrectly handled cell may already fail
after a few months.
Yes, this must be plain wrong, and you must be plain right, as the
world is black and white. Ease of use does not matter, the most
important thing is to be ultra-correct with everything. Do you
actually care about the users, or maybe you're affiliated with Keil or
IAR and your goal is to make using OpenOCD harder?
Let me quote Sergeant Hartman:
"What is your major malfunction?"
Really - your change does nothing more than make OpenOCD harder to
use, as everyone could change that frequency before that (and they
did, as people were using OpenOCD successfully with those chips for a
long time), but to do that no additional file was required.
Again (and again) - default (whatever they may or may not be) values
with warning for ALL LPC config files are GOOD. Adding "board" files
with such default value is exactly the same as leaving default value
inside target files. You loose nothing, we gain easy use and we are
warned that this may fail in some way or another.
I'm sorry, but the fact that you don't use anything but 12 MHz crystals
should not give direction for others.
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development