Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN
Tool/software: Code Composer Studio
About the STC2 test for n2HET module, the STC2 test is not running after enabling the test.
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.
Tool/software: Code Composer Studio
About the STC2 test for n2HET module, the STC2 test is not running after enabling the test.
After enabling the STC test by programming the STCGCR1 register with 0xA, the STCGSTAT register value becomes 0x00000501 which means the test has been completed, but actually the test has not been triggered yet. And after i have measured the test time, the test time come out to be around 10usec. The actual test time should be in hundreds of usec.STC2 Test not running .docx
Hi Heather,
TMS570 parts have an erratum that requires a workaround before any PBIST or LBIST (STC) can be executed correctly. This is described in the TMS570LC4357 errata document ()
Refer to issue number PBIST#4 and STC#30. Please ensure that you execute the errata_PBIST_4() function generated by HALCoGen during the start-up sequence before executing any PBIST or LBIST for target memories / processors.
Regards, Sunil
I have execute the errata_PBIST_4() function at start-up. and I have supposed to run the STC2 at start of the application program as follows:
GPIO_Config(hetPORT1,0,OUTPUT,OPENDRAIN,PULLUP,LOW); // To check the STC timing
GPIO_SetPin(hetPORT1, 0, 1);
retVal2 = SL_SelfTest_STC2();
if( FALSE == retVal2) {
for(;;);
}
GPIO_SetPin(hetPORT1, 0, 0);
And the STC2 test time only takes about 10 usec. The test time is supposed to be 100s of usec.
Regards,
Linn
Thanks for the confirmation. I will run the test on my setup tomorrow and let you know. Do you also program the STCCLKDIV field in the STC registers? STC for the HET modules is to be run at a max of fVCLK2 / 2 frequency.
Regards, Sunil
Hi Linn,
I ran the test on my setup here, and measure ~333us (using a pin toggle marker) for the STC on the two HET modules (executing in parallel). See my main code below. You can get a better time measurement using the Performance Monitoring Unit (PMU) within the CPU, just as a side note.
int main(void) { /* USER CODE BEGIN (3) */ errata_PBIST_4(); // workaround to allow ROM reads to work gioInit(); stcREG2->STCGCR0 = (9U << 16u) | (1u << 0u); // 9 intervals, restart from interval 0 stcREG2->STCSCSCR = 0u; // no fault injection stcREG2->STCTPR = 0xFFFFFFFFu; // max timeout period stcREG2->STCCLKDIV = (1u << 24u) | (1u << 16u); // both STC clock dividers set to div-by-2 stcREG2->STCFSTAT = 0xFu; // clear self-test fail status flags stcREG2->STCGSTAT = 0x3u; // clear global status flags gioSetBit(gioPORTA, 0, 1); // drive GIOA0 High to mark start of STC2 stcREG2->STCGCR1 = (0u << 8u) | (0xAu << 0u); // enable self-test on both HET modules while (!(stcREG2->STCGSTAT & 0x1)); // wait until TEST_DONE is set gioSetBit(gioPORTA, 0, 0); // drive GIOA0 Low to mark end of STC2 while(1); /* USER CODE END */ return 0; }
Hi Linn,
At this point I would have to ask you to upload a zipped file of your entire code project that I can just directly run on my setup to observe / debug the issue.
Regards, Sunil
Linn,
I see the issue now. Should have realized this sooner, sorry.
Please use an output pin other than an HET pin for signaling the start and end of STC on the HET modules. The STC also tests (and disrupts) the I/O logic inside the HET modules.
I tested your code using GIOA_0 as the marker and it shows the correct time.
Regards, Sunil