RL78/G1P
CHAPTER 20 SAFETY FUNCTIONS
R01UH0895EJ0100 Rev.1.00
646
Nov 29, 2019
20.3.3 Operation flow
Figure 20-3
shows the flowchart of flash memory CRC operation function (high-speed CRC).
Figure 20-3. Flowchart of Flash Memory CRC Operation Function (High-speed CRC)
Start
; Store the expected CRC operation result
; value in the lowest 4 bytes.
; CRC operation range setting
Set FEA5 to FEA0 bits
PGCRCL = 0000H
All xxMKx = 1
Copied to RAM to HALT instruction
and RET instruction,
initialize 10 bytes
CRC0EN = 1
CALL instruction
; 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.
Execute the HALT instruction
CRC operation complete
Execute the RET instruction
Yes
No
; CRC operation starts by HALT instruction
; 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.
Correctly complete
Abnormal complete
CRC0EN = 0
Read the value of PGCRCL
Compare the value with
the expected CRC value
Match
Not match
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. 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 operation value can be calculated by using the integrated development environment.
Cu development environment. Refer to the Cu integrated development environment user’s manual for
details.