Unprotect a CRP2 protected mbed

31 Jan 2011

Hello,

I just protected my mbed with code protection CRP2 which disables all access to the LPC1768 except for erasing the whole flash via ISP. I believed that the mbed solution uses ISP for programming, but became aware from another thread that this is not the case. So my solution now is protected and I am not able to update software any more. As the mbed chip handles all ISP lines, does it support erasing the flash in a way or at least bringing the LPC into ISP mode by setting P2.10 appropriately ? Otherwise I am thinking to solder an wire to the P2.10 pullup pin to force the processor into ISP mode and then erasing it via an NXP app (lpc21isp or similar). Is there a direct solution with an USB command or similar ?

31 Jan 2011

As I suggested before, soldering a wire to the Pullup to P2.10 on the bottom side of the PCB (10k pullup) and pulling it to GND on Power up resulted in entering the ISP. This enabled me to use the ISP tools and erase the flash as a whole and giving access again. Of course this works only for CRP1 and CRP2, not for CRP3. But I would still be interested to know whether the mbed interface chip has some software interface to accomplish the same without eeding the wire.

31 Jan 2011

Hi Werner,

Just saw your posts, and thought I'd pipe up.

Early (development) revisions of mbed firmware did use the serial ISP mechanism for boot loading, but we have since moved to JTAG, as it is considerably faster.

There is currently no specific way to remove code protection, other than the way you described, i.e. by forcing the LPC1768 into serial boot loader mode and then using some flashing tools (or if brave, the LPC1768 manual and TeraTerm!) to manually erase the FLASH.

By contrast, we've also not provided any explicit mechanism for creating locked binaries either.

We had considered a "reset to factory default" mechanism to erase and formats the Flash Drive, and I guess this mechanism could also erase the LPC1768 flash too. I guess it depends on how useful locking a binary, and more importantly, the need to unlock it again, is to the mbed community.

Glad you unlocked your mbed okay though.

Thanks, Chris

31 Jan 2011

Thanks for the info. Currently for this project CRP is very important for me. The mbed replaces a old CPU card and is mounted with a hand made adapter to replace the old and phased out solution. The quantity is very low, so I decided not to build a complete new board for this. I had to port the software from the old solution. This solution is completely proprietary own written code and does not use the online compiler. Due to security reasons CRP is relevant here, so that the solution can't be copied simply. I could have used any other board but the mbeds form factor is very good suitable here. Really rapid prototyping.

Best regards

Werner

23 Feb 2011

Hi,

Just as an update to this thread, I have just published the following cookbook page :

http://mbed.org/cookbook/CRP-Unbricking

Hope it might be a useful reference.

Thanks, Chris

23 Feb 2011

Hi,

very useful information. But everyone should be aware that a mbed that has been programmed with CRP3 protection can't be unbricked by the bootlaoder, only the IAP access via the user programmed software can unprotect the device again. So if you would like to protect an mbed it shuld be enough to set CRP2, except you won't this mbed to be used for any other purpose again (or your own interface to the outside offers an access to IAP= In Application Programming).

Best regards

Werner