Flash Controller Memory Module
506
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
Internal Memory
5.3.10.3 SECDED Logic Correctness Check
Since error detection and correction logic is part of safety-critical logic, safety applications may need to
ensure that the SECDED logic is always working properly. For these safety concerns, in order to ensure
the correctness of the SECDED logic, an ECC test mode is provided to test the correctness of ECC logic
periodically. In this ECC test mode, instead of a data/ECC read from bank and address given to the bank
for read, a user-configurable 64-bit data/8-bit ECC check bits (FDATAH_TEST, FDATAL_TEST,
FECC_TEST) and address (FADDR_TEST) are fed to SECDED logic. Using this test mode, users can
introduce single-bit errors or double-bit errors or address errors and check whether SECDED logic is
catching those errors or not. Users can also check if SECDED logic is reporting any false errors when no
errors are introduced.
This ECC test mode can be enabled by setting the ECC_TEST_EN bit in the FECC_CTRL register. When
the ECC test mode is enabled, the CPU cannot read the data from flash and instead the CPU gets data
from the ECC test mode registers (FDATAH_TEST/FDATAL_TEST). This is because ECC test mode
registers (FDATAH_TEST, FDATAL_TEST, FECC_TEST) are multiplexed with data from the flash.
Hence, the CPU should not read/fetch from flash when ECC test mode is enabled. For this reason, ECC
test mode code should be executed from RAM and not from flash.
Only one of the SECDED modules (out of the two SECDED modules that work on the lower 64 bits and
upper 64 bits of a read 128-bit data) at a time can be tested. The ECC_SELECT bit in the FECC_CTRL
register can be configured by users to select one of the SECDED modules for test.
To test the ECC logic using ECC test mode, follow the steps below:
1. Obtain the ECC for a given flash address (64-bit aligned) and 64-bit data by using
Fapi_calculateECC() function provided in Flash API. For the C28x subsystem, remember that this
function needs a byte address and hence left shift the address by one position before passing the
address to this function. For the M3 subsystem, the address can be passed as is.
2. Develop an application to test ECC logic using the above data. In this application:
•
For the single-bit error test, set the single-bit error threshold to 0. This step is not required for
uncorrectable errors.
•
Write the 64-bit aligned, 19-bit flash address in the FADDR_TEST register.
•
Write 64-bit data in the FDATAx_TEST register.
•
Write the corresponding 8-bit ECC in the FECC_TEST register.
•
In any of the above three steps, users can insert errors (single-bit data error or double-bit data
error or address error or single-bit ECC error or double-bit ECC error) so that they can check
whether or not ECC logic is able to catch the errors.
•
Select the ECC logic block (lower 64 bits or upper 64 bits) which needs to be tested using the
ECC_SELECT bit in the FECC_CTRL register.
•
Enable ECC test mode using the ECC_TEST_EN bit in the FECC_CTRL register to enable ECC
test logic to evaluate the address, data, ECC in FADDR_TEST, FDATAx_TEST and FECC_TEST
registers for ECC errors.
•
In the flash single-bit error ISR and in the NMI ISR, disable the ECC test mode (ECC_TEST_EN =
0). This is important because the ECC test mode, when enabled, will continuously evaluate the test
mode registers for errors in every cycle and hence, single-bit error interrupt and/or NMI will occur
continuously until the ECC test mode is disabled.
Once the above ECC test mode registers are written by the user:
•
The FECC_OUTH register holds the data output bits 63:32 from the SECDED block under test
•
The FECC_OUTL register holds the data output bits 31:0 from the SECDED block under test
•
The FECC_STATUS register holds the status of single-bit error occurrence, uncorrectable error
occurrence, and error position of single bit error in data/check bits
5.3.11 Reserved Locations Within Flash and OTP
When allocating code and data to flash and OTP memory, keep the following reserved locations of
flash/OTP in mind:
•
M3 OTP has reserved locations for OTPSECLOCK, Zone 2 Flash entry point and EMAC ID whose