flash write_image problem

Hi everyone!

Since I use ubuntu 10.10 (before I was on ubuntu 10.04), openocd seems not working anymore. I use JTAGKey-tiny from amontec with stm32.

Firstly when I launch openocd I’ve got this message:

Open On-Chip Debugger 0.4.0 (2010-10-08-15:44)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.berlios.de/doc/doxygen/bugs.html
800 kHz
500 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
Warn : cortex_m3.bs: nonstandard IR mask
Error: usage: flash bank <name> <driver> <base> <size> <chip_width> <bus_width>
Command handler execution failed
Info : clock speed 500 kHz
Info : JTAG tap: cortex_m3.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: cortex_m3.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
Info : cortex_m3.cpu: hardware has 6 breakpoints, 4 watchpoints

here is my openocd.cfg file:

interface ft2232
ft2232_device_desc "Amontec JTAGkey"
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8
jtag_khz 800

# script for stm32

set CHIPNAME cortex_m3
set ENDIAN little

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

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

# jtag speed
jtag_khz 500

jtag_nsrst_delay 100
jtag_ntrst_delay 100

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

#jtag scan chain
if { [info exists CPUTAPID ] } {
   set _CPUTAPID $CPUTAPID
} else {
  # See STM Document RM0008
  # Section 26.6.3
   set _CPUTAPID 0x3ba00477
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

if { [info exists BSTAPID ] } {
   set _BSTAPID $BSTAPID
} else {
  # See STM Document RM0008
  # Section 26.6.2
  # Low density devices, Rev A
  set _BSTAPID1 0x06412041
  # Medium density devices, Rev A
  set _BSTAPID2 0x06410041
  # Medium density devices, Rev B and Rev Z
  set _BSTAPID3 0x16410041
  # High density devices, Rev A
  set _BSTAPID4 0x06414041
}   

jtag newtap $_CHIPNAME bs  -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID1 -expected-id $_BSTAPID2 -expected-id $_BSTAPID3 -expected-id $_BSTAPID4

set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 65536 -work-area-backup 0

flash bank stm32x 0 0 0 0 0
# For more information about the configuration files, take a look at:
# openocd.texi

The problem come from this line: flash bank stm32x 0 0 0 0 0 // That line is wrong?

However I can still connect with telnet on my device. And when I try to flash the stm32 with this command : flash write_image erase app-jtag.bin 0x08000000 bin I get this error message:

> flash write_image erase app-jtag.bin 0x08000000 bin
flash write_image erase app-jtag.bin 0x08000000 bin: command requires more arguments
in procedure 'flash' called at file "command.c", line 650
called at file "command.c", line 361

Do you know where is the problem?

Thanks a lot

Jocelyn