Hardware Reference
In-Depth Information
14.5.4 Securing the Flash Memory
The flash security feature is designed to prevent unauthorized access to the nonvolatile
memory. The memory contents are secured by programming the security bits within the flash
options/security byte at the address $FF0F. On devices that have a memory page window, the
flash options/security byte is also available at the address $BF0F by setting the value of the
PPAGE register to $3F. The contents of this byte are copied into the flash security register
(FSEC) during the reset sequence.
The flash sector $FE00 to $FFFF must be erased before the flash options/security byte is
programmed. The flash is programmed by aligned word only, so the address $FF0E must be
written as the word address to be programmed to program the flash options/security byte. The
flash options/security byte can be erased or programmed only when this sector is not protected.
Secured operation takes effect on the next reset after programming the security bits of the FSEC
register to a secure value. The effects that the secured operation has on the HCS12 microcon-
troller are listed in Table 14.6.
Operation Mode
Effects
1. Background debug module operation is completely disabled.
2. Flash and EEPROM commands PROG, bulk erase, sector erase,
erase and verify, and sector modify remain enabled.
Normal single-chip mode
1. BDM firmware commands are disabled.
2. BDM hardware commands are restricted to register space.
3. Flash and EEPROM commands are limited to bulk erase only.
Special single-chip mode
1. BDM operation is completely disabled.
2. External access to internal flash and EEPROM is disabled.
3. Internal visibility (IVIS) and CPU pipe (IPIPE) information is disabled.
4. Flash and EEPROM commands cannot be executed from external
memory in normal expanded mode.
Expanded modes
Table 14.6 Effects of secured operations on the HCS12 operation modes
14.5.5 Unsecuring the Microcontroller
When in secure mode, the HCS12 microcontroller can be unsecured by one of the following
methods:
B ACKDOOR K EY A CCESS
In normal modes (single chip and expanded), security can be temporarily disabled by the
backdoor key access method. This method requires the following actions to be taken:
Program the backdoor key at $FF00,$FF07 to a valid value.
Set the KEYEN1 and KEYEN0 bits of the flash option/security byte to 10 (enabled).
In single-chip mode, design applications to have the capability to write to the
backdoor key locations.
The backdoor key access method is useful because it allows debugging of a secured micro-
controller without having to erase the flash memory. This is useful for failure analysis. The
backdoor key is not allowed to have the value of $0000 or $FFFF.
 
Search WWH ::




Custom Search