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.

A HALCoGen bug (TMS570 pbistSelfCheck about Flexray and pbistSelfCheck)

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

Hello : i use  HALCoGen to create my FlexRay project .but i find  i cant recive any data ,but if i based on the project of (FlexRay_Communication_CCSv5.zip),i can recive the data what i want.

i checking the sys_startup.c  i find  :   

pbistRun(  (uint32)0x00000000U    /* EMAC RAM */
             | (uint32)0x00000000U    /* USB RAM */  
             | (uint32)0x00000800U    /* DMA RAM */
             | (uint32)0x00000200U    /* VIM RAM */
             | (uint32)0x00000040U    /* MIBSPI1 RAM */
             | (uint32)0x00000080U    /* MIBSPI3 RAM */
             | (uint32)0x00000100U    /* MIBSPI5 RAM */
             | (uint32)0x00000004U    /* CAN1 RAM */
             | (uint32)0x00000008U    /* CAN2 RAM */
             | (uint32)0x00000010U    /* CAN3 RAM */
             | (uint32)0x00000400U    /* ADC1 RAM */
             | (uint32)0x00020000U    /* ADC2 RAM */
             | (uint32)0x00001000U    /* HET1 RAM */
             | (uint32)0x00040000U    /* HET2 RAM */
             | (uint32)0x00002000U    /* HTU1 RAM */
             | (uint32)0x00080000U    /* HTU2 RAM */
             | (uint32)0x00004000U    /* RTP RAM */
             | (uint32)0x00008000U    /* FRAY RAM */
             ,(uint32) PBIST_March13N_DP);

the pbist Algorithm for Fray  should not use PBIST_March13N_DP.  we should use the algorithm of PBIST_PMOSOpen_DP for fray.


and in  sys_selftest.c This function of 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 */ }

............

}

it should not clear the PBIST  Done flage in here .

i think we should  Clear PBIST Done at the end of this function.

  • I do not understand why you say not to use March13 on the dual port Flexray RAM. March13 is the recommended algorithm from TI. The PBIST test on the Flexray RAM must be done before doing the Flexray initialization. Also, not sure why you prefer to clear the PBIST done flag at the end of running the PBIST instead of at the beginning of the next PBIST run. I admit that it can be done either way, but why change the auto generated HALCoGen code?
  • HI Bob:
    thanks for your reply ;

    I do not understand why you say not to use March13 on the dual port Flexray RAM. March13 is the recommended algorithm from TI.

    You can read the file of " TMS570LS37x Technical Reference Manual.pdf " at the page of 109 and 110.the Table 2-5 and Table 2-6.

    you can find that march13n's Valid RAM Groups is not include the FlexRay' GRS。and pmos_open is include the Flexray GRS (14).

    and if i use the auto generated HALCoGen code ,and clear the PBIST done flag  at the beginning of the next PBIST run ,i can't
    recive any data from other  Node in My FlexRay project .

    if i  clear the PBIST done flag at the end .and use pmos_open as FRAY  algorithm . I can recive the data from other Node.
    To be honest. i don't konow what cause i can't recive data if the PBIST done flag is clear  at the beginning .

    if i have any wrong place ,please correct. thak you.

  • I have highlighted the Flexray dual-port RAM group from tables 2-5 and 2-6 below. March13 is supported on the Flexray dual port RAM.

    You did not mention which specific TMS570LC31x part you are using, but I captured the PBIST table from the TMS570LS3137 datasheet showing that March13 is the recommended PBIST algorithm to use in the application.

    We really did not intend for the other PBIST algorithms to be run individually. I suspect that the PBIST engine has not released use of the Flexray RAM after running the PMOS_open algorithm. What happens when you just use the HALCoGen generated code to run PBIST?

  • I’m  Really sorry, I did not understand the meaning of the data sheet。
    when i use the HALCoGen generated code to run PBIST, i am waiting  for SIR.CYCS

        // wait for cycle start interrupt flag
        Fray_PST->SIR_UN.SIR_UL = 0xFFFFFFFF;            // clear all status int. flags
        while ((Fray_PST->SIR_UN.SIR_UL & 0x4) == 0x0);    // wait for CYCS interrupt flag
        Fray_PST->SIR_UN.SIR_UL = 0xFFFFFFFF;            // clear all status int. flags

    the code will aways stay in the  line of "  while ((Fray_PST->SIR_UN.SIR_UL & 0x4) == 0x0);    // wait for CYCS interrupt flag "

    i check the register if SIR and i find SIR is 0x00000000000; if i shield the code ->

    /* | (uint32)0x00008000U     FRAY RAM */

    the code can run to well. But there are still some issues in my project.

    i created to FlexRay Node. NodeA and NodeC  i ,In Node A i created 4 Tx buffer used  send data to other FlexRay Node.
    and created 3 Rx buffer to recive the data from Node C .Similarly  in Node C i Created 3 Tx buffer usd send data to other
    FlexRay Node ,and created  4 Rx buffer used recive the data from Node A. but i find in Node A i just can recive to buffer from
    Node C ,and in Node C i can recive 4 buffer from Node A ,Front three buffer data is correct, the fourth received buffer of
    data from Node C itself first Tx buffer sent. not from Node A fourth TX buffer.
    I really do not know how this is going, is it my logic there a problem? You can view my attachments, if I want to send and receive
    large amounts of data from other nodes what should  I do ? it looks few people use FlexRay, and Not many can reference information.

    thank you very much!

    7536.NodeAandNodeC.zip