English
Language : 

PXD10RM Datasheet, PDF (629/1332 Pages) Freescale Semiconductor, Inc – PXD10 Microcontroller
The user may not abort an erase sequence while in erase suspend.
Example 17-9. Erase of sectors B0F1 and B0F2.
MCR
= 0x00000004;
LMS
= 0x00000006;
(0x000000)
= 0xFFFFFFFF;
MCR
= 0x00000005;
do
{ tmp
= MCR;
} while ( !(tmp & 0x00000400) );
status
= MCR & 0x00000200;
MCR
= 0x00000004;
MCR
= 0x00000000;
/* Set ERS in MCR: Select Operation */
/* Set LSL2-1 in LMS: Select Sectors to erase */
/* Latch a Flash Address with any data */
/* Set EHV in MCR: Operation Start */
/* Loop to wait for DONE=1 */
/* Read MCR */
/* Check PEG flag */
/* Reset EHV in MCR: Operation End */
/* Reset ERS in MCR: Deselect Operation */
17.3.7.3.1 Erase Suspend/Resume
The erase sequence may be suspended to allow read access to the Flash Core.
It is not possible to program or to erase during an erase suspend.
During erase suspend, all reads to blocks targeted for erase return indeterminate data.
An erase suspend can be initiated by changing the value of the MCR.ESUS bit from 0 to 1. MCR.ESUS
can be set to 1 at any time when MCR.ERS and MCR.EHV are high and MCR.PGM is low. A 0 to 1
transition of MCR.ESUS causes the Module to start the sequence which places it in erase suspend.
The user must wait until MCR.DONE=1 before the Module is suspended and further actions are attempted.
MCR.DONE will go high no more than tESUS after MCR.ESUS is set to 1.
Once suspended, the array may be read. Flash Core reads while MCR.ESUS=1 from the block(s) being
erased return indeterminate data.
Example 17-10. Sector Erase Suspend
MCR
= 0x00000007;
do
{ tmp
= MCR;
} while ( !(tmp & 0x00000400) );
/* Set ESUS in MCR: Erase Suspend */
/* Loop to wait for DONE=1 */
/* Read MCR */
Notice that there is no need to clear MCR.EHV and MCR.ERS in order to perform reads during erase
suspend.
The Erase sequence is resumed by writing a logic 0 to MCR.ESUS.
MCR.EHV must be set to 1 before MCR.ESUS can be cleared to resume the operation.
The Module continues the erase sequence from one of a set of predefined points. This may extend the time
required for the erase operation.
Example 17-11. Sector Erase Resume
MCR
= 0x00000005;
/* Reset ESUS in MCR: Erase Resume */
Freescale Semiconductor
PXD10 Microcontroller Reference Manual, Rev. 1
Preliminary—Subject to Change Without Notice
17-79