OpenOCD error [Solved]

Dear All,

I am using ARM-USB-OCD JTEG tool and Eclipse 3.3 platform, When i run a sample program to LPC2148 using OpenOCD i got the following error

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

Error: embeddedice. c:181 embeddedice_ build_reg_ cache(): unknown

EmbeddedICE version (comms ctrl: 0x80000000)

Warning: arm7_9_common. c:734 arm7_9_assert_ reset(): srst resets test logic, too

Error: armv4_5.c:186 armv4_5_mode_ to_number( ): invalid mode value

encountered

Error: arm7_9_common. c:1075 arm7_9_debug_ entry(): cpsr contains

invalid mode value - communication failure

Error: target.c:1157 handle_target( ): couldn’t poll target, exiting

Can anyone help me

Thanks in advance.

Karuna

I will answer your post here as cross posting is confusing to everybody.

Could you enable debug info and show us the versions/config etc you are using.

Also there should be a lot of info about setup/debugging the 2148 on this forum - try searching, this may help.

Regards

Spen

I am newbie to this ARM and OpenOCD.

I have installed the following from yagarto.de website.

Open On-Chip Debugger (2.45 MB)

YAGARTO GNU ARM toolchain (33 MB)

Integrated Development Environment (59 MB)

And using the LPC2148Test tested with an Olimex LPC-P2148 development board test code

From Eclipse environment i have call openocd to run a program, thru ARM-USB-OCD jtag tool, that time i got these errors.

I have already checked this forum, no one is faced this kind of problem.

That is why i am posted my querry here

I have not used a 2148 but will try my best to help.

Can you show us your config script used, and enable debug info as follows:

openocd -d3 -lopenocd.log

Cheers

Spen

Hello Karuna,

which version of OpenOCD you are using?

Start openocd with: “-h” options.

Btw, you can find a LPC2148 example here too:

http://www.yagarto.de/howto/yagarto1/index.html

At the same page you will get the howto for Insight. Is Insight

working at your side?

Best regards,

Michael

Dear Michal,

Here is the release version.

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

Open On-Chip Debugger

(c) 2005 by Dominic Rath

(snapshot r204 from SVN tree + giveio, no official release, compiled my mifi)

–help | -h display this help

–file | -f use configuration file

–debug | -d set debug level <0-3>

–log_output | -l redirect log output to file

Karuna

Dear Spen,

Here is my configuration file. I haven’t changed anything.

daemon configuration

telnet_port 4444

gdb_port 3333

##sgdb_port 2331

#interface

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG A”

ft2232_layout “olimex-jtag”

ft2232_vid_pid 0x15BA 0x0003

jtag_speed 2

#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

working_area 0 0x40000000 0x40000 nobackup

#flash bank lpc2000 0 0 <target#>

flash bank lpc2000 0x0 0x7d000 0 0 0 lpc2000_v2 14765 calc_checksum

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

http://openfacts.berlios.de/index-en.ph … p+Debugger

Karuna

Hello Karuna,

do you use an evalboard or do you have an own design?

Have you use the OpenOCD with the debug options like

Spen told you?

Regards,

Michael

Dear Michael,

Here is my working environemnt

  1. OLIMEX LPC2148 header board and KEIL MCB2140 EVL board (i am not using my own design)

  2. OLIMEX ARM-USB-OCD JTAG tool

  3. Eclipse 3.3 Platform with OpenOCD version “openocd-2007re204”

I just installed the software listed in http://www.yagarto.de/ website.

And by using the sampel code LPC2148Test which is download from this http://www.yagarto.de/howto/yagarto2/index.html link and follow the procedure to create project in eclipse platform and compiled the code.

Also i run the code in dos prompt and the result is same.

Here is the log file,

D:\Yagarto\LPC214~1>openocd-ftd2xx -d3 -lopenocd.log -f .\prj\openocd.cfg

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

Debug: jtag.c:1407 jtag_init(): -

Debug: ft2232.c:1296 ft2232_init_ftd2xx(): ‘ft2232’ interface using FTD2XX with ‘olimex-jtag’ layout (15ba:0003)

Debug: ft2232.c:1385 ft2232_init_ftd2xx(): current latency timer: 2

Debug: ft2232.c:1732 olimex_jtag_init(): 80 08 1b

Debug: ft2232.c:1775 olimex_jtag_init(): 82 09 0f

Debug: ft2232.c:253 ft2232_speed(): 86 02 00

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1197 jtag_reset_callback(): -

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1197 jtag_reset_callback(): -

Error: jtag.c:1253 jtag_examine_chain(): JTAG communication failure, check connection, JTAG interface, target power etc.

Error: jtag.c:1440 jtag_init(): trying to validate configured JTAG chain anyway…

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1197 jtag_reset_callback(): -

Debug: openocd.c:113 main(): jtag init complete

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST released

Debug: jtag.c:1197 jtag_reset_callback(): -

Error: embeddedice.c:181 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)

Debug: arm7_9_common.c:707 arm7_9_assert_reset(): target->state: unknown

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: SRST asserted

Debug: jtag.c:1197 jtag_reset_callback(): -

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1197 jtag_reset_callback(): -

Warning: arm7_9_common.c:734 arm7_9_assert_reset(): srst resets test logic, too

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: SRST asserted

Debug: jtag.c:1197 jtag_reset_callback(): -

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1197 jtag_reset_callback(): -

Debug: ft2232.c:993 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x02, high_direction: 0x0f

Debug: ft2232.c:993 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x02, high_direction: 0x0f

Debug: arm7_9_common.c:773 arm7_9_deassert_reset(): target->state: reset

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: SRST released

Debug: jtag.c:1197 jtag_reset_callback(): -

Debug: ft2232.c:993 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f

Debug: openocd.c:117 main(): target init complete

Debug: openocd.c:121 main(): flash init complete

Debug: openocd.c:125 main(): NAND init complete

Debug: openocd.c:129 main(): pld init complete

Debug: gdb_server.c:1451 gdb_init(): gdb service for target arm7tdmi at port 3333

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1

Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST released

Debug: jtag.c:1197 jtag_reset_callback(): -

Debug: arm7_9_common.c:929 arm7_9_halt(): target->state: running

Debug: embeddedice.c:384 embeddedice_write_reg(): 9: 0xffffffff

Debug: embeddedice.c:384 embeddedice_write_reg(): 11: 0xffffffff

Debug: embeddedice.c:384 embeddedice_write_reg(): 12: 0x00000100

Debug: embeddedice.c:384 embeddedice_write_reg(): 13: 0x000000f7

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4

Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1

And it is keep going, i just break console window…

Karuna.

Hi Karuna,

it looks that you have problem with the power perhaps:

Error: jtag.c:1253 jtag_examine_chain(): JTAG communication failure, check connection, JTAG interface, target power etc.

How is the LPC1248 header board powered?

I believe that the header board must be powerd by USB, have you plug

in the USB cable?

Regards,

Michael

Dear Michael,

Yes, the header board is power by USB cable.

I have checked with KEIL MCB2140 EVL board, when i plug in usb cable, all the LEDs are glowing.

Karuna

Hello Karuna,

have you try to connect the ARM-USB-OCD from olimex at a powered hub too? Here I had problems with the ARM-USB-OCD at my pc.

Do you have an other JTAG adapter, or is this your only one?

Regards,

Michael

Dear Michael,

Thanks for your good support. Now i have confident on solving this issue with the help of you. I am struggling with this problem for past 1 week.

I haven’t checked with power hub, i will check it now.

I have ULINK2 JTAG, when i run a sample program using KEIL IDE the LPC2148 header board is responding well and i can see some debug information. So i guess there may be no power supply problem in LPC2148 board.

I don’t know why the OpenOCD is unable to communicate with LPC2148.

Karuna.

Try adding the following to the config script:

jtag_nsrst_delay 100

jtag_ntrst_delay 100

Regards

Spen

Dear Spen,

I have added these commands and checked. I got the same result.

Karuna.

try slowing down the jtag:

jtag_speed 10

other than that i am running out of ideas.

Just for info the variant, eg. arm7tdmi-s_r4 is not required anymore.

Cheers

Spen

Dear Spen,

Thanks for your suggesstion, when i add this delay. I got the following print and there is not ouput at target…

D:\Yagarto\LPC2148Test>openocd-ftd2xx -f .\prj\openocd.cfg

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

Warning: arm7_9_common.c:734 arm7_9_assert_reset(): srst resets test logic, too

Warning: arm7_9_common.c:933 arm7_9_halt(): target was already halted

Karuna

I would like to thank Mr. Spen and Mr. Michael for their support to run openocd debugger in my LPC2148 target board.

I just followed the procedure in the below link to run the debugger and insight exe and your suggesstions.

http://www.yagarto.de/howto/yagarto1/index.html

And i succeed.

Thanks

Karuna

Hi all,

I have the same problem on Windows Vista. I’m using openOCD 204, ARM-USB-TINY. Here’s what I get:

Error: ft2232.c:1341 ft2232_init_ftd2xx(): unable to open ftdi device: 2

Error: ft2232.c:1356 ft2232_init_ftd2xx(): ListDevices: 2

Error: ft2232.c:1358 ft2232_init_ftd2xx(): 0: Olimex OpenOCD JTAG TINY B

Error: ft2232.c:1358 ft2232_init_ftd2xx(): 1: Xš:

This is the part of the config that matters:

#interface

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG TINY A”

ft2232_layout “olimex-jtag”

ft2232_vid_pid 0x15BA 0x0004

jtag_speed 20

What is the solution?

Thanks,

Gil

Problem solved with this config:

telnet_port 4444

gdb_port 3333

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG TINY A”

ft2232_layout “olimex-jtag”

ft2232_vid_pid 0x15BA 0x0004

jtag_speed 20

reset_config trst_and_srst separate

jtag_device 4 0x1 0xf 0xe

jtag_nsrst_delay 333

jtag_ntrst_delay 333

daemon_startup reset

target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4

run_and_halt_time 0 30

target_script 0 reset oocd_flash2294.script

working_area 0 0x40000000 0x4000 nobackup

flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 14746 calc_checksum

Thanks,

Gil