![](http://datasheet.mmic.net.cn/370000/P312XDP512F0VFV_datasheet_16728159/P312XDP512F0VFV_1229.png)
Chapter 29 128 Kbyte Flash Module (S12XFTX128K1V1)
MC9S12XDP512 Data Sheet, Rev. 2.17
Freescale Semiconductor
1229
29.6.2
Unsecuring the MCU in Special Single Chip Mode using BDM
The MCU can be unsecured in special single chip mode by erasing the Flash module by the following
method:
Reset the MCU into special single chip mode, delay while the erase test is performed by the BDM
secure ROM, send BDM commands to disable protection in the Flash module, and execute a mass
erase command write sequence to erase the Flash memory.
After the CCIF flag sets to indicate that the mass operation has completed, reset the MCU into special
single chip mode. The BDM secure ROM will verify that the Flash memory is erased and will assert the
UNSECbitintheBDMstatusregister.ThisBDMactionwillcausetheMCUtooverridetheFlashsecurity
state and the MCU will be unsecured. All BDM commands will be enabled and the Flash security byte
may be programmed to the unsecure state by the following method:
Send BDM commands to execute a word program sequence to program the Flash security byte to
the unsecured state and reset the MCU.
29.7
Resets
29.7.1
Flash Reset Sequence
Oneachreset,theFlashmoduleexecutesaresetsequencetoholdCPUactivitywhileloadingthefollowing
registers from the Flash memory according to
Table 29-1
:
FPROT — Flash Protection Register (see
Section 29.3.2.5
).
FCTL - Flash Control Register (see
Section 29.3.2.8
).
FSEC — Flash Security Register (see
Section 29.3.2.2
).
29.7.2
Reset While Flash Command Active
If a reset occurs while any Flash command is in progress, that command will be immediately aborted. The
state of the word being programmed or the sector/block being erased is not guaranteed.
29.8
Interrupts
TheFlashmodulecangenerateaninterruptwhenallFlashcommandoperationshavecompleted,whenthe
Flash address, data and command buffers are empty.
Table 29-19. Flash Interrupt Sources
Interrupt Source
Interrupt Flag
Local Enable
Global (CCR) Mask
Flash Address, Data and Command Buffers empty
CBEIF
(FSTAT register)
CCIF
(FSTAT register)
CBEIE
(FCNFG register)
CCIE
(FCNFG register)
I Bit
All Flash commands completed
I Bit