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.

TMS320F280038C-Q1: How to perform fault injection test for clock intgerity check using DCC

Part Number: TMS320F280038C-Q1


Tool/software:

Hello, TI.

I'd like to ask about the way to perform fault injection test for clock integrity check using DCC.

I already read the example code of C200 TI library. So, please please don't tell me that go and see the example.

Here is the information about I'd like to perform the test.

[Clock integrity check using DCC]

1. Count 1 Clock Source : PLL

2. PLL Clock : 120 MHz

3. Count 0 Clock Source : XTAL CLK

4. XTAL Clock : 20 MHz

5. SysCLK : 120 MHZ

6. Implemented example : DCC_continuousMonitor (I already read the example code and I already checked the syscfg so please don't mention about the example)

I tired to put the wrong clock for PLL expecting DCC fail. However, DCC result didn't get fail even when the input Count1 Clock source frequency is 10 MHz and real PLL clock freq is 120 MHz.

I have to perform fault injection test about clock monitoring using DCC.

Please help me about it.

If you need some implemented code, feel free to tell me.

Thank you in advance, I'll look forward to your detailed answer and guide.

  • Hi Seungeun,

    Please allow me to take a look at this and get back to you by the end of the week.

    Best Regards,

    Aishwarya

  • Seungeun,

    Could you share your calculatedranges for digitization error, async error, window, counter0/1, valid0, etc? Can you also share the count0/count1/valid0 used to simulate the error? It might be easier to share code snippets if you have them too. 

    Best Regards,

    Aishwarya

  • Hi Aishwarya,

    I share the implemented code and the simulated code to inject the fault.

    Please let me know if there are wrong points in my code. I'll look forward to your detailed guide.

    [Implemented code]

        CONST  uint16_t  DCC_CHCK_RETRY_CNT       = 2U;
        CONST  float32_t PLL_CLK_FREQ             = 120.0f; /* PLL frequency : 120 MHz*/
        CONST  float32_t XTAL_CLK_FREQ            = 20.0f;  /* XTAL frequency : 20 MHz*/
        CONST  float32_t CLK_TOL                  = 1.0f;   /* Tolerance : 1.0 % */
        CONST  float32_t ALLOW_TOL                = 0.0f;   /* Allowable frequency Tolerance : 0.0 % */ /* this value can be modified by test result */
        CONST  float32_t SYS_CLK_FREQ             = 120.0f; /* SysClk frequency : 120 MHz*/

        uint16_t u16DccErrSts   = CTL_U_CLR;
        uint16_t u16DccRetryCnt = CTL_U_CLR;
        uint16_t u16DccRet      = CTL_U_CLR;

        /* Continuous monitor of PLL clock using XTAL as reference clock */
        DCC_continuousMonitor(DCC0_BASE, DCC_COUNT1SRC_PLL, PLL_CLK_FREQ, DCC_COUNT0SRC_XTAL, XTAL_CLK_FREQ, CLK_TOL, ALLOW_TOL, SYS_CLK_FREQ);

        u16DccErrSts = DCC_getErrorStatus(DCC0_BASE);
       
        if(u16DccErrSts != CTL_U_CLR)
        {
            if(u16DccRetryCnt < UINT16_OVFL_GUARD)
            {
                u16DccRetryCnt++;
            }
        }
        else
        {
            u16DccRetryCnt = CTL_U_CLR;
        }

        if(u16DccRetryCnt > DCC_CHCK_RETRY_CNT)
        {
            u16DccRet = CTL_U_SET;
        }
       
        return u16DccRet;

    [Simulated code to inject fault - I just set the only PLL clock frequency to 10 MHz to cause DCC error but DCC error didn't occur]

        CONST  uint16_t  DCC_CHCK_RETRY_CNT       = 2U;
        CONST  float32_t PLL_CLK_FREQ             = 10.0f;
        CONST  float32_t XTAL_CLK_FREQ            = 20.0f;  /* XTAL frequency : 20 MHz*/
        CONST  float32_t CLK_TOL                  = 1.0f;   /* Tolerance : 1.0 % */
        CONST  float32_t ALLOW_TOL                = 0.0f;   /* Allowable frequency Tolerance : 0.0 % */ /* this value can be modified by test result */
        CONST  float32_t SYS_CLK_FREQ             = 120.0f; /* SysClk frequency : 120 MHz*/

        uint16_t u16DccErrSts   = CTL_U_CLR;
        uint16_t u16DccRetryCnt = CTL_U_CLR;
        uint16_t u16DccRet      = CTL_U_CLR;

        /* Continuous monitor of PLL clock using XTAL as reference clock */
        DCC_continuousMonitor(DCC0_BASE, DCC_COUNT1SRC_PLL, PLL_CLK_FREQ, DCC_COUNT0SRC_XTAL, XTAL_CLK_FREQ, CLK_TOL, ALLOW_TOL, SYS_CLK_FREQ);

        u16DccErrSts = DCC_getErrorStatus(DCC0_BASE);
       
        if(u16DccErrSts != CTL_U_CLR)
        {
            if(u16DccRetryCnt < UINT16_OVFL_GUARD)
            {
                u16DccRetryCnt++;
            }
        }
        else
        {
            u16DccRetryCnt = CTL_U_CLR;
        }

        if(u16DccRetryCnt > DCC_CHCK_RETRY_CNT)
        {
            u16DccRet = CTL_U_SET;
        }
       
        return u16DccRet;

     

  • Seungeun,

    Thanks for sharing, let me get back to you by the end of this week.

    Best Regards,

    Aishwarya

  • Seungeun,

    Does the code work as expected with the first implementation? When you directly inject values into the DCC registers, do you see the error occurring?

    When running your code, could you check if the DCC error flags are ever getting set before the error function is called and just being cleared since they are sticky flags? The DCC_getErrorStatus function reads the current status register. If you call it immediately after DCC_continuousMonitor, the DCC might not have completed its first measurement cycle yet, or the error condition might not have been registered.

    Best Regards,

    Aishwarya

  • Seungeun,

    Checking in to see if you have been able to resolve the issue and if you have any other questions.

    Best Regards,

    Aishwarya