Yahoo Groups archive

Lpc2000

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

Message

Re: Flash Security. Is it working good/perfect or not?

2005-11-11 by rtstofer

--- In lpc2000@yahoogroups.com, "leosmutter" <leosmutter@y...> wrote:
>
> Just a few thoughts:
> I have a very nice programm and i know some people want to take a 
look
> how it works. So i put it in my LPC2148 with bootloader > V1.61 and
> put these special bytes at this special location (0x000001Fc =
> 0x87654321) and then it should be secure. ok. that's theory. So how
> secure is it now? Is Jtag closed? Can i read flash via JTAG? Can i
> still update the bootloader (it says that the flash will not be 
harmed
> if i update the bootloader)? If there is still any way to update 
the
> bootloader then ... i think i don't need to tell more... so if i 
write
> this 0x87654321 to 0x1FC is updating of the bootloader still 
possible?
> I only got a LPC2106 over here and this one has no code protection 
at
> all. It would be nice to know before i start using this very very 
nice
> LPC2148-processor. I really like it, but i need flash-security at a
> very high level.
> 
> Regards,
> Leo
>

It looks like section 21.7 Code Read Protection of the LPC2148 User 
Manual covers the issue of code protection.

Section 21.5 states that ISP and IAP can not overwrite the boot 
sector so that implies that only JTAG can do this.

Code read protection disables JTAG so I guess the process is to:

1) Use ISP with the existing boot loader to erase the flash 
completely
2) Cycle power - existing boot loader gains control
3) Use JTAG to install the new bootloader (why do this?)
4) Cycle power
5) Use ISP or JTAG to reprogram the device
6) Reenable code protection

So, it looks like your code is protected and you can upgrade the 
boot loader but you will have to reprogram the device if you do.  
Seems reasonable!

Somehow, I doubt that the protection is "perfect".  Every 
manufacturer is trying to find ways to protect the flash from 
disassembly and discovery with a scanning electron microscope.  
Pretty unrealistic attack unless you happen to write the code that 
controls the world's flow of money.  For the average program, the 
code protection is probably good enough.

If you are really worried, make the code run from RAM.  Have a 
battery backup system and load the program.  If anyone attempts to 
break in the RAM will lose its contents.  FPGA crypto chips work 
this way.

Richard

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.