EmbeddedRelated.com
Forums

Erase flash on LPC2138 via JTAG

Started by bmueller38 August 22, 2006
Hi everybody...

...another beginners problem.

I am unable to communicate with my LPC2138-Board from olimex using the
Philips Flash Utility. First it worked well, but now I can't even Read
the Chip-ID. I tried a newer version and another program (Flash
Magic). All without success.
The Board itself seems to be ok since the leds are still blinking
after reset.

I suppose I somehow corrupted the memory with my program!?

Next, I tried to fix it via JTAG using OpenOCD but I cannot erase the
flash.

> flash erase 0 0 14

leads to "flash erase error".

> flash info 0

says "...erase state unknown, protected" for all sectors.

> flash protect 0 0 14 off
> flash info 0

no reaction on first command, info says the same as above.

To me it seems as if I could not switch protection off and therefore
not erase flash!? Might that be?

Is there a way to Flash the board using UART1?
Or might the processor be damaged somehow?
Can somebody help me please?

thanks,
bjoern

An Engineer's Guide to the LPC2100 Series

>Original Message:
>-----------------
>From: bmueller38
>I am unable to communicate with my LPC2138-Board from olimex using the
>Philips Flash Utility. First it worked well, but now I can't even Read
>the Chip-ID. I tried a newer version and another program (Flash
>Magic). All without success.
>The Board itself seems to be ok since the leds are still blinking
>after reset.
>
>I suppose I somehow corrupted the memory with my program!?

More likely you didn't place it ISP mode. Have you set the jumpers
appropriately?

Robert

--------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
--- In l..., "bmueller38" wrote:
>

Hello bjoern,

I take it your UART0 is not RS232? I have a similar issue
and the Philips Flash Utility can only reflash using UART0.
I tried using Flash Magic, but I received the "Failed to read
device signature" error message. Did you enable Code Read
Protection in Flash Magic?

Marc
> Hi everybody...
>
> ...another beginners problem.
>
> I am unable to communicate with my LPC2138-Board from olimex using
the
> Philips Flash Utility. First it worked well, but now I can't even
Read
> the Chip-ID. I tried a newer version and another program (Flash
> Magic). All without success.
> The Board itself seems to be ok since the leds are still blinking
> after reset.
>
> I suppose I somehow corrupted the memory with my program!?
>
> Next, I tried to fix it via JTAG using OpenOCD but I cannot erase
the
> flash.
>
> > flash erase 0 0 14
>
> leads to "flash erase error".
>
> > flash info 0
>
> says "...erase state unknown, protected" for all sectors.
>
> > flash protect 0 0 14 off
> > flash info 0
>
> no reaction on first command, info says the same as above.
>
> To me it seems as if I could not switch protection off and
therefore
> not erase flash!? Might that be?
>
> Is there a way to Flash the board using UART1?
> Or might the processor be damaged somehow?
> Can somebody help me please?
>
> thanks,
> bjoern
>
> I take it your UART0 is not RS232? I have a similar issue
> and the Philips Flash Utility can only reflash using UART0.
> I tried using Flash Magic, but I received the "Failed to read
> device signature" error message. Did you enable Code Read
> Protection in Flash Magic?
>

The Jumpers are set correctly. As I said, it worked well with Philips
Flash Utility first, but now I can't even read the device ID.

UART0 and UART1 are RS232 ports. I have the same error when trying to
use UART0. I tried to use Flash Magic several times with different
options without succes. The data that is currently on the board was
flashed with the Philips tool...

To me it seems as if either memory was totally corrupted or the
hardware somehow got broken!?

bjoern
Hello Bjn,

you said the LEDs on your board are blinking - that means that it is NOT in
ISP mode. To force the device into ISP mode, you have to pull P0.14 low. If
it was working before with the same jumper setting, that's just because there
wasn't a valid checksum in flash.

Regards,

Dominic

On Wednesday 23 August 2006 10:22, bmueller38 wrote:
> The Jumpers are set correctly. As I said, it worked well with Philips
> Flash Utility first, but now I can't even read the device ID.

On Tuesday 22 August 2006 20:45, bmueller38 wrote:
> The Board itself seems to be ok since the leds are still blinking
> after reset.


Hi,

on my board is a little switch to toggle between ISP and running mode.
The LEDs are only blinking when I am in running mode.
I tried flashing in ISP mode.

I just meant to say that my board cannot be totally broken...
Sorry for the misunderstanding...

bjoern

PS: BSL is low when switched to ISP mode.

> Hello Bjn,
>
> you said the LEDs on your board are blinking - that means that it is
NOT in
> ISP mode. To force the device into ISP mode, you have to pull P0.14
low. If
> it was working before with the same jumper setting, that's just
because there
> wasn't a valid checksum in flash.
>
> Regards,
>
> Dominic
>
> On Wednesday 23 August 2006 10:22, bmueller38 wrote:
> > The Jumpers are set correctly. As I said, it worked well with Philips
> > Flash Utility first, but now I can't even read the device ID.
>
> On Tuesday 22 August 2006 20:45, bmueller38 wrote:
> > The Board itself seems to be ok since the leds are still blinking
> > after reset.
>



It seems as if I had erased my flash, but I am still unable to flash
my device via UART0. Is it possible to erase or corrupt the on-chip
boot-loader software?

> Hi everybody...
>
> ...another beginners problem.
>
> I am unable to communicate with my LPC2138-Board from olimex using the
> Philips Flash Utility. First it worked well, but now I can't even Read
> the Chip-ID. I tried a newer version and another program (Flash
> Magic). All without success.
> The Board itself seems to be ok since the leds are still blinking
> after reset.
>
> I suppose I somehow corrupted the memory with my program!?
>
> Next, I tried to fix it via JTAG using OpenOCD but I cannot erase the
> flash.
>
> > flash erase 0 0 14
>
> leads to "flash erase error".
>
> > flash info 0
>
> says "...erase state unknown, protected" for all sectors.
>
> > flash protect 0 0 14 off
> > flash info 0
>
> no reaction on first command, info says the same as above.
>
> To me it seems as if I could not switch protection off and therefore
> not erase flash!? Might that be?
>
> Is there a way to Flash the board using UART1?
> Or might the processor be damaged somehow?
> Can somebody help me please?
>
> thanks,
> bjoern
>
--- In l..., "bmueller38" wrote:
> It seems as if I had erased my flash, but I am still unable to flash
> my device via UART0. Is it possible to erase or corrupt the on-chip
> boot-loader software?

Yes, boot loader sector is just like any other flash sector in that it
can be erased or corrupted. The boot loader makes an attempt to stop
you from erasing itself, but this does not work all the time.

The discussion seems to suggest your enabling CRP coupled with
possible corruption of your boot loader is locking you out of your
part in that it will not allow you to enter ISP mode.

I suggest you seek help from Philips through your dealer to recover
your board. If that does not work, under the circumstances, I would
consider using other measures, including attempting to circumvent CRP
measures as a legitimate course of action to recover the part.

Should you be interested in the latter option above, please get in
touch with me by direct email.

Regards,

Jaya
--- In l..., "bmueller38" wrote:
>
> Hi,
>
> on my board is a little switch to toggle between ISP and running
mode.
> The LEDs are only blinking when I am in running mode.
> I tried flashing in ISP mode.
>
> I just meant to say that my board cannot be totally broken...
> Sorry for the misunderstanding...
>
> bjoern
>
> PS: BSL is low when switched to ISP mode.

This sounds like a communication problem between the PC and the
device.

- do other devices work with the same PC serial port and cable?
- are the loader settings correct? (try 19.2 kbps or lower)
- does the device work with a different PC?
- does the UART work in "normal" (i.e. non-programming mode)?
- have you put a scope on the serial RX line to see if the part is
actually receiving anything from the PC?
- is the power supply and clock i/p good in ISP mode? (LEDs not
flashing is not a conclusive proof the unit is actually in
programming mode)
- do you have anything connected to the JTAG when trying to program?
if so, I'd suggest disconnecting it.
- ...and many more things to try (I'm sure you've probably tried
most already)

My main point is that although possible, it would be extremely
unlikely the boot loader is corrupted: it's much more likely to be
some other issue.

Brendan.