What are the steps necessary to change the Code Read Protection (CRP) on an LPC1114FBD48/302, using the SWD interface?
Solved! Go to Solution.
There is no simple way to do this. CRP is 'just' an address in flash. To change it, you need to erase and re-program the entire sector of flash that contains the CRP value (which is sector 0).
If you are using a debugger, a command line flash programmer, Flash Magic, or any other commercial programmer, you would normally provide an entire new flash image and reprogram the whole of flash. You could optimise this by just providing the portion of the image for sector you wish to change, and then program just that sector (making sure you do not do a mass-erase which erases the whole of flash).
I don't know of any tool that you could use to just change the value of the CRP - this would involve the tool reading the existing date from the sector 0, erasing flash sector 0, and then writing the data back, with a changed CRP value.
There is no simple way to do this. CRP is 'just' an address in flash. To change it, you need to erase and re-program the entire sector of flash that contains the CRP value (which is sector 0).
If you are using a debugger, a command line flash programmer, Flash Magic, or any other commercial programmer, you would normally provide an entire new flash image and reprogram the whole of flash. You could optimise this by just providing the portion of the image for sector you wish to change, and then program just that sector (making sure you do not do a mass-erase which erases the whole of flash).
I don't know of any tool that you could use to just change the value of the CRP - this would involve the tool reading the existing date from the sector 0, erasing flash sector 0, and then writing the data back, with a changed CRP value.
This is super cumbersome.
There should be an SWD readout protection bit field in CPR.