4.3.2 BIST at Run Time
The BIST can also be run at any time during code execution. Note that a BIST will corrupt all of the RAM contents, including the Stack Pointer, and requires a subsequent Reset. The system should be prepared for a Reset before a BIST is performed. The BIST is invoked by setting the MBISTEN bit (MBISTCON[0]). The MBISTCON register is protected against accidental writes and requires an unlock sequence prior to writing. Only one bit can be set per unlock sequence. The procedure for a run-time BIST is as follows:
- Execute the unlock sequence by consecutively writing 0x55 and 0xAA to the NVMKEY register.
- Write 0x0001 to the MBISTCON SFR.
- Execute a Software Reset command.
- Verify a Software Reset has occurred by reading SWR (RCON[6]) (optional).
- Verify that the MBISTDONE bit is set.
- Take action depending on test result indicated by MBISTSTAT.