Functional Description and Application Information
32 kbyte Flash Module (S12SFTSR32KV1)
MM912F634
Freescale Semiconductor
298
4.36.5.3
Background Debug Mode
In background debug mode (BDM), the FPROT register is writable. If the MCU is unsecured, then all Flash commands listed in
Table 385 can be executed. If the MCU is secured and is in special mode, only the erase verify and mass erase commands can
be executed.
4.36.6
Flash Module Security
The Flash module provides the necessary security information to the MCU. During each reset sequence, the Flash module
The contents of the Flash security byte in the Flash configuration field (see
Section 4.36.3.1.1) must be changed directly by
programming the Flash security byte location, when the MCU is unsecured and the sector containing the Flash security byte is
unprotected. If the Flash security byte is left in a secured state, any reset will cause the MCU to initialize into a secure operating
mode.
4.36.6.1
Unsecuring the MCU Using Backdoor Key Access
The MCU may be unsecured by using the backdoor key access feature, which requires knowledge of the contents of the
bit is set, a write to a backdoor key address in the Flash memory triggers a comparison between the written data and the backdoor
key data stored in the Flash memory. If all backdoor keys are written to the correct addresses in the correct order, and the data
matches the backdoor keys stored in the Flash memory, the MCU will be unsecured. The data must be written to the backdoor
keys sequentially. Values 0x0000 and 0xFFFF are not permitted as backdoor keys. While the KEYACC bit is set, reads of the
Flash memory will return valid data.
The user code stored in the Flash memory must have a method of receiving the backdoor keys from an external stimulus. This
external stimulus would typically be through one of the on-chip serial ports.
If the KEYEN[1:0] bits are in the enabled state (see
Section 4.36.3.3.2), the MCU can be unsecured by the backdoor
key access sequence described below:
1.
Set the KEYACC bit in the Flash configuration register (FCNFG).
2.
Sequentially write the correct four words to the Flash addresses containing the backdoor keys.
3.
Clear the KEYACC bit. Depending on the user code used to write the backdoor keys, a wait cycle (NOP) may be required
before clearing the KEYACC bit.
4.
If all data written match the backdoor keys, the MCU is unsecured and the SEC[1:0] bits in the FSEC register are forced
to an unsecured state.
The backdoor key access sequence is monitored by an internal security state machine. An illegal operation during
the backdoor key access sequence will cause the security state machine to lock, leaving the MCU in the secured
state. A reset of the MCU will cause the security state machine to exit the lock state and allow a new backdoor key
access sequence to be attempted. The following operations during the backdoor key access sequence will lock the
security state machine:
1.
If any of the keys written does not match the backdoor keys programmed in the Flash array.
2.
If the keys are written in the wrong sequence.
3.
If any of the keys written are all 0’s or all 1’s.
4.
If the KEYACC bit does not remain set while the keys are written.
5.
If any of the keys are written on successive MCU clock cycles.
6.
Executing a STOP instruction before all keys have been written.
After the backdoor keys have been correctly matched, the MCU will be unsecured. Once the MCU is unsecured, the Flash
security byte can be programmed to the unsecure state, if desired.
In the unsecure state, the user has full control of the contents of the backdoor keys by programming the associated addresses