STC Configuration Example
458
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
Self-Test Controller (STC) Module
10.9
STC Configuration Example
The following example provides steps to configure STC1 to run self-test on CPUs and the µSCU unit. It
that the PLL is locked and selected as the system clock source with GCLK1 = 330 MHz and
HCLK = 110 MHz prior to going through the following configurations.
10.9.1 Example: STC1 Self-Test Run
This example explains the configurations for running STC Test for on 40 test intervals.
1. Maximum STC clock rate support at 330 MHz GCLK1 is 110 MHz. Divide GCLK1 by 3 to achieve this
clock rate. Bits STCCLKDIV[26:24] and STCCLKDIV[18:16] need to be configured.
STCCLKDIV[26:24] = 2, STCCLKDIV[18:16] = 2
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. Note that in case of multiple segments, segments run
sequentially, one after another depending on the number of intervals selected.
STCGCR0[31:16] = 40.
4. Configure self-test run time out counter preload register.
STCTPR[31:0] = 0xFFFFFFFF
5. Optionally, configure SEG0_CORE_SEL bits in register STCGCR1 to select one of the redundant
cores. By default bits SEG0_CORE_SEL are clear, which configures the STC to run both redundant
cores in parallel.
6. Enable CPU self-test.
STCGCR1[3:0]= 0xA;
7. Perform a context save of CPU state and configuration registers that get reset on CPU reset.
8. Put the CPU in idle mode by executing the CPU idle instruction.
asm(“ WFI”)
9. 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
10. Check the STCGSTAT register for the self-test status.
Check TEST_DONE bit before evaluating TEST_FAIL bit.
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, CORE1 fail,
CORE2 fail, FSEG_ID).
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.