Olimex LPC2013 board+OpenOCD+Wiggler: cannot erase/pgm flash

Hello,

I think I am doing something fundamentally stupid. I wonder if somebody competent could have a quick look at the following config file + telnet transcript and tell me why the flash is always protected and why I cannot erase it (or write anything there).

Thanks a lot,

Kris

---------------- openocd.cfg -------------------

telnet_port 2002

gdb_port 2001

interface parport

parport_port 0x378

parport_cable wiggler

jtag_speed 10

reset_config trst_and_srst trst_pulls_srst

jtag_device 4 0x1 0xf 0xe

daemon_startup reset

target arm7tdmi little run_and_init 0 arm7tdmi-s_r4

run_and_halt_time 0 30

working_area 0 0x40000000 0x2000 nobackup

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

------------------------ telnet transcript ----------------------

w20>telnet localhost 2002

Trying 127.0.0.1…

Connected to w2000.

Escape character is ‘^]’.

Open On-Chip Debugger

halt

requesting target halt…

Target 0 halted

target halted in Thumb state due to debug request, current mode: System

cpsr: 0x4000001f pc: 0x00000560

flash probe 0

flash ‘lpc2000’ found at 0x00000000

flash info 0

#0: lpc2000 at 0x00000000, size 0x00040000, buswidth 0, chipwidth 0

#0: 0x00000000 (0x2000kB) erase state unknown, protected

#1: 0x00002000 (0x2000kB) erase state unknown, protected

#2: 0x00004000 (0x2000kB) erase state unknown, protected

#3: 0x00006000 (0x2000kB) erase state unknown, protected

#4: 0x00008000 (0x2000kB) erase state unknown, protected

#5: 0x0000a000 (0x2000kB) erase state unknown, protected

#6: 0x0000c000 (0x2000kB) erase state unknown, protected

#7: 0x0000e000 (0x2000kB) erase state unknown, protected

#8: 0x00010000 (0x10000kB) erase state unknown, protected

#9: 0x00020000 (0x10000kB) erase state unknown, protected

#10: 0x00030000 (0x2000kB) erase state unknown, protected

#11: 0x00032000 (0x2000kB) erase state unknown, protected

#12: 0x00034000 (0x2000kB) erase state unknown, protected

#13: 0x00036000 (0x2000kB) erase state unknown, protected

#14: 0x00038000 (0x2000kB) erase state unknown, protected

#15: 0x0003a000 (0x2000kB) erase state unknown, protected

#16: 0x0003c000 (0x2000kB) erase state unknown, protected

#17: 0x0003e000 (0x2000kB) erase state unknown, protected

lpc2000 flash driver variant: 1, clk: 0

flash protect 0 0 7 off

cleared protection for sectors 0 through 7 on flash bank 0

flash info 0

#0: lpc2000 at 0x00000000, size 0x00040000, buswidth 0, chipwidth 0

#0: 0x00000000 (0x2000kB) erase state unknown, protected

#1: 0x00002000 (0x2000kB) erase state unknown, protected

#2: 0x00004000 (0x2000kB) erase state unknown, protected

#3: 0x00006000 (0x2000kB) erase state unknown, protected

#4: 0x00008000 (0x2000kB) erase state unknown, protected

#5: 0x0000a000 (0x2000kB) erase state unknown, protected

#6: 0x0000c000 (0x2000kB) erase state unknown, protected

#7: 0x0000e000 (0x2000kB) erase state unknown, protected

#8: 0x00010000 (0x10000kB) erase state unknown, protected

#9: 0x00020000 (0x10000kB) erase state unknown, protected

#10: 0x00030000 (0x2000kB) erase state unknown, protected

#11: 0x00032000 (0x2000kB) erase state unknown, protected

#12: 0x00034000 (0x2000kB) erase state unknown, protected

#13: 0x00036000 (0x2000kB) erase state unknown, protected

#14: 0x00038000 (0x2000kB) erase state unknown, protected

#15: 0x0003a000 (0x2000kB) erase state unknown, protected

#16: 0x0003c000 (0x2000kB) erase state unknown, protected

#17: 0x0003e000 (0x2000kB) erase state unknown, protected

lpc2000 flash driver variant: 1, clk: 0

mdw 0 128

0x00000000: e59ff018 ffffffff ffffffff ffffffff ffffffff 34c01fd5 e59ff018 ffffffff

0x00000020: 00000098 ffffffff ffffffff ffffffff ffffffff ffffffff 000001e4 ffffffff

0x00000040: 47702001 48134a12 b081b470 1d121c11 680be00a 68156854 d0032b00 5ce61e5b

… snip

flash erase 0 0 7

erased sectors 0 through 7 on flash bank 0 in 0s 921325us

mdw 0 128

0x00000000: e59ff018 ffffffff ffffffff ffffffff ffffffff 34c01fd5 e59ff018 ffffffff

0x00000020: 00000098 ffffffff ffffffff ffffffff ffffffff ffffffff 000001e4 ffffffff

0x00000040: 47702001 48134a12 b081b470 1d121c11 680be00a 68156854 d0032b00 5ce61e5b

… snip

I have the same problem

geckosenator:
I have the same problem

OK, the line for LPC2000 flash should look like this:

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

i.e., the zero preceding the clock rate should be removed. According to the new format, it now occurs before the variant (lpc2000_v2). I copied the file from some place with that error. Now it seems to work.

Kris