English
Language : 

SH7059 Datasheet, PDF (848/1042 Pages) Renesas Technology Corp – 32-Bit RISC Microcomputer
25. ROM (SH7059)
(3) Erasing Procedure in User Program Mode
The procedures for download, initialization, and erasing are shown in figure 25.12.
Start erasing procedure
program
Select on-chip program
to be downloaded and
set download destination
by FTDAR
(3.1)
Set FKEY to H'A5
After clearing VBR,
set SCO to 1 and
execute download
Clear FKEY to 0
DPFR = 0?
Yes
No
Download error processing
Set the FPEFEQ and
FUBRA parameters
Initialization
JSR FTDAR setting+32
FPFR=0 ?
No
Yes Initialization error processing
1
1
Set FKEY to H'5A
Set FEBS parameter
(3.2)
Erasing
JSR FTDAR setting+16 (3.3)
FPFR=0 ?
(3.4)
No
Yes Clear FKEY and erasing
error processing
No
Required block
erasing is
completed?
(3.5)
Yes
Clear FKEY to 0
(3.6)
End erasing
procedure program
Figure 25.12 Erasing Procedure
The details of the erasing procedure are described below. The procedure program must be executed in an area other
than the user MAT to be erased.
Especially the part where the SCO bit in FCCS is set to 1 for downloading must be executed in on-chip RAM.
The area that can be executed in the steps of the user procedure program (on-chip RAM, user MAT, and external
space) is shown in section 25.10.3, Storable Area for Procedure Program and Programming Data.
For the downloaded on-chip program area, see the RAM map for programming/erasing in figure 25.10.
A single divided block is erased by one erasing processing. For block divisions, see figure 25.4. To erase two or more
blocks, update the erase block number and perform the erasing processing for each block.
(3.1) Select the on-chip program to be downloaded
Set the EPVB bit in FECS to 1.
Several programming/erasing programs cannot be selected at one time. If several programs are set, download is not
performed and a download error is returned to the source select error detect (SS) bit in the DPFR parameter.
Specify the start address of the download destination by FTDAR.
The procedures to be carried out after setting FKEY, e.g. download and initialization, are the same as those in the
programming procedure. For details, see the description in 25.5.2 (2) Programming Procedure in User Program Mode.
(3.2) Set the FEBS parameter necessary for erasure
Set the erase block number of the user MAT in the flash erase block select parameter (FEBS: general register R4). If a
value other than an erase block number of the user MAT is set, no block is erased even though the erasing program is
executed, and an error is returned to the return value parameter FPFR.
Rev.3.00 Mar. 12, 2008 Page 758 of 948
REJ09B0177-0300