# OpenOCD cfg problem with LPC2148

**URL:** <https://community.sparkfun.com/t/openocd-cfg-problem-with-lpc2148/5633>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [October 29, 2007, 4:53pm UTC](https://community.sparkfun.com/t/openocd-cfg-problem-with-lpc2148/5633 "2007-10-29T16:53:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [October 29, 2007, 4:53pm UTC](https://community.sparkfun.com/t/openocd-cfg-problem-with-lpc2148/5633/1 "2007-10-29T16:53:28Z")

</div>

Although I normally use CrossWorks I’d like to get OpenOCD and Insight working with a parallel port JTAG I/F for the EA LPC2148 system. When I run OpenOCD-pp I get the following errors:

C:\Program Files\openocd-2007re204\bin\>openocd-pp

Info: openocd.c:93 main(): Open On-Chip Debugger (2007-09-05 09:00 CEST)

Error: lpc2000.c:384 lpc2000\_flash\_bank\_command(): unknown LPC2000 variant

Error: flash.c:180 handle\_flash\_bank\_command(): ‘lpc2000’ driver rejected flas

h bank at 0x00000000

Warning: arm7\_9\_common.c:734 arm7\_9\_assert\_reset(): srst resets test logic, too

Error: arm\_jtag.c:38 arm\_jtag\_set\_instr\_error\_handler(): setting the new JTAG

instruction failed, debugging is likely to be broken

I’m using this cfg file that is supposed to be for the LPC2148:

#daemon configuration

telnet\_port 4444

gdb\_port 3333

#interface

interface parport

parport\_port 0x378

parport\_cable wiggler

jtag\_speed 5

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

reset\_config trst\_and\_srst srst\_pulls\_trst

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

jtag\_device 4 0x1 0xf 0xe

#target configuration

daemon\_startup reset

#target

#target arm7tdmi

target arm7tdmi little run\_and\_halt 0 arm7tdmi-s\_r4

run\_and\_halt\_time 0 30

# flash-options LPC2138

working\_area 0 0x40000000 0x4000 nobackup

# LPC2138 @ 12MHz / 0x7D000 from 500\*1024 (not 512!)

flash bank lpc2000 0x0 0x7D000 0 0 lpc2000\_v2 0 12000 calc\_checksum

# For more information about the configuration files, take a look at:

# [http://openfacts.berlios.de/index-en.ph … p+Debugger](http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger)

---

<div class="post-metadata">

**Author:** ![mifi](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mifi](https://community.sparkfun.com/u/mifi)\
**Post date:** [October 29, 2007, 5:29pm UTC](https://community.sparkfun.com/t/openocd-cfg-problem-with-lpc2148/5633/2 "2007-10-29T17:29:03Z")

</div>

Hi Leon,

the syntax has changed, your line:

> flash bank lpc2000 0x0 0x7D000 0 0 lpc2000\_v2 0 12000 calc\_checksum

must be changed to:

flash bank lpc2000 0x0 0x7D000 0 0 0 lpc2000\_v2 12000 calc\_checksum

Take a look here too:

[http://openfacts.berlios.de/index-en.ph … figuration](http://openfacts.berlios.de/index-en.phtml?title=OpenOCD_configuration)

> AS OF R189, the order of arguments will be switched to: flash bank lpc2000 0 0 \<target#\>

Perhaps this will help you?

Best regards,

Michael

---

<div class="post-metadata">

**Author:** ![Dominic](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dominic](https://community.sparkfun.com/u/Dominic)\
**Post date:** [October 29, 2007, 5:35pm UTC](https://community.sparkfun.com/t/openocd-cfg-problem-with-lpc2148/5633/3 "2007-10-29T17:35:49Z")

</div>

Hi,

as Michael already mentioned the LPC2000 flash bank command changed, but that’s only a small problem.

The real issue is the

“Error: arm\_jtag.c:38 arm\_jtag\_set\_instr\_error\_handler(): setting the new JTAG instruction failed, debugging is likely to be broken”

You could try the

jtag\_ntrst\_delay and jtag\_nsrst\_delay options (n in miliseconds) to give your target more time after the reset. It looks like the OpenOCD tried to select a new JTAG instruction too soon after releasing the reset.

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [October 29, 2007, 11:41pm UTC](https://community.sparkfun.com/t/openocd-cfg-problem-with-lpc2148/5633/4 "2007-10-29T23:41:12Z")

</div>

Thanks. I tried both those suggestions but get this now, with really long delays (5000):

C:\Program Files\openocd-2007re204\bin\>openocd-pp

Info: openocd.c:93 main(): Open On-Chip Debugger (2007-09-05 09:00 CEST)

Error: jtag.c:1253 jtag\_examine\_chain(): JTAG communication failure, check con

nection, JTAG interface, target power etc.

Error: jtag.c:1440 jtag\_init(): trying to validate configured JTAG chain anywa

y…

Error: arm\_jtag.c:38 arm\_jtag\_set\_instr\_error\_handler(): setting the new JTAG

instruction failed, debugging is likely to be broken

I seem to be getting closer, though.

Leon

---

<div class="post-metadata">

**Author:** ![linuxguy](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@linuxguy](https://community.sparkfun.com/u/linuxguy)\
**Post date:** [April 16, 2008, 5:37pm UTC](https://community.sparkfun.com/t/openocd-cfg-problem-with-lpc2148/5633/5 "2008-04-16T17:37:23Z")

</div>

> leon\_heller:  
> I seem to be getting closer, though.
> 
> Leon

Did you get it all to work? I'm back to tinkering with my LPC2148 boards now. Do you have a good reset script for it?

8-Dale
