STC Configuration Example
357
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
CPU Self-Test Controller (STC) Module
8.5
STC Configuration Example
The following examples assume that the PLL is locked and selected as the system clock source with
HCLK = 180 MHz and VCLK = 90 MHz.
8.5.1 Example 1: Self-Test Run for 24 Interval
This example explains the configurations for running STC Test for maximum Test Intervals 24.
1. Maximum STC clock rate support at 180 MHz HCLK is 90 MHz. Divide HCLK by 2 to achieve this
clock rate. STCCLKDIV[26:24] register in the secondary system module frame at location
0xFFFF E108 is used.
STCCLKDIV[26:24] = 1
2. Clear CPU_RST status bit in the System Exception Status Register in the system module.
SYSESR[5] = 1
3. Configure the test interval count in STC module.
STCGCR0[31:16] = 24
4. Configure self-test run time out counter preload register.
STCTPR[31:0] = 0xFFFFFFFF
5. Enable CPU self-test.
STCGCR1[3:0]= 0xA
6. Perform a context save of CPU state and configuration registers that get reset on CPU reset.
7. Put the CPU in idle mode by executing the CPU idle instruction.
asm(“ WFI”)
8. Upon CPU reset, verify the CPU_RST status bit in the System Exception Status Register is set. This
also verifies that no other resets occurred during the self-test.
SYSESR[5] == 1
9. Check the STCGSTAT register for the self-test status.
Check TEST_DONE bit before evaluating TEST_FAIL bit.
If TEST_DONE = 0 the self-test is not completed. restart the STC test by going to Step 5.
If (TEST_DONE = 1 and TEST_FAIL = 1) the self-test is completed and Failed.
•
Read STC Fail Status Register STCFSTAT[2:0] to identify the type of Failure (Timeout, CPU1 fail,
CPU2 fail).
In case there is no failure (TEST_DONE = 1 and TEST_FAIL = 0), the CPU self-test is completed
successfully.
•
Recover the CPU status, configuration registers and continue the application software.