RL78/G13 CHAPTER 22 SAFETY FUNCTIONS
R01UH0146EJ0100 Rev.1.00 906
Sep 22, 2011
<Operation flow>
Figure 22-3. Flowchart of Flash Memory CRC Operation Function (High-speed CRC)
Cautions 1. The CRC operation is executed only on the code flash.
2. Store the expected CRC operation value in the area below the operation range in the code flash.
3. Boot swapping is not performed while the CRC operation is being executed.
4. The CRC operation is enabled by executing the HALT instruction in the RAM area.
Be sure to execute the HALT instruction in RAM area.
The expected CRC value can be calculated by using tools such as the CubeSuite development environment. (See the
CubeSuite user’s manual for details.)
Start
; Store the expected CRC operation result
; value in the lowest 4 bytes.
; CRC operation range setting
; Copy the HALT and RET instructions to be
; executed on the RAM to the RAM.
; Initialize the 10 bytes after the RET
; instruction.
; Masks all interrupt
; Enables CRC operation
; Initialize the CRC operation result register
; Call the address of the HALT instruction
; copied to the RAM.
; CRC operation starts by HALT insutraction
; execution
; When the CRC operation is complete, the HALT
; mode is released and control is returned from RAM
; Prohibits CRC operation
; Read CRC operation result
; Compare the value with the stored expected
; value.
HALT mode
Correctly complete
Abnormal complete
Set FEA5 to FEA0 bits
PGCRCL = 0000H
CRC0EN = 0
Read the value of PGCRCL.
Execute the RET instruction.
All xxMKx = 1
Copied to RAM to HALT instruction
and RET instruction,
initialize 10 bytes
CRC0EN = 1
Compare the value with
the expected CRC value.
Match
Not match
CALL instruction
Execute the HALT instruction.