1.8 ICSP Write Inhibit
ICSP Write Inhibit is an access restriction feature that restricts all Flash memory when activated. Once activated, ICSP Write Inhibit permanently prevents ICSP Flash programming and erase operations and cannot be deactivated. This feature is intended to prevent alteration of Flash memory contents with behavior similar to One-Time-Programmable (OTP) devices.
RTSP, including erase and programming operations, is not restricted when ICSP Write Inhibit is activated; however, code to perform these actions must be programmed into the device before ICSP Write Inhibit is activated. This allows for a bootloader-type application to alter Flash contents when ICSP Write Inhibit is activated.
Entry into ICSP and Enhanced ICSP modes is not affected by ICSP Write Inhibit. In these
modes, it will continue to be possible to read configuration memory space and any user
memory space regions that are not code-protected. With ICSP Write Inhibit, an attempt to
set WR (NVMCON[15]) = 1 will maintain WR = 0, and
instead, set WRERR (NVMCON[13]) = 1. All Enhanced ICSP erase and
programming commands will have no effect, with self-checked programming commands
returning a FAIL response opcode (or a PASS if the destination already exactly matches
the requested programming data).
Once ICSP Write Inhibit is activated, it is not possible for a device executing in Debug mode to erase/write Flash, nor can a debug tool switch the device to Production mode. ICSP Write Inhibit should, therefore, only be activated on devices programmed for production.
The JTAG port, when enabled, can be used to map ICSP signals to JTAG I/O pins. All Flash erase/programming operations initiated via the JTAG port will, therefore, also be blocked after activating ICSP Write Inhibit.
