EmbeddedRelated.com
Forums

erase flash

Started by kd7vn April 14, 2008
I'm working with a olimex lpc-p2387 dev board, openocd rev 568. Some
how I have some memory in flash that I can't erase. I'm not sure if
this means anything but when I first telnet in and halt the target I
get the following.
target state: halted
target halted in Thumb state due to debug request, current mode:
Supervisor
cpsr: 0xa00000f3 pc: 0x7fffe13c

What is catches my eye is the "Thumb state", I never used thumb or set
any thumb mode. That may be a red harrying I don't know.

A dump of the first few memory sectors reveals the following.
mdw 0x0 24
0x00000000: e59f4018 e59f5010 e5946000 e0056006 e5846000 e51ff004
7fffe040 ffffbfff
0x00000020: 3fff8000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
0x00000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff
>flash erase_sector 0 0 26, will return without error but the memory
remains unchanged.

>flash erase_check confirms that the first 4kb are not erased.
successfully checked erase state
#0: 0x00000000 (0x1000 4kB) not erased
#1: 0x00001000 (0x1000 4kB) erased

Another odd aspect to the problem is that of "protection", a quick run
of flash info 0 shows all sectors are protected.

> flash info 0
#0: lpc2000 at 0x00000000, size 0x00080000, buswidth 0, chipwidth 0
#0: 0x00000000 (0x1000 4kB) protected
#1: 0x00001000 (0x1000 4kB) protected

However, I can't seem to render them unprotected. This command
returns without error.....
> flash protect 0 0 26 off
cleared protection for sectors 0 through 26 on flash bank 0

yet flash info 0 indicates nothing has changed.
> flash info 0
#0: lpc2000 at 0x00000000, size 0x00080000, buswidth 0, chipwidth 0
#0: 0x00000000 (0x1000 4kB) protected
#1: 0x00001000 (0x1000 4kB) protected

The commands fillw, fillh, fillb, mww, mwh, and mwb are equally
unsuccessful at clearing the first few sectors.

> mww 0x0 0xffffffff 16
memory write caused data abort (address: 0x00000000, size: 0x4, count:
0x1)

The type of ftdi driver used with openocd makes no difference.

PLEASE help me, it would be greatly appreciated.

Recent search results here and on google to switch from thumb mode to
arm mode were not fruitful. Perhaps I'm just not using a broad
enough vocabulary, I'm still new at this, in my searches. Even
suggestions on how to research this would be great.

thank you for your time,
Markus

An Engineer's Guide to the LPC2100 Series