This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
i am trying to run a STC Self Test on my CortexR5F at the startup phase. So i called the function "SL_SelfTest_STC(STC1_RUN, TRUE, &stcSelfTestConfig)" in the "HL_sys_startup.c" module.
But each time i run or debug the Program the function fails to start returning 'False', which indicates that the function SL_SafeTest_STC() is failed.
If i run a STC self check diagnostic, it also fails. The function "SL_SelfTest_STC(STC1_COMPARE_SELFCHECK, TRUE, &stcSelfTestConfig)" returns 'False'.
Can someone tell me please why this happens?
Regards
Rabie
Hi,
Can you please send us the complete startup file so that we can have a look at how the init part is done?
Thanks and Regards,
Veena
Hi,
I was unable to recreate the scenario. I replaced my startup file with the file you had sent and the PBIST and STC tests seems to execute without any issues.
STC self test function created a CPU reset and did not return to the next statement where the retVal was checked.
retVal=SL_SelfTest_STC(STC1_COMPARE_SELFCHECK, TRUE, &stcSelfTestConfig);
if(!retVal)
{
/*Fail to start STC Self-Test */
while(1);
}
Both the tests may return fail when the ESM error is set. It does not proceed to the test if the ESM error pin set. Please check whether the ESM error status is set or not before executing the tests.
Thanks and Regards,
Veena
Hi Veena,
it is really a good news to hear that, the code sample i sent it to you, is working.
But unfortunately i still have the same problem while executing the STC self check.
My first question is:
Which Register did you mean when saying "ESM error/ESM error pin/ESM error status"?
i did the following before calling "SL_SelfTest_STC(STC1_COMPARE_SELFCHECK, TRUE, &stcSelfTestConfig)" :
#if STC_ENABLE == 1
{
boolean retVal;
SL_STC_Config stcSelfTestConfig;
esmClearStatus(esmGROUP1,esmCHANNEL52);
esmActivateNormalOperation();
esmREG->EEPAPR1 = 0x00000000;
stcSelfTestConfig.stcClockDiv = 2; /* STC Clock divider = 1 */
stcSelfTestConfig.intervalCount = 1; /* One interval only */
stcSelfTestConfig.restartInterval0 = TRUE; /* Start from interval 0 */
stcSelfTestConfig.timeoutCounter = 0xFFFFFFFF; /* Timeout counter*/
retVal=SL_SelfTest_STC(STC1_COMPARE_SELFCHECK, TRUE, &stcSelfTestConfig);
if(!retVal)
{
while(1); /* STC failed to start */
}
}
#endif
I looked at the registers which may be important for my case and i found the following:
before calling SL_SelfTest_STC(), the Register ErrPinStat = 0x00000001 and ErrKey=0x00000000
after calling SL_SelfTest_STC(), the Register Stc1_GStat = 0x00000A03 and Stc1_FStat=0x00000003
The function SL_SelfTest_STC() didn't return anything, that is right , but it is not reset the CPU, no matter how long i wait.
Could you tell me please exactly which registers should i set, before calling the STC self test and how long did i takes time to reset the CPU?
Thank you and best regards
Rabie
Hi Rabie,
I was referring to the ESM error pin status. The value is reflected in the register ErrPinStat. The register value should be 1 before running the STC selftest. Looks like the there was no ESM error in your case.
If the selftest neither returned and nor did it generate a CPU reset, where did the code execution go? How did you check that the CPU reset never occurred?
How I check this is, I keep a loop-to-itself instruction in the CPU reset handler.
Once the PC hits the instruction "B $", it does not proceed to the next statement unless you force the PC to move to the next statement. This way, I know CPU reset has occurred.
Thanks and Regards,
Veena
Hi Veena,
thank you for the answer.
in the last 2 days it was successful to kickoff the function SL_SelfTest_STC(STC1_COMPARE_SELFCHECK, TRUE, &stcSelfTestConfig) and to verify that this function generates a CPU reset by looking at the Debug Window left above.
But now my very big Problem is that the register "ErrPinStat" is always Zero, which means an error has been occurred. I did many things to clear this register by writing "ErrPinStat = 0x01", but this is not working and didn't change the value of the register. I then used all possible functions in the "ESM" module, but still not working. I also tried to reduce the value of the "LtCnt" register and to write "ErrKey = 0x5", but also this has no effect.
As you know the Self Tests functions will never kicked off if the "ErrPinStat" is equal to Zero. So How could i reset this register "ErrPinStat" back to '1' ?
And How to know which reason behind this value inside the register?
Thanks for helping
Regards
Rabie
Hi Chuck,
in the following diagram you can see the registers. The "ErrPinStat" is always Zero which make impossible to kickoff a Self Test function. According to the Document (spnz180d) Device#56, this is a known issue. I tried to solve it using the described Workaround, but this is not working. I also run the Program without using the JTAG, but this is also not working.
Thank you and Regards