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

**URL:** <https://community.sparkfun.com/t/olimex-lpc2013-board-openocd-wiggler-cannot-erase-pgm-flash/5972>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [December 17, 2007, 12:00am UTC](https://community.sparkfun.com/t/olimex-lpc2013-board-openocd-wiggler-cannot-erase-pgm-flash/5972 "2007-12-17T00:00:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krisk](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@krisk](https://community.sparkfun.com/u/krisk)\
**Post date:** [December 17, 2007, 12:00am UTC](https://community.sparkfun.com/t/olimex-lpc2013-board-openocd-wiggler-cannot-erase-pgm-flash/5972/1 "2007-12-17T00:00:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![geckosenator](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@geckosenator](https://community.sparkfun.com/u/geckosenator)\
**Post date:** [January 10, 2008, 9:58am UTC](https://community.sparkfun.com/t/olimex-lpc2013-board-openocd-wiggler-cannot-erase-pgm-flash/5972/2 "2008-01-10T09:58:57Z")

</div>

I have the same problem

---

<div class="post-metadata">

**Author:** ![krisk](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@krisk](https://community.sparkfun.com/u/krisk)\
**Post date:** [January 13, 2008, 11:15pm UTC](https://community.sparkfun.com/t/olimex-lpc2013-board-openocd-wiggler-cannot-erase-pgm-flash/5972/3 "2008-01-13T23:15:05Z")

</div>

> 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
