Erase flash with Openocd and olimex arm-usb-tiny jtag

Hi to all.

After many attempts I have find the configuration file for use my Olimex arm-usb-tiny jtag.

Now I can write the flash of my lpc2148 with the comand:

openocd-ftd2xx -f configuration.cfg flash write_image main.out

But now I can’t to erase the flash and, when I want to write a new image, remains the old file written.

How I can erase the flash of my board???

PS: I paste the .cfg file:

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0004
jtag_speed 3

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

#jtag scan chain
jtag_device 4 0x1 0xf 0xe

#target configuration
#####daemon_startup reset

target arm7tdmi little run_and_halt 0 
#arm7tdmi-s_r4
run_and_halt_time 0 30

target_script 0 reset oocd_flash_lpc2148.script
working_area 0 0x40000000 0x4000 nobackup

flash bank lpc2000 0x0 0x80000 0 0 0 lpc2000_v2 12000 calc_checksum

[/code]

Good day,

It is important to realise that OCD has two components to it: a server side (openocd with its specific configuration options) and the client side that drives it.

As far as I know, three client side interfaces are provided: GNU Debug (gdb), Telnet and Tcl.

I usually use the telnet interface. In the config options provided to the openocd server, there is probably a line like:

telnet_port 4444

To use the telnet interface, first launch openocd. Then from another shell, type:

telnet localhost 4444

You should now be on the telnet prompt, ready to issue commands to the openocd server.

I only have a ST STR912 (ARM9) to play with, so, I’ll give you the commands as they apply to me. You’ll have to adopt them for your environment:

Hope that these commands point you in the right direction

Regards,

Frikkie Thirion

reset halt

str9x flash_config 0 4 2 0 0x80000

(Note: This is absolutely mandatory on the STR9 if you want any of the other flash

commands to work properly)

flash protect 0 0 0 off

(Disable write protection on flash bank 0, sector 0)

flash protect_check 0

flash info 0

#0: str9x at 0x00000000, size 0x00080000, buswidth 0, chipwidth 0

0: 0x00000000 (0x10000 64kB) not protected

(Note: The status of bank 0 now indicates: not protected)

(Note: Use flash protect_check and flash info together to obtain consitent results)

flash erase_sector 0 0 0

flash erase_check 0

successfully checked erase state

0: 0x00000000 (0x10000 64kB) erased

flash write_image main.hex 0 ihex

wrote 33788 byte from file main.hex in 2.924507s (11.282617 kb/s)