RX610 Group
26. ROM (Flash Memory for Code Storage)
R01UH0032EJ0120 Rev.1.20
Page 871 of 1006
Feb 20, 2013
26.8
Protection
Protection against programming/erasure for the ROM includes software protection and error protection.
26.8.1
Software Protection
With the software protection, the ROM programming/erasure is prohibited by the settings of the control register or user
mat lock bit. When the software protection is violated and a ROM programming/erasure-related command is issued, the
FCU detects an error and enters the command-locked state.
(1) Protection through FWEPROR
If the FLWE[1:0] bits in FWEPROR are not set to 01b, programming cannot be performed in any of the modes.
(2) Protection through FENTRYR
When the FENTRY1* and FENTRY0 bits in FENTRYR are 0, ROM read mode is selected. Because the FCU command
cannot be received in ROM read mode, ROM programming/erasure is prohibited. When an FCU command is issued in
ROM read mode, the FCU detects an illegal command error and is placed in the command-locked state (see section
26.8.2, Error Protection).
Note: * Cannot be used in a product whose ROM size is equal to or smaller than 1 Mbyte.
(3) Protection through Lock Bit
Each erasure block in the user mat includes a lock bit. When the FPROTCN bit in FPROTR is 0, erasure blocks whose
lock bit is set to 0 are prohibited from being programmed/erased. To program or erase erasure blocks whose lock bit is
set to 0, set the FPROTCN bit to 1. When the lock bit protection is violated and a ROM programming/erasure-related
command is issued, the FCU detects a programming/erasure error and enters the command-locked state (see section
26.8.2, Error Protection).
26.8.2
Error Protection
With the error protection, FCU command issuance errors, prohibited access occurrences, and FCU malfunctions are
detected, and an FCU command is prohibited from being received (command-locked state). When the FCU enters the
command-locked state (FASTAT.CMDLK bit is 1), one or several of the status bits (FSTATR0.ILGLERR, ERSERR,
and PRGERR bits, FSTATR1.FCUERR bit, and FASTST.ROMAE bit) are set to 1 and programming and erasure of the
ROM are prohibited. To clear the command-locked state, a status register clear command must be issued with FASTAT
set to 10h.
While the CMDLKIE bit in FAEINT is set to 1, if the FCU is placed in the command-locked state (CMDLK bit in
FASTAT is set to 1), a flash interface error (FIFERR) interrupt occurs. While the ROMAEIE bit in FAEINT is set to 1, if
the ROMAE bit in FASTAT is set to 1, an FIFERR interrupt occurs.
Table 26.10 lists the relationship between the contents of the ROM-related error protection and status bit values
(ILGLERR, ERSERR, PRGERR bits in FSTATR0, FCUERR bit in FSTATR1, ROMAE bit in FASTAT) at error
detection. If a command other than the suspend command is issued during programming/erasure and the FCU enters the
command-locked state, it continues the programming/erasure. In this state, it is impossible to issue a P/E suspend
command and suspend programming/erasure. When a command is issued in the command-locked state, the ILGLERR bit
is set to 1.