AN2400 Freescale Semiconductor / Motorola, AN2400 Datasheet - Page 45

no-image

AN2400

Manufacturer Part Number
AN2400
Description
HCS12 NVM Guidelines
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Reprogramming the
Security Bits
Complete Memory
Erase (Special
modes)
MOTOROLA
In Normal Single Chip Mode, security can also be disabled by means of erasing
and reprogramming the security bits within Flash Options/Security byte to the
unsecured value. As the erase operation will erase the entire sector from
$FE00 to $FFFF, the Backdoor Key and the interrupt vectors will also be
erased and so this method is not recommended for Normal Single Chip mode.
The application software can only erase and program the Flash
Options/Security byte if the Flash sector containing the Flash Options/Security
byte is not protected (see Flash Protection). Thus Flash protection is a useful
means of preventing this method. The microcontroller will enter the unsecured
state after the next reset following the programming of the security bits to the
unsecured value.
This method requires:
The microcontroller can be unsecured in Special modes by erasing the entire
EEPROM and Flash contents.
When a secure microcontroller is reset into Special Single Chip mode, the BDM
firmware verifies whether the EEPROM and Flash are erased. If any EEPROM
or Flash address is not erased, only BDM hardware commands are enabled.
BDM hardware commands can then be used to write to the EEPROM and
Flash registers, and so to Mass Erase the EEPROM and all Flash blocks.
When next reset into Special Single Chip mode, the BDM firmware will again
verify whether all EEPROM and Flash are erased, and this being the case, will
enable all BDM commands, allowing the Flash Options/Security byte to be
programmed to the unsecured value. The security bits SEC[1:0] in the Flash
Security register will indicate the unsecure state following the next reset.
Special Single Chip Erase and Unsecure:
1. Reset into Special Single Chip mode
2. Write an appropriate value to the ECLKDIV register for correct timing.
3. Write $FF to the EPROT register to disable protection.
4. Write $30 to the ESTAT register to clear the PVIOL and ACCERR bits.
5. Write $0000 to the EDATA register ($011A–$011B)
6. Write $0000 to the EADDR register ($0118–$0119)
Freescale Semiconductor, Inc.
For More Information On This Product,
That the application software previously programmed into the
microcontroller has been designed to have the capability to erase and
program the Flash Options/Security byte, or
That security is first disabled using the Backdoor Key method, allowing
BDM to be used to issue commands to erase and program the Flash
Options/Security byte, and
The Flash sector containing the Flash Options/Security byte is not
protected.
Go to: www.freescale.com
HCS12 NVM Guidelines
NVM Security
AN2400/D
45

Related parts for AN2400