openocd.cfg problem ARM7 core with two taps

Hi All,

I compile openocd with wiggler configure, I modify openocd.cfg for ARM7 board as fllow:

///////openocd.cfg

#daemon configuration

telnet_port 4444

gdb_port 3333

#interface

interface parport

parport_port 0x378

parport_cable wiggler

jtag_speed 0

#use combined on interfaces or targets that can’t set TRST/SRST separately

reset_config trst_and_srst

jtag newtap -irlen 3 -ircapture 0x1 -irmask 0xf -expected-id 0x342001bb

jtag newtap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x117001bb

target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4

run_and_halt_time 0 200

///end openocd.cfg

when I run openocd,the output shows it doesn’t work well. the log as follow:

///

Open On-Chip Debugger 0.4.0 (2010-11-16-15:24)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.berlios.de/doc/doxygen/bugs.html

parport port = 0x378

Runtime error, file “openocd.cfg”, line 9:

invalid command name “jtag_speed”

Info : clock speed 500 kHz

Warn : There are no enabled taps. AUTO PROBING MIGHT NOT WORK!!

Warn : AUTO auto0.tap - use “jtag newtap auto0 tap -expected-id 0x342001bb …”

Warn : AUTO auto1.tap - use “jtag newtap auto1 tap -expected-id 0x117001bb …”

Warn : AUTO auto0.tap - use “… -irlen 3”

Warn : AUTO auto1.tap - use “… -irlen 4”

Warn : gdb services need one or more targets defined

///

If you had those issues before please give some suggestions.

best wishes :slight_smile:

Hi there,

It is unfortunate but openocd does have a bit of a learning curve. Once you get the hang of it though it’s very capable.

Your issues are due to the openocd.cfg coming from an older version of openocd, 0.4.0 has a slightly different format.

Your first problem as indicated in the console output is the jtag_speed command, this is the old format. Never versions of openocd use jtag_khz instead, as in:

jtag_khz 6000

will set the speed to 6Mhz.

Next rather than giving the jtag newtap lines straight up it’s worth checking whether a .cfg for your arm chip already exists in the target folder. Then you can simply add something like:

source [find target/lpc3131.cfg]

and it’ll fill all the jtag newtap and target commands in for you.

If an existing file is not available then there’s nothing wrong with doing it all in openocd.cfg. In your case, your newtap lines need to give a name to the tap. For example:

jtag newtap somearm7 cpu -irlen 4 -expected-id 0x117001bb

You’ll need two of these with different names. I’m guessing one tap is the cpu, one is the boundary scan? call one somearm7.cpu and the other somearm7.bs just get the order right

I think the ircapture / irmask can be added or not, they’re used for a basic test of connectivity iirc.

Then the target command is as such:

target create somearm7.cpu arm7tdmi -endian little -chain-position somearm7.cpu

somearm7.cpu configure -work-area-phys 0x11028000 -work-area-size 0x30000 -work-area-backup 0

You’ll need to change the address and size of above to suit internal ram location/size.

Looking at existing .cfg files is really the quickest way to find similar examples, but sometimes you may need to get into the openocd user manual as well, and try to find syntax there.

Good Luck,

Andrew

Hi Andrew,

Thanks for you kindly support.it’s OK now. :smiley:

best wishes