How to disable CPR2 on mbed

22 Feb 2011

Hi,

I set CRP2 in my program, and unfortunately it seems that the setting is successfully. Now my mbed is unprogrammable, copy new program to mbed does not work.

How can I disable the CRP2? Shall I have to erase all the flash, any other choice?

If have to erase the flash, how to do? Any thing need to do for restoring after erase the flash?

Thanks very much!

Regards, Jessamine

22 Feb 2011

Hi Jessamine,

Yup, setting CRP does work. We've not implemented a quick fix for this, mainly because we didn't implement an explicit method for setting CRP.

This has been discussed before, and the user in question able to recover their mbed.

Take a look at:

http://mbed.org/forum/mbed/topic/1763

I hope this helps - shout if you need a hand...

Thanks, Chris

23 Feb 2011

HI Jessamine,

As there have been a few reports of people using CRP, and having to recover it, I've written a guide of how to erase the CRP.

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

Let me know if this works for you.

Thanks, Chris

02 Mar 2011

Hi Chris,

Thanks for the guide of how to erase CRP. It is very useful.

We entered the ISP mode and executed those commands to erase flash, following the guide. But when execute "E 0 26", we get a error code 19(CODE_READ_PROTECTION_ENABLED) returned. I also tried with "E 1 26", it returns 0. So it seems that sector 0 are not allowed to be erased.

Do you have any idea about this case? Is it possible to solve it?

I hope it is not a phenomenon of CRP3 enabled. According to user manual. "CPR3 is similar to CRP2, but ISP entry by pulling P2.10 LOW is disabled if a valid user code is present in flash sector 0." If I set CPR3 3, I even could not enter the ISP mode, right?

Thank you very much!

Regards, Jessamine