7.1.3 Debug Failure Errors
The target device is not ready for debugging. Please check your Configuration bit settings and program the device before proceeding.
You will receive this message if you try to Run before programming your device for the first time. If you receive this message after this, or immediately after programming your device, please refer to Debug Failure Actions.
The device is code protected.
The device on which you are attempting to operate (read, program, blank check or verify) is code protected, in other words, the code cannot be read or modified. Check your Configuration bits setting for code protection (Windows > Target Memory Views > Configuration Bits).
Disable code protection, set or clear the appropriate Configuration bits in code or in the Configuration Bits window according to the device data sheet. Then erase and reprogram the entire device.
If these actions fail to fix the problem, see Debugger to Target Communication Error Actions and Debug Failure Actions.