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.

TMS570LC4357: nERROR-pin behavior about HALCoGen example (example_SafetyLib.c)

Guru 10235 points
Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN, TMDX570LC43HDK

Hello, TI Experts,

 

Our customer sent us some additional questions  about HALCoGen example code  from E2E thread as below;

   - HALCoGen: 04.05.02

   - SafeTI Diagnostic LibraryVersion: 2.2.0

   - CCS:Version 6.1.3.00033

   - sample_code:\Hercules\HALCoGen\v04.05.02\examples\TMS570LC43x\example_SafetyLib.c

   http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/565357/2075947#2075947 

 

From the advice as below of the E2E thread, IESRx,ILSRx related problem seemed to be solved.

Thank you very much!

  - Configure within Halcogen then re-generate the code.

  - EsmInit should be called after you have ran through all of the initial startup diagnostics.

 

Now our customer is checking the nERROR-pin behavior with the IEPSR4 register setting in esminit().

  - They created the CCS project based on the guide written in example_SafetyLib.c of HALCoGen.

  - ESM register setting was done by ESM tab of HALCoGen.

  - We checked the point of  the generated file "HL_esm.c".

      - set bit20 of IEPSR4 to enable nERROR-pin

        esmREG->IEPSR4 = .. | (uint32)((uint32)1U << 20U) | ..

 

Result:

   - This program reachs to main();

   - ESM error flags are as below

       ESMSR1 0x00000000

       ESMSR2 0x00000000

       ESMSR3 0x00000000

       ESMSR4 0x00000000 (Gr1-52 also cleared)

   - But nERROR-LED turns on on the TMS570LC4357-EVM(TMDX570LC43HDK).

 

Question:

  - Why does nERROR-LED turn on, after clearing ESM FLAGS in esminit() ?

 

Now, We are checking  the behaviors as follows;

  case1: Checking error source

    - We comment out following statements in HL_esm.c to remove ESM-flag clear operations.

      //    esmREG->SR1[0U] = 0xFFFFFFFFU;

      //    esmREG->SR1[1U] = 0xFFFFFFFFU;

      //    esmREG->SSR2    = 0xFFFFFFFFU;

      //    esmREG->SR1[2U] = 0xFFFFFFFFU;

      //    esmREG->SR4[0U] = 0xFFFFFFFFU;

      //    esmREG->SR7[0U] = 0xFFFFFFFFU;

 

    - The result

       ESMSR1 0x00000000

       ESMSR2 0x00000000

       ESMSR3 0x00000000

       ESMSR4 0x00100000 (Gr1-52 is set)   

       nERROR-LED turns on.

       -> We identified the error source is only Gr1-52.

 

 case2: Checking EKR register behavior (because EKR seems to be related to  nERROR-pin behavior.)

   - We only comment out following statements in "HL_esm.c" to remove EKR register setting,

      //   esmREG->EKR = 0x00000000U;

 

   - The result

       ESMSR1 0x00000000

       ESMSR2 0x00000000

       ESMSR3 0x00000000

       ESMSR4 0x00000000

       nERROR-LED turns off. (but we don't know why nERROR-LED turns off)

 

 case3: Solve the problem on Latest version HALCoGen or not?

  - We used Latest version HALCoGen(04.06.01)

  - The result is same as case1. (It seems the problem is not solved.)

 

 case4: Solve the problem on Latest version SafeTI-Lib or not?

  - We used Latest version SafeTI Diagnostic LibraryVersion(2.3.1)

  - The result:

     -This program went into while(1)-loop.

     -If we rewrite to "PERIPHRAMECCCHECK_ENABLE == 0" in example_SafetyLib.c,

       this program reachs to main();

       ESMSR1 0x00000000

       ESMSR2 0x00000000

       ESMSR3 0x00000000

       ESMSR4 0x00000000

       nERROR-LED turns on.

 

We would appreciate if you tell us how to solve this "nERROR-LED" problem.

We would also appreciate if you check the attached our CCS-projects.

 

Best regards,

7713.CCS_Project_Files.zip

  • Hello,

    I will run your project on my bench and check the LED later.

    Regards,
    QJ
  • Hello,

    Thank you very much for your kindness.
    I really appreciate your help.

    I am waiting for your reply.

    Best regards,

  • Hi,

    Thank you for your help.
    Do you have any update?

    Now, our customer is waiting for the answer.

    I would appreciate if you tell us about the progress on this.

    Best regards,

  • Hi, QJ

    Do you have any update?
    We are waiting for your reply.

    Best regards
  • Hi Matusan,

    I am sorry for the delay. The esmInit() clears all the status registers (SR1/2/3/4/7), and disables the error pin channels, and disables the interrupts. We need to modify esmInit() to show the error bits in the status register, to enable the interrupts for channel 52 of group 1. The new esmInit() will be attached. 

    My test shows that the SR1=0x0, SR2=0x0, SR3=0x0, SR7=0x0, but SR4=0x00100000, and the interrupt offset (ESMIOFFHR) is 0x55 (channel 52 of group 1). Channel 52 of group 1 is the interconnect global error which is listed in ERRATA (device #48). I will figure out why the ErrPinStat is not cleared tomorrow. 

    0245.HL_esm.c

    Regards,

    QJ

  • Hello,

    Thank you very much for your kindness.
    We really appreciate your help.

    We are waiting for the next reply. (how to solve this "nERROR-LED" problem?). 

    Best regards,

  • Hi Mutusan,

    I did more test on LC43x HDK today, everything works as expected. The interconnect global error (channel 52 of group1) is set after STC self test, the error pin status register is cleared (error occurs), and the error LED on HDK is turned on.

    I add several statements just before calling the esmInit() in example_safetylib.c. 

    /* - Activates normal mode */
    esmREG->EKR = 0x00000000U;
    /** - Set interrupt level for channel 52 of Group2 */
    esmREG->ILSR4 = 0x00100000;
    /** - Enable error pin channels for channel 52 of Group2 */
    esmREG->IEPSR4 = 0x00100000;
    /** - Enable interrupts for channel 52 of Group2 */
    esmREG->IESR4 = 0x00100000U;

    while(1);

    Those statements enable the interrupt, set the interrupt level, enable the error pin of the channel 52 of group 1, and put the ESM module into normal mode. After you load the program to the flash, it will run to this while(1) loop automatically. In registers panel, you will see that the Stat4 is 0x0010,0000, the interrupt offset register (IntOffstHigh) is 0x55 (channel 52 of group 1), and error pin status register (ErrPinStat) is 0x0 (error occurs).

    The error response generation mechanism can also be tested manually for forcing an error condition. In registers panel, write 0x0A to ESMEKR will force the ERROR pin LOW. Write 0x0 to ESMEKR to put the ESM back to the active normal mode.

    Regards,

    QJ

  • Hello, QJ

    Thank you very much for reporting the progress.

    We would appreciate if you tell us how to solve this "nERROR-LED" problem.

    Best regards,

  • Hello, QJ

    Thank you for your help.
    Do you have any update?

    Now, our customer is waiting for the answer so long on this issue.

    We would appreciate if you tell us how to solve this "nERROR-LED" problem.

    Best regards,
  • Hi Matusan,

    As I said in my previous post, the error pin is turned on since the channel 52 of group 1 is SET (error). The STAT4 is 0x0000_0000 since it was cleared in esmInit(). If they use my code (April 4th) before esmInit(), they will get the right value for STAT4 90x00100000).

    Regards,
    QJ
  • Hello, QJ

     

    Thank you for your replay.

     

    We understand " the error pin is turned on since the channel 52 of group 1 is SET (error)".

    What we would like to know is "how to turn off the error pin(nERROR-LED).

     

    Could you explain the recommended way of turning off the error pin(nERROR-LED)?

     

    P.S. Both workaround of the page31 of Errata(SPNZ180D) cannot work. please tell us the proper way.

            http://www.ti.com/lit/er/spnz180d/spnz180d.pdf

    Workaround(s) (1)Clear the ESM group 1 channel 52 flag if set after the STC1 (CPU) self-test.
                              (2)Slow down GCLK to the maximum spec of HCLK the STC1 (CPU) self-test.

    Best regards,