Mitsubishi Electric M32R Series User Manual page 166

Mitsubishi 32-bit risc single-chip microcomputers
Table of Contents

Advertisement

6
(4) Block Erase command
The Block Erase command erases the contents of internal flash memory one block at a time. For
Block Erase, write the command data H'2020 to any address of the internal flash memory. Next,
write the Verify command data H'D0D0 to the last even address of the memory block you want to
erase (see Table 6.5.3, Table 6.5.4, and Table 6.5.5, "Target Blocks and Specified Addresses").
The content of this memory block is erased.
With the Block Erase command, you cannot erase the protected blocks.
Block Erase is automatically performed by the internal control circuit, and the completion of Block
Erase can be verified by checking the Flash Status Register 1 (FSTAT1) FSTAT bit. (Refer to
Section 6.4.2, "Flash Status Registers.") While the FSTAT bit = 1, you cannot erase the next
block.
(5) Erase All Unlock Block command
The Erase All Unlock Block command erases all memory blocks that are not protected. To erase
all unlock blocks, write the command data H'A7A7 to any address of the internal flash memory.
Next, write the command data H'D0D0 to any address of the internal flash memory, and all of
unprotected memory blocks are erased.
(6) Read Status Register command
The Read Status Register command reads out the content of Flash Status Register 2 (FSTAT2)
that indicates whether flash memory write or erase operation has terminated normally or not. To
read Flash Status Register 2, write the command data H'7070 to any address of the internal flash
memory. Next, read any address of the internal flash memory, and the content of Flash Status
Register 2 (FSTAT2) is read out.
(7) Clear Status Register command
The Clear Status Register command clears the Flash Status Register 2 (FSTAT2) D10, D11, and
D12 bits to 0. Write the command data H'5050 to any address of the internal flash memory, and
Flash Status Register 2 is cleared to 0.
If an error occurs when programming or erasing the flash memory and the Flash Status Register
2 (FSTAT2) ERASE (Auto Erase operating condition) or WRERR2 (Program operating condition
2) bit is set to 1, you cannot perform the next program or erase operation unless WRERR1
(Program operating condition 1) or WRERR2 (Program operating condition 2) is cleared to 0.
6.5 Programming of the Internal Flash Memory
6-32
INTERNAL MEMORY
Ver.0.10

Advertisement

Table of Contents
loading

Table of Contents