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.

SafeTI based TMS570LS initialization

Other Parts Discussed in Thread: TMS570LS1115, HALCOGEN

Hello,


I have used the SafeTI library initialization code to initialize the TMS570LS1115 MCU. It is working properly. But I would like to be sure that the SafeTI based initialization covers all the aspects of the initialization sequence described in application note SPNA106D (Initialization of Hercules™ ARM® Cortex™-R4F
Microcontrollers)

I crosschecked the HALCoGen generated sys_startup.c, SaftTI example startup code and the application note.

In the application note section 2, there are 57 initialization steps.

1. I could not find the FPU enable function in either HALCoGen generated code or SafeTI example code. How to enable FPU?

2. The application note points 3, 4 and 5 are handled in the HALCoGen generated code through following function calls.

_coreEnableEventBusExport_();

flashWREG->FEDACCTRL1 = 0x000A060AU;

_coreEnableFlashEcc_();

But I cannot see that code in SafeTI example code. Do we need to combine this code with SafeTI example code?

3. The step 22 of initialization application note talks about LBIST on CPU. I believe this is achieved by calling

 pbistSelfCheck();

But this is not available in SafeTI code. How to perform this test?

4. In the HALCoGen code., before running PBIST tests on ESRAM following function is called to Disable RAM ECC.

_coreDisableRamEcc_();

But it is not called in the SafeTI example? Is this internally handled by the SafeTI library?

5. Following errata function is not called in SafeTI example. Do we need that errata function

errata_PBIST_4();

6. Initialization steps 34,35 and 36 talks about memory auto initialization and checking parity error detection mechanism for peripherals. This is implemented in the HALCoGen sys_startup.c code.

It calls number of xxxxParityCheck() functions for different peripherals. But this is not done in SafeTI example. In this case do I need to use this code in combination with the SafeTI code for proper operation? (I have copied the code below

 mibspiREG1->GCR0 = 0x1U;
     
    /* Release the MibSPI3 modules from local reset.
     * This will cause the MibSPI3 RAMs to get initialized along with the parity memory.
     */
    mibspiREG3->GCR0 = 0x1U;
    
    /* Release the MibSPI5 modules from local reset.
     * This will cause the MibSPI5 RAMs to get initialized along with the parity memory.
     */
    mibspiREG5->GCR0 = 0x1U;
    
/* USER CODE BEGIN (56) */
/* USER CODE END */

    /* Enable parity on selected RAMs */
    enableParity();
    
    /* Initialize all on-chip SRAMs except for MibSPIx RAMs
     * The MibSPIx modules have their own auto-initialization mechanism which is triggered
     * as soon as the modules are brought out of local reset.
     */
    /* The system module auto-init will hang on the MibSPI RAM if the module is still in local reset.
     */
    /* NOTE : Please Refer DEVICE DATASHEET for the list of Supported Memories and their channel numbers.
              Memory Initialization is perfomed only on the user selected memories in HALCoGen's GUI SAFETY INIT tab.
     */
    memoryInit( (uint32)((uint32)1U << 1U)    /* DMA RAM */
              | (uint32)((uint32)1U << 2U)    /* VIM RAM */
              | (uint32)((uint32)1U << 5U)    /* CAN1 RAM */
              | (uint32)((uint32)1U << 6U)    /* CAN2 RAM */
              | (uint32)((uint32)1U << 10U)   /* CAN3 RAM */
              | (uint32)((uint32)1U << 8U)    /* ADC1 RAM */
              | (uint32)((uint32)1U << 14U)   /* ADC2 RAM */
              | (uint32)((uint32)1U << 3U)    /* HET1 RAM */
              | (uint32)((uint32)1U << 4U)    /* HTU1 RAM */
              | (uint32)((uint32)1U << 15U)   /* HET2 RAM */
              | (uint32)((uint32)1U << 16U)   /* HTU2 RAM */
              );

    /* Disable parity */
    disableParity();
    
    /* Test the parity protection mechanism for peripheral RAMs
       NOTE : Please Refer DEVICE DATASHEET for the list of Supported Memories with parity.
                 Parity Self check is perfomed only on the user selected memories in HALCoGen's GUI SAFETY INIT tab.
    */

/* USER CODE BEGIN (57) */
/* USER CODE END */
     
    het1ParityCheck();
    
/* USER CODE BEGIN (58) */
/* USER CODE END */

    htu1ParityCheck();
    
/* USER CODE BEGIN (59) */
/* USER CODE END */

    het2ParityCheck();
    
/* USER CODE BEGIN (60) */
/* USER CODE END */

    htu2ParityCheck();
    
/* USER CODE BEGIN (61) */
/* USER CODE END */

    adc1ParityCheck();
    
/* USER CODE BEGIN (62) */
/* USER CODE END */

    adc2ParityCheck();
    
/* USER CODE BEGIN (63) */
/* USER CODE END */

    can1ParityCheck();
    
/* USER CODE BEGIN (64) */
/* USER CODE END */

    can2ParityCheck();
    
/* USER CODE BEGIN (65) */
/* USER CODE END */

    can3ParityCheck();
    
/* USER CODE BEGIN (66) */
/* USER CODE END */

    vimParityCheck();
    
/* USER CODE BEGIN (67) */
/* USER CODE END */

    dmaParityCheck();


/* USER CODE BEGIN (68) */
/* USER CODE END */

/*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
    while ((mibspiREG1->FLG & 0x01000000U) == 0x01000000U)
    { 
    }/* Wait */                 
    /* wait for MibSPI1 RAM to complete initialization */
/*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
    while ((mibspiREG3->FLG & 0x01000000U) == 0x01000000U)
    { 
    }/* Wait */                 
    /* wait for MibSPI3 RAM to complete initialization */ 
/*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
    while ((mibspiREG5->FLG & 0x01000000U) == 0x01000000U)
    { 
    }/* Wait */                 
    /* wait for MibSPI5 RAM to complete initialization */

/* USER CODE BEGIN (69) */
/* USER CODE END */

    mibspi1ParityCheck();
    
/* USER CODE BEGIN (70) */
/* USER CODE END */

    mibspi3ParityCheck();
    
/* USER CODE BEGIN (71) */
/* USER CODE END */
    
    mibspi5ParityCheck();



7. After the 44th initialization step, the rest of the steps are not available in either of the codes.
(ie. HALCoGen and SafeTI) Therefore please instruct on how to perform 44 - 54 initialization steps. They are not described in the application note.

I know the question is lengthy. But I would like to know for sure that I am doing this properly since the application demands proper safety.

Thank you

  • Hi,
    We have received your post and will get back with you.
  • Hi,

    When you mention SafeTI example startup code, are you referring to the startup code available in Safety Diagnostics Library demo app or the sample startup code available in HALCoGen itself?

    Following are my comments about the HALCoGen generated startup.c file.:

    1. I could not find the FPU enable function in either HALCoGen generated code or SafeTI example code. How to enable FPU?

    A: HALCoGen provides an option to enable/disable FPU in startup (Refer HALCoGen TAB TMS570xxx->R4-MPU-PMU-> Cortex-R4). This is done as part of _coreInitRegisters_ in the startup (sys_core.asm file). The function also initializes all the FPU registers. Probably the comments are missing for that part. It also provides assembly function _coreEnableVfp_ to enable the FPU.

    7. After the 44th initialization step, the rest of the steps are not available in either of the codes.(ie. HALCoGen and SafeTI) Therefore please instruct on how to perform 44 - 54 initialization steps. They are not described in the application note.
    A: These steps are not done as part of startup code because they all are application dependent. However, we provide APIs to help users implement those steps in their application. For example the MPU initialization, we provide the GUI to configure the MPU regions and generate the mpu_init function which needs to called in the application. Similarly, HALCoGen provides the APIs to enable users perform the initialization code / tests required in their application. Please refer the module levels APIs available.

    I will check with Safety Diagnostic Library team on the other questions and get back to you shortly.

    Thanks and Regards,

    Veena

  • Hi Pradeepa,


    I'll add to the answers provided by Veena:

    • Answer for question 2 – These points are being implemented later in SafeTI Lib example startup code by “SL_Init_ECCFlash(10, FLASHECC_DEFAULT)”. Move this call up in the code to match the initialization sequence described in application note (this should have been the implementation in the first place in SafeTI Lib code/will be fixed in next release).

    • Answer for questions 3,5,6 – These functionalities are auto appended in SafeTI Lib startup code by enabling the respective features in the HalCoGen project and generating the code. In other words we are appending the HalCoGen generated code in the SafeTI Lib startup.c for these functionalities.

    • Answer for question 4 – RAM ECC is not enabled when calling PBIST test on ESRAM in case of SafeTI Lib. It is being enabled later by the call SL_Init_ECCTCMRAM(10, TRUE).

    Thanks,
    Vivs
  • Thank you very much for your answers. I have modified my code based on the guidelines. Still I have to understand some tiny details.

    Veena Kamath said:

    When you mention SafeTI example startup code, are you referring to the startup code available in Safety Diagnostics Library demo app or the sample startup code available in HALCoGen itself?

    What I mentioned was the demo app code.


    Vivs Shitole said:


    • Answer for questions 3,5,6 – These functionalities are auto appended in SafeTI Lib startup code by enabling the respective features in the HalCoGen project and generating the code. In other words we are appending the HalCoGen generated code in the SafeTI Lib startup.c for these functionalities.

    In other words these code is generated through SafeTI, we should not ufe #if 0 ... #endif to remove them because SafeTI library will not carry out these tests. Am I correct? By safe ti lib startup.c I hope you are referring to sys_startup.c file generated by HALCoGen and edited to include SafeTI funtions.

    Following are few additional questions:

    1. Initialization step 21 requires to run a diagnostic check on the CPU STC. Is this the reason for the function call

    SL_SelfTest_STC(STC_COMPARE_SELFCHECK, TRUE, &stcSelfTestConfig);

    2. Initialization step 22 requires to run the BIST on CPU. Is this the reason for the function call

    SL_SelfTest_STC(STC_RUN, TRUE, &stcSelfTestConfig);

    3. Initilization steo 29, 30 talks about self test on the CPU's SECDED logic for access to B0TCM, B1TCM and ATCM. Where are these implemented?