Problem ARM-USB-TINY-H and at91sam7s256

Hi,

I’m a beginner with all this stuff and i have a problem that i can’t fixed :o

I’m using Eclipse/ARM-USB-TINY-H and a AT91sam7s256 microcontroler. I have the following configuration file :

daemon configuration

########################

telnet_port 4444

gdb_port 3333

interface : wigler olimex

#############################

#interface parport

#parport_port 0

#parport_cable wiggler

#jtag_speed 0

interface : arm-usb-ocd olimex

##################################

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG”

ft2232_layout olimex-jtag

ft2232_vid_pid 0x15ba 0x0003

jtag_speed 3

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

reset_config srst_only 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

#daemon_startup attach

jtag_nsrst_delay 100

jtag_ntrst_delay 100

target

target arm7tdmi [variant]

target arm7tdmi little run_and_halt 0 arm7tdmi

run_and_halt_time 0 30

flash configuration

flash bank <chip_width> <bus_width> <target#>

flash bank at91sam7 0 0 0 0 0

zone de travail pour la gestion d’une flash cfi

je pense que cette zone ne sert pas a autre chose

mais je n’en suis pas sur…

working_area 0 0x00200000 0x4000 nobackup

cfi options

flash bank cfi <chip_width> <bus_width> <target#>

but when i start openocd with eclipse i have this error :

Runtime error, file “at91sam7s256-armusbocd.cfg”:

invalid command name “jtag_speed”

I try to change “jtag-speed 2” by “jtag_khz 1500” but when i do that the error is : invalid command name “jtag_device”

So if anyone could help me i would be greatful :slight_smile:

and i apologise for my english !

Thanks in advance,

Regards,

hello pichnochio,

which version of openocd do you use? it seems to be, that you cfg-file is quite old…

some of the command names changed with newer versions of openocd.

below I show you the actual configuration file for your target, used by openocd 0.5.0-dev

The line with “jtag newtap $_CHIPNAME…” describes the jtag device.

#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config srst_only srst_pulls_trst

if { [info exists CHIPNAME] } {
   set  _CHIPNAME $CHIPNAME
} else {
   set  _CHIPNAME sam7x256
}

if { [info exists ENDIAN] } {
   set  _ENDIAN $ENDIAN
} else {
   set  _ENDIAN little
}

if { [info exists CPUTAPID ] } {
   set _CPUTAPID $CPUTAPID
} else {
   set _CPUTAPID 0x3f0f0f0f
}

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi

$_TARGETNAME configure -event reset-init {
	# disable watchdog
	mww 0xfffffd44 0x00008000
	# enable user reset
	mww 0xfffffd08 0xa5000001
	# CKGR_MOR : enable the main oscillator
	mww 0xfffffc20 0x00000601
	sleep 10
	# CKGR_PLLR: 96.1097 MHz
	mww 0xfffffc2c 0x00481c0e
	sleep 10
	# PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
	mww 0xfffffc30 0x00000007
	sleep 10
	# MC_FMR: flash mode (FWS=1,FMCN=60)
	mww 0xffffff60 0x003c0100
	sleep 100
}

$_TARGETNAME configure -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0

#flash bank <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME at91sam7 0 0 0 0 $_TARGETNAME 0 0 0 0 0 0 0 18432

If you are using windows, you can find windows-binaries of openocd on http://www.freddiechopin.info/index.php/en

best regards!

Stefan

Hello Stefan, and thanks for your reply.

I will take a look, but i think you found my problem.

Regards,

Hi,

Indeed it was my Openocd version which was wrong, but i have an other problem :slight_smile:

So, i use the interface configuration file :olimex-arm-usb-tiny-h.cfg with the file that Stefan posts.

And this is what i have :

srst_only srst_pulls_trst srst_gates_jtag srst_open_drain

Info : max TCK change to: 30000 kHz

Info : clock speed 30000 kHz

Info : JTAG tap: sam7x256.cpu tap/device found: 0x7f1f1f1f (mfg: 0x78f, part: 0xf1f1, ver: 0x7)

Warn : JTAG tap: sam7x256.cpu UNEXPECTED: 0x7f1f1f1f (mfg: 0x78f, part: 0xf1f1, ver: 0x7)

Error: JTAG tap: sam7x256.cpu expected 1 of 1: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)

Error: Trying to use configured scan chain anyway…

Error: sam7x256.cpu: IR capture error; saw 0x03 not 0x01

Info : JTAG tap: sam7x256.cpu tap/device found: 0x7f1f1f1f (mfg: 0x78f, part: 0xf1f1, ver: 0x7)

Warn : JTAG tap: sam7x256.cpu UNEXPECTED: 0x7f1f1f1f (mfg: 0x78f, part: 0xf1f1, ver: 0x7)

Error: JTAG tap: sam7x256.cpu expected 1 of 1: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)

Error: Trying to use configured scan chain anyway…

Error: sam7x256.cpu: IR capture error; saw 0x03 not 0x01

Command handler execution failed

Warn : jtag initialization failed; try ‘jtag init’ again.

So if somebody can help a beginner :stuck_out_tongue:

Thanks in advance,

Regards,

Hi,

try to reduce your jtag speed, might be its to fast.

just change your olimex-arm-usb-tiny-h.cfg to:

interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15ba 0x002a
jtag_khz 15000
jtag_nsrst_delay 200
jtag_ntrst_delay 200

and try again.

Best Regards