Error while running openOCD

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

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

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

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

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

Regards,

Dominic

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

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

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]#

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

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

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

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