I am using LPC824 OM13071 board. I want to make sure my firmware is secured from reading and copying by other parties. How can I program flash and protect it?
I suggest you look at the "Code Read Protection" functionality (CRP). For more details, check the LPC82x documentation, plus : Code Read Protection (CRP)
I checked 'Edit project settings -> C/C++ Build -> Settings -> Tool Settings -> MCU Linker -> Managed Linker Script -> Enable Code Read Protection' is ticked.In the crp.c file, I set " __CRP const unsigned int CRP_WORD = CRP_CRP2 ; "Thenafter flash programming, I turned off the power, and on again to get power cycle .When I tried debug again, nothing happened. I still can debug just like before.Is there any other additional things to enable CRP?
Check the linker map file generated by the linker when it creates your image and make sure that the CRP_WORD is being located at the correct location.
You could also disassemble your image and make sure that the right value exists at that location too...
Disassembling objects and executables
Also, how exactly are you programming your image to flash?
Thank you. It is OK now. The problem seems to be power cycle. It looks FTDI cable needs to be disconnected also, although I did not use power from it.
I used GUI flash programmer to program the flash. The details can be seen at
Cool-Emerald: Flash content protection for LPC824
I tested with LPCXpresso and it was ok.
Now, I change to MUCXpresso. When I checked the CRP_WORD at address 2fc, it appeared as 4321 8765 which is CRP3 instead of 0x87654321 CRP2 (as shown in the link above). I am afraid to test it because it will damage the board.
Why is it appear so? Is that just a change in order of appearance of the word while actual value is still CRP2?
Retrieving data ...