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.
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.
My openocd.cfg is simple and uses only existing scripts:
# jlink is well supported to use the interface directly
#source [find interface/jlink.cfg]
interface jlink
source [find board/embedded-artists_lpc2478-32.cfg]
In embedded-artists_lpc2478-32.cfg file which does:
...
source [find target/lpc2478.cfg]
# A working area will help speeding the flash programming
$_TARGETNAME configure -work-area-phys 0x40000200 -work-area-size
[expr 0x10000-0x200-0x20] -work-area-backup 0
...
The issue seems to be that
proc setup_lpc2xxx {chip_name cputapids flash_size flash_variant
workarea_size core_freq_khz adapter_freq_khz} {
reset_config trst_and_srst
# reset delays
adapter_nsrst_delay 100
jtag_ntrst_delay 100
adapter_khz $adapter_freq_khz
foreach i $cputapids {
append expected_ids "-expected-id " $i " "
}
eval "jtag newtap $chip_name cpu -irlen 4 -ircapture 0x1
-irmask 0xf $expected_ids"
set _TARGETNAME $chip_name.cpu
....
Sets the _TARGETNAME variable, but because it is called in lpc2478.cfg by:
proc setup_lpc2478 {core_freq_khz adapter_freq_khz} {
# 504kB flash and 64kB SRAM
# setup_lpc2xxx <chip_name> <cputapid> <flash_size>
<flash_variant> <workarea_size> <core_freq_khz> <adapter_freq_khz>
setup_lpc2xxx lpc2478 0x4f1f0f0f 0x7e000 lpc2000_v2 0x10000
$core_freq_khz $adapter_freq_khz
}
Basically the setup of _TARGETNAME isn't executed before the line:
$_TARGETNAME configure -work-area-phys 0x40000200 -work-area-size
[expr 0x10000-0x200-0x20] -work-area-backup 0
, as it is called when "init_targets" is called from the same lpc2478.cfg file:
proc init_targets {} {
# default to core clocked with 4MHz internal oscillator
echo "Warning - assuming default core clock 4MHz! Flashing may
fail if actual core clock is different."
# setup_lpc2478 <core_freq_khz> <adapter_freq_khz>
setup_lpc2478 4000 500
}
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.
Chris
------------------------------------------------------------------------------
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