Other Parts Discussed in Thread: TMS570LS3137,
Hi,
I am trying to perform a PBIST self-check using the below code.
void pbistSelfCheck(void)
{
volatile uint32 i = 0U;
uint32 PBIST_wait_done_loop = 0U;
/* USER CODE BEGIN (13) */
/* USER CODE END */
/* Run a diagnostic check on the memory self-test controller */
/* First set up the PBIST ROM clock as this clock frequency is limited to 90MHz */
/* Disable PBIST clocks and ROM clock */
pbistREG->PACT = 0x0U;
/* PBIST ROM clock frequency = HCLK frequency /2 */
/* Disable memory self controller */
systemREG1->MSTGCR = 0x00000105U;
/* Disable Memory Initialization controller */
systemREG1->MINITGCR = 0x5U;
/* Enable memory self controller */
systemREG1->MSTGCR = 0x0000010AU;
/* Clear PBIST Done */
systemREG1->MSTCGSTAT = 0x1U;
/* Enable PBIST controller */
systemREG1->MSINENA = 0x1U;
/* wait for 32 VBUS clock cycles at least, based on HCLK to VCLK ratio */
/*SAFETYMCUSW 134 S MR:12.2 <APPROVED> "Wait for few clock cycles (Value of i not used)" */
/*SAFETYMCUSW 134 S MR:12.2 <APPROVED> "Wait for few clock cycles (Value of i not used)" */
for (i=0U; i<(32U + (32U * 1U)); i++){ /* Wait */ }
/* USER CODE BEGIN (14) */
/* USER CODE END */
/* Enable PBIST clocks and ROM clock */
pbistREG->PACT = 0x3U;
/* CPU control of PBIST */
pbistREG->DLR = 0x10U;
/* Custom always fail algo, this will not use the ROM and just set a fail */
pbistREG->RAMT = 0x00002000U;
*(volatile uint32 *)0xFFFFE400U = 0x4C000001U;
*(volatile uint32 *)0xFFFFE440U = 0x00000075U;
*(volatile uint32 *)0xFFFFE404U = 0x4C000002U;
*(volatile uint32 *)0xFFFFE444U = 0x00000075U;
*(volatile uint32 *)0xFFFFE408U = 0x4C000003U;
*(volatile uint32 *)0xFFFFE448U = 0x00000075U;
*(volatile uint32 *)0xFFFFE40CU = 0x4C000004U;
*(volatile uint32 *)0xFFFFE44CU = 0x00000075U;
*(volatile uint32 *)0xFFFFE410U = 0x4C000005U;
*(volatile uint32 *)0xFFFFE450U = 0x00000075U;
*(volatile uint32 *)0xFFFFE414U = 0x4C000006U;
*(volatile uint32 *)0xFFFFE454U = 0x00000075U;
*(volatile uint32 *)0xFFFFE418U = 0x00000000U;
*(volatile uint32 *)0xFFFFE458U = 0x00000001U;
/* PBIST_RUN */
pbistREG->rsvd1[1U] = 1U;
/* wait until memory self-test done is indicated */
/*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
while ((systemREG1->MSTCGSTAT & 0x1U) != 0x1U)
{
PBIST_wait_done_loop++;
}/* Wait */
/* Check for the failure */
if ((pbistREG->FSRF0 & 0x1U) != 0x1U)
{
/* No failure was indicated even if the always fail algorithm was run*/
selftestFailNotification(PBISTSELFCHECK_FAIL1);
}
else
{
/* Check that the algorithm executed in the expected amount of time. */
/* This time is dependent on the ROMCLKDIV selected above */
if (PBIST_wait_done_loop >= 2U)
{
selftestFailNotification(PBISTSELFCHECK_FAIL2);
}
/* Disable PBIST clocks and ROM clock */
pbistREG->PACT = 0x0U;
/* Disable PBIST */
systemREG1->MSTGCR &= 0xFFFFFFF0U;
systemREG1->MSTGCR |= 0x5U;
}
}
The code is taken from the TI provided for the controller TMS570LS3137 SafeTI diagnostic library 2.4.0.
Please find the highlighted code line where the PBIST run is happened by setting the reserved location to 0x1. The description about the same is provided in the manual of TMS570LS3137 but not in TMS570LC4357.
Could you please provide the reference for this location w.r.t. the TMS570LC4357controller that helps in verification.
Thanks,
Tirumala.