Change Code Read Protection via SWD

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Change Code Read Protection via SWD

跳至解决方案
1,978 次查看
joelhart
Contributor I

What are the steps necessary to change the Code Read Protection (CRP) on an LPC1114FBD48/302, using the SWD interface?

标签 (2)
1 解答
1,818 次查看
converse
Senior Contributor V

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.

在原帖中查看解决方案

2 回复数
1,819 次查看
converse
Senior Contributor V

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.

1,818 次查看
arpad_toth
Contributor II

This is super cumbersome.

There should be an SWD readout protection bit field in CPR.

0 项奖励
回复