Hello!
I have an LPC824 microcontroller (LPC824M201JDH20J) and I'm attempting to implement Code Read Protection (CRP). Looking at the microcontroller datasheet, I see that CRP1 can be implemented by writing 0x12345678 to 0x2FC and CRP2 can be implemented by writing 0x87654321 to 0x2FC.
My software release is an .s19 file and I modified memory location 0x2FC of the .s19 file to 0x12345678 and updated the associated checksum in the .s19 file. I programmed the .s19 file to my microcontroller using a Multilink-FX programmer and PROGACMP. After programming, I was able to read back memory location 0x2FC and confirm that it indeed contained 0x12345678. I then power cycled the microcontroller and reconnected using PROGACMP and was able to dump the contents of the microcontroller with no restrictions. I did not expect this to be case with CRP1.
I repeated the same procedure but implemented CRP2 by writing 0x87654321 to 0x2FC. Again, after power cycling, I was able to connect to the microcontroller and dump the contents.
I imagine there is something simple that I'm missing. Any ideas? Any help is appreciated!
Thank you!
Solved! Go to Solution.
Actually, I believe I've figured it out. I went ahead and implemented CRP2 via source to see how it looked in the compiled binary. It looks like it was an issue of endianness.The binary compiled with CRP2 in source looks as follows:
Hi Alex,
Thanks for your reply! For some reason, I'm still running into some issues. After setting the bytes to '87654321' (CRP2) and power cycling the microcontroller, I'm still able to debug through MCUXpresso and I'm still able to read the full memory through PROGACMP.
Looking at the memory, I can see that it is set to '87654321'. Does this look correct to you?
Anything else that I could be missing?
Thanks again for your help!
Hi, @kwagner
Did you manually change the value of 0x000002FC? It seems to be okay. You can try it by setting CRP in the following ways:
Set it in starup_lpc824.c as follows:
Then download to the development board.
Best regards, Alex
Actually, I believe I've figured it out. I went ahead and implemented CRP2 via source to see how it looked in the compiled binary. It looks like it was an issue of endianness.The binary compiled with CRP2 in source looks as follows:
Hi, @kwagner
I used the LPC824 development board to set CRP1 and CRP2. After the setting, I could not burn programs and debug through the IDE, nor could I read any values, and I could erase the whole film through ISP mode. As follows:
The following operations can be performed at different levels:
Best regards, Alex