Other Parts Discussed in Thread: SEGGER, HALCOGEN
Hello,
TRM chapter 8.4.10 description and register content seems conflicting.
Description says that test will always fail:
But description looks to give option to run the check without failure by setting 4th bit (FAULT_INS) to value 0. But based on my experience the STC selfcheck will always fail despite of FAULT_INS bit value, is this behavior expected? SafeTI-library status checker SL_SelfTest_Status_STC()-fucntion returns TRUE and flags ST_FAIL even when FAULT_INS==0 to "st_result", "CPU1Failure" and "CPU2Failure" variables so "TimeoutFailure" is ST_PASS and thus not occured..
Second problem concerns timeout value in STCTPR-register during self check. When running self-check ( STCSCSCR bit SELF_CHECK_KEY == 0xA) the maximum value 0xFFFFFFFF looks to hang-up the CPU somewhere, instead same value works if "STC_RUN" is given as argument to SL_SelfTest_STC()-function. In self check/ phase also value 0x1000 hangs up the CPU and at least values 0x100 and smaller works...
Here is code, where behavior of the start-up test depends on the selected timeout value
stcSelfTestConfig.stcClockDiv = 0; /* STC Clock divider = 1 */
stcSelfTestConfig.intervalCount = 1; /* One interval only */
stcSelfTestConfig.restartInterval0 = TRUE; /* Start from interval 0 */
stcSelfTestConfig.timeoutCounter = 0x100U; // 0x1000 ---- does not work, hangs cpu ; /* Timeout counter*/
_SL_HoldNClear_nError();
SL_SelfTest_STC( STC_COMPARE_SELFCHECK, TRUE, &stcSelfTestConfig );
And here is example of working actual stc test where STC_MAX_TIMEOUT is 0xFFFFFFFF and this works
stcSelfTestConfig.stcClockDiv = 0; /* STC Clock divider = 1 */
stcSelfTestConfig.intervalCount = 24; /* One interval only */
stcSelfTestConfig.restartInterval0 = TRUE; /* Start from interval 0 */
stcSelfTestConfig.timeoutCounter = STC_MAX_TIMEOUT; /* Timeout counter*/
SL_SelfTest_STC( STC_RUN, TRUE, &stcSelfTestConfig );