Unlock LPC-1768-SK

Technical Note 79394



1/24/2012 8:29 AM


This Technical Note applies to IAR KickStart Kit for NXP Semiconductors’ LPC1768, and other similar boards, using Code Read Protection (CRP).


When Code Read Protection (CRP) is selected, JTAG is blocked and cannot be used for downloading/debugging. Furthermore, JTAG cannot be used for unlocking the device.

The message from C-SPY will look like:

Fatal error: Failed to read CPUID [...]

Solution (CRP1)

A solution to unlock CRP1 is to download Flash Magic to erase the flash including the code read protection.

Configure board and Flash Magic

Set the 'ISP' and 'RST' jumper on the board. Connect an RS232 cable to UART0 on the board Power the board via Jlink or by external power.

Start Flash Magic

Go to 'Options -> Advanced Options... -> Hardware Config'.

In dialog 'Advanced Options', select check box 'Use DTR and RTS to control RST and ISP pin'.

Power cycle the board to get it into ISP mode

Make selections for 'Step 1 - Communications'


Device : LPC1768
COM Port : COM1
Baud Rate : 9600
Interface : None (ISP)

Check communication

Go to 'ISP -> Read Device Signature...'
The dialog 'Device Signature' should pop up showing values for Device ID, Bootloader Ver and Serial Number.

Go to 'ISP -> Read Security...'
The dialog 'Security' should pop up showing a line 'CRP is at level 1'.

Erase Flash/CRP

Go to 'ISP -> Erase Flash...'
In dialog 'Erase Flash', select check box 'Erase all Flash+Code Rd Prot' and execute the erase.

Go to 'ISP -> Read Security...'
The dialog 'Security' should pop up showing a line 'CRP is disabled'.

Now your JTAG should be functional again.


CRP1: The solution described in this Technical Note has been tested for CRP1.

CRP2: The solution has not been tested for CRP2.

CRP3: The solution will not work for CRP3.

All product names are trademarks or registered trademarks of their respective owners.

Related Tech Notes

© IAR Systems 1995-2016 - All rights reserved.