Emulation and SIL3 Diagnostic Modes
352
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
F021 Level 2 Flash Module Controller (L2FMC)
7.7.2.2
ECC Data Correction Diagnostic Test Mode: DIAGMODE = 7
Testing the error correction and ECC logic in the CPU involves corrupting the ECC value returned to the
CPU. By inverting one or more bits of the ECC, the CPU will detect errors in a selected data or ECC bit, or
in any possible value returned by the ECC.
To set an error for a particular bit use the syndrome, see
. For example, if you want to
corrupt data bit 62 then put the value 70h into the test register.
The method uses the FEMU_ECC and the FEMU_DxSW registers to alter the ECC and data,
respectively, for one Flash access port read. The values in the FEMU_ECC and FEMU_DxSW registers
will be XORed with the current ECC and data, respectively, to give a bad ECC or data value back to the
bus master. This will only occur for one read when the DIAGMODE is 7h, the DIAG_EN_KEY is 5h, and
the DIAG_TRIG is written with value of 1 in the FDIAGCTRL register.
The sequence to do this test is:
1. Branch to a non-Flash region to execute this sequence.
2. Set DIAGMODE to 7h and DIAG_EN_KEY to 5h in the FDIAGCTRL register.
3. Set desired values to XOR in the FEMU_ECC and FEMU_DxSW registers.
4. Set DIAG_TRIG to 1 in the FDIAGCTRL register.
5. Select the appropriate port in which the flip is desired using the DIAG_BUF_SEL bits in the
FDIAGCTRL register. Only legal values are 0 for port A and 4h for port B.
6. Do a port A or B read to the desired address. The L2FMC will XOR the data and ECC with
FEMU_DxSW and FEMU_ECC, respectively, for this read before delivering it to the CPU. No further
reads are affected by this diagnostic.
7. The error routine of the bus master (for example, CPU) shall cause the address and erroneous bit to
be known. This should match with the bit flipped in step 3.
8. Repeat as necessary to test out various bits of data and ECC.
9. Clear DIAGMODE to 0 and set DIAG_EN_KEY to Ah in the FDIAGCTRL register to completely disable
this test.
NOTE:
Make sure the address to be used for diagnostic is not already cached; otherwise, the read
will read from the cache memory instead of the Flash.
7.7.3 Diagnostic Mode Summary
gives a summary of the input registers needed for each mode, the possible registers that can
change, and the possible error bits in FEDACSTATUS that may set.
Table 7-10. Diagnostic Mode Summary
DIAG
MODE
Name
Inputs
Possible Outputs
Possible Error Bits Set
Notes
5
Address Tag
Register test
mode
FPRIM_ADD_TAG
ADD_TAG_ERR in
FEDAC_PxSTATUS
register
This will cause ESM
error. Please refer to the
data manual to find
group and channel
number.
FDUP_ADD_TAG
FRAW_ADDR
7
ECC Data
Correction
Diagnostic test
mode
FEMU_ECC
Bus master will indicate
data ECC single-bit or
multi-bit error.
None
This will cause ESM
error. Please refer to the
data manual to find
group and channel
number.
FEMU_DxSW