# Error while running openOCD

**URL:** <https://community.sparkfun.com/t/error-while-running-openocd/5060>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [August 16, 2007, 10:31am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060 "2007-08-16T10:31:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravi](https://community.sparkfun.com/u/ravi)\
**Post date:** [August 16, 2007, 10:31am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/1 "2007-08-16T10:31:52Z")

</div>

I’ve got these message while running openOCD on Redhat Enterprise.

I’m using olimex arm-usb-ocd connector and at91sam7s256 board

Info: openocd.c:92 main(): Open On-Chip Debugger (2007-07-31 19:00 CEST)

Info: configuration.c:50 configuration\_output\_handler(): Command ft2232\_device\_desc not found

Info: configuration.c:50 configuration\_output\_handler(): Command ft2232\_layout not found

Info: configuration.c:50 configuration\_output\_handler(): Command ft2232\_vid\_pid not found

Error: jtag.c:1457 jtag\_init(): No valid jtag interface found (ft2232)

Error: jtag.c:1458 jtag\_init(): compiled-in jtag interfaces:

My openocd.cfg file is:

#define our ports

telnet\_port 4444

gdb\_port 3333

#commands specific to the Amontec JTAGKey

interface ft2232

ft2232\_device\_desc “Olimex OpenOCD JTAG A”

ft2232\_layout “olimex-jtag”

ft2232\_vid\_pid 0x15BA 0x0003

jtag\_speed 2

jtag\_nsrst\_delay 200

jtag\_ntrst\_delay 200

#reset\_config [combination] [trst\_type] [srst\_type]

reset\_config srst\_only srst\_pulls\_trst

#jtag\_device

jtag\_device 4 0x1 0xf 0xe

#daemon\_startup \<‘attach’|‘reset’\>

daemon\_startup reset

#target \<reset\_mode\> \<jtag#\> [variant]

target arm7tdmi little run\_and\_init 0 arm7tdmi\_r4

#run\_and\_halt\_time \<target#\> \<time\_in\_ms\>

run\_and\_halt\_time 0 30

# commands below are specific to AT91sam7 Flash Programming

# ---------------------------------------------------------

#target\_script specifies the flash programming script file

target\_script 0 reset script.ocd

#working\_area \<target#\> \<‘backup’|‘nobackup’\>

working\_area 0 0x40000000 0x4000 nobackup

#flash bank at91sam7 0 0 0 0 \<target#\>

flash bank at91sam7 0 0 0 0 0

---

<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:** [August 16, 2007, 11:40am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/2 "2007-08-16T11:40:35Z")

</div>

It looks like you forgot to select the JTAG interfaces you want during ./configure:

```auto
Optional Features:
  --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
  --enable-parport Enable building the pc parallel port driver
  --enable-parport_ppdev Enable use of ppdev (/dev/parportN) for parport
  --enable-ft2232_libftdi Enable building support for FT2232 based devices
                          using the libftdi driver
  --enable-ft2232_ftd2xx Enable building support for FT2232 based devices
                          using the FTD2XX driver
  --enable-amtjtagaccel Enable building the Amontec JTAG-Accelerator driver
  --enable-ep93xx Enable building support for EP93xx based SBCs
  --enable-at91rm9200 Enable building support for AT91RM9200 based SBCs
  --enable-gw16012 Enable building support for the Gateworks GW16012
                          JTAG Programmer
  --enable-presto_libftdi Enable building support for ASIX Presto Programmer
                          using the libftdi driver
  --enable-presto_ftd2xx Enable building support for ASIX Presto Programmer
                          using the FTD2XX driver
  --enable-usbprog Enable building support for the usbprog JTAG
                          Programmer
  --enable-oocd_trace Enable building support for the OpenOCD+trace ETM
                          capture device
  --enable-parport_giveio Enable use of giveio for parport instead of ioperm

```

For the ARM-USB-OCD you need at least --enable-ft2232\_ftd2xx or --enable-ft2232\_libftdi (depending on which FTDI FT2232 access library you want).

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![ravi](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravi](https://community.sparkfun.com/u/ravi)\
**Post date:** [August 16, 2007, 11:54am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/3 "2007-08-16T11:54:12Z")

</div>

I’ve tried that also after ./configure --enable-ft2232\_libftdi

and when i type make i get the following error.

[root@localhost open\_ocd]# make

ft2232.c:47:18: ftdi.h: No such file or directory

ft2232.c: In function `ft2232\_init\_libftdi’:

ft2232.c:1430: error: invalid use of undefined type `struct ftdi\_context’

ft2232.c:1433: error: invalid use of undefined type `struct ftdi\_context’

ft2232.c:1438: error: `INTERFACE\_A’ undeclared (first use in this function)

ft2232.c:1438: error: (Each undeclared identifier is reported only once

ft2232.c:1438: error: for each function it appears in.)

ft2232.c:1440: error: invalid use of undefined type `struct ftdi\_context’

ft2232.c: In function `ft2232\_purge\_libftdi’:

ft2232.c:1475: error: invalid use of undefined type `struct ftdi\_context’

ft2232.c: At top level:

ft2232.c:140: error: storage size of `ftdic’ isn’t known

make[3]: \*\*\* [ft2232.o] Error 1

make[2]: \*\*\* [all-recursive] Error 1

make[1]: \*\*\* [all-recursive] Error 1

make: \*\*\* [all] Error 2

---

<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:** [August 16, 2007, 11:57am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/4 "2007-08-16T11:57:33Z")

</div>

Well, did you install libftdi along with its headers (usually there’s a lib\* package and a lib\*-dev containing the headers)?

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![ravi](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravi](https://community.sparkfun.com/u/ravi)\
**Post date:** [August 16, 2007, 2:33pm UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/5 "2007-08-16T14:33:34Z")

</div>

installed libftdi along with its headers now getting the following error

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

Error: ft2232.c:1433 ft2232\_init(): unable to open ftdi device:device not found

---

<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:** [August 16, 2007, 3:44pm UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/6 "2007-08-16T15:44:15Z")

</div>

Change the device description

ft2232\_device\_desc “Olimex OpenOCD JTAG A”

to

ft2232\_device\_desc “Olimex OpenOCD JTAG”

The " A" is a “hack” used by the windows version of FTD2XX to select channel A or channel B.

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![ravi](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravi](https://community.sparkfun.com/u/ravi)\
**Post date:** [August 17, 2007, 5:52am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/7 "2007-08-17T05:52:02Z")

</div>

when i’m trying to run the openocd i’m getting the following :

[root@localhost src]# ./openocd

Info: openocd.c:92 main(): Open On-Chip Debugger (2007-08-14 12:00 CEST)

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

Info: target.c:232 target\_init\_handler(): executing reset script ‘script.ocd’

Info: configuration.c:50 configuration\_output\_handler(): waiting for target h alted…

Info: configuration.c:50 configuration\_output\_handler(): target halted

Info: configuration.c:50 configuration\_output\_handler(): core state: ARM

Info: configuration.c:50 configuration\_output\_handler(): waiting for target h alted…

Info: configuration.c:50 configuration\_output\_handler(): target halted

Info: configuration.c:50 configuration\_output\_handler(): waiting for target h alted…

Info: configuration.c:50 configuration\_output\_handler(): target halted

Info: configuration.c:50 configuration\_output\_handler(): waiting for target h alted…

Info: configuration.c:50 configuration\_output\_handler(): target halted

Info: configuration.c:50 configuration\_output\_handler(): wrote 4992 byte fro m file main.bin to flash bank 0 at offset 0x00000000 in 0s 920150us (5.298049 kb /s)

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

[root@localhost src]#

---

<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:** [August 17, 2007, 8:50am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/8 "2007-08-17T08:50:24Z")

</div>

Your configuration file told the OpenOCD to reset all connected targets at startup:

daemon\_startup reset

Then it stated that your target should reset in “run\_and\_init” mode, i.e. after reset it’s allowed to run for some time, then halted and initialized using a target\_script.

The target\_script line specified that target #0 should execute the script.ocd after a reset.

That’s what happened - apparently you wrote something to your uCs flash. It’s not clear to me if this is what you wanted, or if this was a question at all.

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![ravi](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravi](https://community.sparkfun.com/u/ravi)\
**Post date:** [August 17, 2007, 10:47am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/9 "2007-08-17T10:47:07Z")

</div>

could u send me cfg file and script file for AT91SAM7S256, ARM-USB-OCD.

---

<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:** [August 17, 2007, 11:36am UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/10 "2007-08-17T11:36:05Z")

</div>

Hi,

sorry, but I really don’t understand what your problem is. Your .cfg file and the script you used worked perfectly fine, the file main.bin was apparently successfully written to your target’s flash.

Maybe I could help you if you told me what you expected to see.

If you didn’t want to write to flash, but rather debug your application, you should just change the “target … run\_and\_init” to “target … run\_and\_halt”. This tells the OpenOCD to just halt without executing a reset script. You can then connect using either a telnet session to localhost port 4444 or via GDB to port 3333.

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![ravi](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravi](https://community.sparkfun.com/u/ravi)\
**Post date:** [August 17, 2007, 1:15pm UTC](https://community.sparkfun.com/t/error-while-running-openocd/5060/11 "2007-08-17T13:15:36Z")

</div>

Hi,

Thanks for ur replies, i got it working now.

Ijust wanted to know one thing .How many days did u spend on developing OpenOCD?

Regards,

Ravi
