Chris Morgan <[email protected]> writes:

> Just signed up for this list as I'm a new openocd user and I saw this
> email thread. Ubuntu 11.10 with openocd 0.5.0.

Hi Chris,

That was me with the issue.

> I think I'm seeing the same issue but it seems like a bit of a catch
> 22 case that I can't figure out.

[...]

I am a bit hazy with tcl, with respect to definition of functions and
exactly when they are executed and how exporting variables works
etc. And I have not had time to figure it all out.

The mechanism is definitely broken, but I think that the
embedded-artists_lpc2478-32.cfg script is the only one that uses
$_TARGETNAME to actually do anything. Of course any users board script
will be broken too, but like me they all probably figured they did
something wrong and worked around it.

> Can't call init_targets before the cpu file is sourced, trying to
> source the cpu file before the board file appears to result in
> duplicate entries in the cpu table etc.
>
> I'm not sure how it ever worked so not sure how it should be fixed.
> Direction is welcome.

My own workaround is to manually define $_TARGETNAME in my board script.

...
adapter_khz 500

source [find target/lpc2478.cfg]

#seems to be needed since target file fails to export it
set _TARGETNAME lpc2478.cpu

# override version in lpc2478.cfg since this uses wrong clock
# frequency and causes flashing to be unreliable. This gets called
# during init
proc init_targets {} {
     echo "Our init_targets: flash configured for 72MHz."
     setup_lpc2478 72000 500
}

# seem to need this here now
init

# reset handler that can reset the memory map and clocking to a defined state
$_TARGETNAME configure -event reset-init {
    my_init_pll
}

...



-- 

John Devereux

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to