7.3.2.1 Run-Time Self-Programming (RTSP)

RTSP allows the user application to modify Flash program memory contents. The program/erase operations use NVMCON, NVMADR, NVMSRCADR and NVMDATA (0-3) registers to modify the Flash. With RTSP, the user application can erase a single page of Flash memory and program either a word or row of the memory.

Flash is programmed using either a Word Program (128-bits) or Row Program (512 bytes) operation. Flash must be erased before programming. While programming operations are very reliable, the best practice is to verify Flash contents after programming. This can be done using either the integrated CRC function or with a direct comparison of programmed Flash with the source data. A 128-bit Flash word is the smallest unit of Flash memory that can be programmed. The ECC parity bits associated with each Flash word are programmed automatically for both word and row programming. Programing a Flash word more than once will generally result in the word having incorrect ECC parity bit values.

All erase and program operations using the PROGOP interface must check the status of the WR bit and the WRERR bit to determine the completion of the requested erase or programming operation. Alternatively, software can use an interrupt to monitor completion of the programming operation. A completion interrupt is generated if the operation completed successfully or if the operation was terminated by an error.