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.

PBIST Enters trap when not stepping through

Hi All,

I am attempting to use the Hercules' PBIST suite to verify the RAM banks before application startup. I have implemented a very basic PBIST configuration and test using the March13N RAM verification algorithm. My problem is the following: if I step through my application in the debugger, everything works fine, but if I just run it in the debugger (or after POR) it crashes. If I pause the debugger I can see that my program counter is at 0x00000004 after everything crashes. Not really sure what is going on here. Any help would be appreciated!

Below is my PBIST code:

void main(void)
{
/* USER CODE BEGIN (3) */
/* PBIST SEQUENCE */
#define USE_PBIST
#ifdef USE_PBIST
   {
      int i = 0;

      // wait for CPU to come out of reset
      while ((systemREG1 -> CPURSTCR) > 0);

      systemREG1 -> MSTGCR |= 0x00000200; // ROM Source clk GCLK / 4. PBIST will reset for 64 VBUS cycles
      systemREG1 -> MSINENA = 0x1U; // global PBIST state machine enable
      systemREG1 -> MSTGCR = 0x0000020AU;  // memory self test enable key
      for (i = 0; i < 256; i++)
      {
         // burn loop, wait for VBUS to reset
      }

      pbistREG -> PACT |= 0x3U;  // enable PBIST & ROM clocks
      pbistREG -> OVER |= 0x1U;  // enable RAM overide
      pbistREG -> ALGO = 0xCU;   // run the March13n algorithm for both single & dual port RAM banks
      pbistREG -> ROM = 0x3U;
      pbistREG -> DLR = 0x14U;    // enable editing of the PBIST config regs

      while (!((systemREG1 -> MSTCGSTAT) & 0x1U))
      {
         // burn loop, wait for memory self test to complete
      }

      // fail case
      if (pbistREG -> FSRF0 == 0x1U || pbistREG -> FSRF1 == 0x1U)
      {
         // TODO figure out how to signal a failure
      }

      // pass case
      pbistREG -> PACT = 0;   // disable PBIST & ROM clocks
      systemREG1 -> MSTGCR = 0x5U;  // disable the PBIST self test module
   }
#endif /*USE_PBIST*/

	realMain();
/* USER CODE END */
}

Thanks - Warren


CCS 6.1.1.00022

Hercules TMS570LC43xx

Tv 5.2.6

  • After PBIST test starts on a RAM, the RAM content will be replaced by the test pattern. If you do a PBIST test on the system RAM, you need to make sure that no RAM will be used after the PBIST starts. In your code, all the pointers are saved to RAM as global variables. They will be gone after PBIST starts. If you have to run PBIST in main(), you will need

    (1) define the pointers as register local so that they do not get lost after PBIST test starts. I am attaching an example code here.

    0131.pll_config1a.c

    (2) Since the stack (in RAM) content are gone, you need to generate a system reset. After CPU restarts, you will need to check the source of reset.

    Thanks and regards,

    Zhaohong

    ,

  • Seems to work!

    Thanks Zhaohong.