Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: loading hex-es....(Tricky Situation)

2004-07-06 by Alex Holden

Robert Adsett wrote:
> At 09:57 PM 7/5/04 +0000, you wrote:
>>That'll be risky business indeed. Luckily, the built-in IAP flash
>>programmer can program anywhere except the bootloader sector. I think
>>if you corrupt reset table the mcu will be totally useless on
>>reset...not even the bootloader will run.
> I don't believe the OP is talking about rewriting the bootload sector just 
> the interrupt vector table (which is at the beginning of the flash rather 
> than the end).  If I were trying that I'd just erase the first sector 
> (sector/segment/paragraph whatever they call it). That should be relatively 
> safe.  The chip would then act as if it were new.  Whether that's better 
> than bringing out P0.14 for toggling is a different question.

Exactly. If the vector table at the beginning of user flash doesn't 
checksum correctly, the chip goes into bootloader mode after reset and 
you can reprogram it over the serial port even if P0.14 is permanently 
tied high. As you say erasing the first sector is probably the easiest 
way of corrupting the vector table.

BTW on a (sort of) related note, the current version of lpc21isp doesn't 
work on big endian systems like Macs because it calculates the vector 
block checksum incorrectly causing the device to always enter the 
bootloader on reset. I wrote a patch which fixes this and sent it to the 
author but haven't got any response. There's a copy here:
http://www.alexholden.net/misc/lpc21isp-byte_safety.patch

-- 
------------ Alex Holden - http://www.linuxhacker.org ------------
If it doesn't work, you're not hitting it with a big enough hammer

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.