Error: unknown EmbeddedICE version?

I have just downloaded and installed the latest YAGARTO package, as instructed in the J Linch tutorial "Using Open Source Tools for AT91SAM7S Cross Development ", Revision 2 Ocober 2006.

When I run openocd-2007re141, either in eclipse or on the command prompt. I always get this error:

Info: openocd.c.86 main(): Open On-Chip Debugger (2007-04-16 19:30 CEST)
Error: openocd.c:181 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)
Warining: arm7_9_common.c:685 arm7_9 assert_reset(): srst resets logic too

The ARM-USB-OCD device flashes yellow and orange and then hangs in this state.

What could be the cause of my error?

Which target board do you use? What’s the setting of “jtag_speed”?

Regards,

Dominic

Hi

The jtag speed is set to 2.

I am using the Olimex P256 board, which has AT91SAM7S256.

I downloaded the J Lynch example project, from Atmel.

The config file was included in the download:

“at91sam7s256-armusbocd-flash-program.cfg”

#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 <signals> [combination] [trst_type] [srst_type]
reset_config srst_only srst_pulls_trst

#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
jtag_device 4 0x1 0xf 0xe

#daemon_startup <'attach'|'reset'>
daemon_startup reset

#target <type> <endianess> <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 c:\temp\temp.ocd

#working_area <target#> <address> <size> <'backup'|'nobackup'>
working_area 0 0x40000000 0x4000 nobackup

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

Regards

Mark

Hi Mark.

I’m revising my tutorial and have just downloaded the latest YAGARTO and tried it with the same sample program you are using - it works OK.

There have been reports of problems with the latest version of YAGARTO if you have an older revision of the JAVA JRE. Could you go to the Sun web site and make sure you have the “latest and greatest”?

I’m using Sun Java JRE version 1.6.0_01

Cheers,

Jim Lynch

OK, done that.

I have uninstalled JRE 1.5.0_10 that and installed JRE 1.6.0_1 as your system. However, the problem is still there.

temp.ocd:

wait_halt 
armv4_5 core_state arm 
mww 0xffffff64 0x5a000004
mww 0xffffff64 0x5a002004
flash write 0 main.bin 0x0
mww 0xfffffd08 0xa5000401
reset
shutdown

Output in eclipse:

make -k program 
Preparing OpenOCD script...
Flash Programming with OpenOCD...
'c:\Program Files\openocd-2007re141\bin\'openocd-ftd2xx.exe -f 'c:\Program Files\openocd-2007re141\bin\'at91sam7s256-armusbocd-flash-program.cfg
Info:    openocd.c:86 main(): Open On-Chip Debugger (2007-04-16 19:30 CEST)
Error:   embeddedice.c:181 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)
Warning: arm7_9_common.c:685 arm7_9_assert_reset(): srst resets test logic, too

Hi again Mark.

Here’s what I’m using in my latest tutorial revision (out in a few days).


OpenOCD configuration file for Olimex ARM-USB-OCD


#define our ports

telnet_port 4444

gdb_port 3333

#commands specific to the Amontec JTAGKey

interface ft2232

ft2232_device_desc “Amontec JTAGkey A”

ft2232_layout jtagkey

ft2232_vid_pid 0x0403 0xcff8

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


script.ocd file required by OpenOCD for flash programming (put in Eclipse project)


wait_halt

armv4_5 core_state arm

mww 0xffffff60 0x00320100

mww 0xfffffd44 0xa0008000

mww 0xfffffc20 0xa0000601

wait 100

mww 0xfffffc2c 0x00480a0e

wait 200

mww 0xfffffc30 0x7

wait 100

mww 0xfffffd08 0xa5000401

flash write 0 main.bin 0x0

reset

shutdown


Auxillary target in Makefile to program flash


**********************************************************************************************

FLASH PROGRAMMING

Alternate make target for flash programming only

You must create a special Eclipse make target (program) to run this part of the makefile

(Project → Create Make Target… then set the Target Name and Make Target to “program”)

OpenOCD is run in “batch” mode with a special configuration file and a script file containing

the flash commands. When flash programming completes, OpenOCD terminates.

Note that the script file of flash commands (script.ocd) is part of the project

Programmers: Martin Thomas, Joseph M Dupre, James P Lynch

**********************************************************************************************

specify output filename here (must be *.bin file)

TARGET = main.bin

specify the directory where openocd executable resides (openocd-ftd2xx.exe or openocd-pp.exe)

OPENOCD_DIR = 'c:\Program Files\openocd-2007re141\bin'

specify OpenOCD executable (pp is for the wiggler, ftd2xx is for the USB debuggers)

#OPENOCD = $(OPENOCD_DIR)openocd-pp.exe

OPENOCD = $(OPENOCD_DIR)openocd-ftd2xx.exe

specify OpenOCD configuration file (pick the one for your device)

#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-wiggler-flash-program.cfg

#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-jtagkey-flash-program.cfg

OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-armusbocd-flash-program.cfg

program the AT91SAM7S256 internal flash memory

program: $(TARGET)

@echo “Flash Programming with OpenOCD…”

$(OPENOCD) -f $(OPENOCD_CFG)

@echo “Flash Programming Finished.”

You may notice that this time, I’ve put the OpenOCD script file right into the Eclipse project - this simplifies the alternate target in the makefile.

Your configuration file seems to have a mix up in it - there’s some Amontec instructions mixed in with the Olimex stuff. Give my version a whirl. The script file has register settings to set the AT91SAM7256 clocks to full speed. I would have commented them more, but OpenOCD still trips up on comments put in the GDB command stream.

Cheers,

Jim Lynch

OK. Thanks.

Unfortunately, I ran out of time last weekend.

I have tried many times to get this working over the last few months.

I am very determined! and your help is appreciated. I will have to come back to this in a couple of weeks as I have run out of spare time for now.

Thanks for the tutorial. I have read a few versions, and the setup gets better and easier with each revision. I look forward to reading next one.

Regards

Mark