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.

CCM selftest will not complete on tms570 0432

Other Parts Discussed in Thread: HALCOGEN

Hi All

I used the ccm  selftest routine (ccmSelfCheck )generated by HALCOGEN and run it on TMS570 0432. The CCMSR(bit8) should be switched to 1 when the self test completes, however it remains 0 all the time.  Thus the loop :

/* Wait for CCM self-test to complete */
/*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
while ((CCMSR & 0x100U) != 0x100U)
{
}/* Wait */

can not jump out

 Have any one tried this routine before?

Regards

Leo

  • Hi Leo,

    Did you somehow run CCM selftest while you have the debugger connected? You need to make sure that you run CCM selftest when you are not connected to the debugger.
  • Hi Charles
    Thanks for the reply. I am not sure what the debugger you mentioned is. I load the program into ship and run it through CCS, I can insert breakpoint and check the memory, so maybe I am runing it through debugger. If I donot run it through CCS, how could I know I can pass the while loop, I'd like to see the change of registers.
    Leo
  • Hi Charles
    You are right. It can not be excuted under debugger mode, and I use SCI to check the results.
    however in Self-Test Error Forcing Mode, The ESM error flag “CCM-R4F - self-test” is expected after the self-test error forcing mode completes,but ESM error flag “CCM-R4F - self-test” for me is not set.
    Do you have the chance to verify this for me?
    Many thanks, LOL
    Leo
  • HI Leo,
    Can you put a breakpoint after you start the error forcing mode test? I wonder if the flag is somehow cleared by the software.
  • Hi Charles

    I am so willing to do that , but it can not be runned through debugger which told by you.

    Leo

  • Hi Leo,

     Are you using the safeTI Diagnostic Library? If yes, how are you calling and using the below test function?

    retVal = SL_SelfTest_CCMR4F(CCMR4F_SELF_TEST_ERROR_FORCING, TRUE, &failInfoCCMR4F);

    Going through the SL_SelfTest_CCMR4() for the self_ est error_ orcing mode  test I see the below code highlighted in red where the flag is cleared after the test. If the retVal is TRUE then the test has passed.

                /*SAFETYMCUSW 440 S MR: 11.3 <APPROVED> Comment_21*/

                if(GET_ESM_BIT_NUM(ESM_G1ERR_CCMR4_SELFTEST) == (sl_esmREG->SR1[0] & GET_ESM_BIT_NUM(ESM_G1ERR_CCMR4_SELFTEST))){

                    config->stResult = ST_PASS;

                }

                else

                {

                    config->stResult = ST_FAIL;

                }

                /* Clear nERROR */

                _SL_HoldNClear_nError();

                /* Clear the interrupt */

                /*SAFETYMCUSW 440 S MR: 11.3 <APPROVED> Comment_21*/

                sl_esmREG->SR1[0] = (1u << ESM_G1ERR_CCMR4_SELFTEST);

                /*clear the flags which indicate tests ongoing*/

                SL_FLAG_CLEAR(CCMR4F_ERROR_FORCING_TEST);

                /*Restore grp1 esm interrupt enable*/

                sl_esmREG->IESR1 = regBkupIntEnaSet;

                sl_esmREG->EEPAPR1 = regBckupErrInfulence

  • Charles

    I am not using the Diagnostic Library. I use this:

    /** @fn void ccmSelfCheck(void)
    *   @brief CCM module self check Driver
    *
    *   This function self checks the CCM module.
    */
    /* SourceId : SELFTEST_SourceId_001 */
    /* DesignId : SELFTEST_DesignId_001 */
    /* Requirements : HL_SR395 */
    void ccmSelfCheck(void)
    {
    /* USER CODE BEGIN (3) */
    /* USER CODE END */
    
        /* Run a diagnostic check on the CCM-R4F module */
        /* This step ensures that the CCM-R4F can actually indicate an error */
    
        /* Configure CCM in self-test mode */
        CCMKEYR = 0x6U;
        /* Wait for CCM self-test to complete */
        /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
        while ((CCMSR & 0x100U) != 0x100U)
        {
        }/* Wait */
    
    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    
        /* Check if there was an error during the self-test */
        if ((CCMSR & 0x1U) == 0x1U)
        {
            /* STE is set */
            selftestFailNotification(CCMSELFCHECK_FAIL1);
        }
        else
        {
            /* Check CCM-R4 self-test error flag by itself (without compare error) */
            if ((esmREG->SR1[0U] & 0x80000000U) == 0x80000000U)
            {
                /* ESM flag is not set */
                selftestFailNotification(CCMSELFCHECK_FAIL2);
            }
            else
            {
                /* Configure CCM in error-forcing mode */
                CCMKEYR = 0x9U;
    
                /* Wait till error-forcing is completed. */
                /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
                while (CCMKEYR != 0U)
                {
                }/* Wait */
    
                /* check if compare error flag is set */
                if ((esmREG->SR1[1U] & 0x4U) != 0x4U)
                {
                    /* ESM flag is not set */
                    selftestFailNotification(CCMSELFCHECK_FAIL3);
                }
                else
                {
                    /* Check FIQIVEC to ESM High Interrupt flag is set */
                    if((vimREG->FIQINDEX & 0x000000FFU) != 1U)
                    {
                       /* ESM High Interrupt flag is not set in VIM*/
                       selftestFailNotification(CCMSELFCHECK_FAIL4);
                    }
    
                    /* clear ESM group2 channel 2 flag */
                    esmREG->SR1[1U] = 0x4U;
    
                    /* clear ESM group2 shadow status flag */
                    esmREG->SSR2 = 0x4U;
    
                    /* ESM self-test error needs to also be cleared */
                    esmREG->SR1[0U] = 0x80000000U;
    
                    /* The nERROR pin will become inactive once the LTC counter expires */
                    esmREG->EKR = 0x5U;
    
                    /* Configure CCM in selftest error-forcing mode */
                    CCMKEYR = 0xFU;
    
                    /* Wait till selftest error-forcing is completed. */
                    /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
                    while (CCMKEYR != 0U)
                    {
                    }/* Wait */
    
                    if((esmREG->SR1[0U] & 0x80000000U) != 0x80000000U)
                    {
                        /* ESM flag not set */
                        selftestFailNotification(CCMSELFCHECK_FAIL2);
                    }
                    else
                    {
                        /* clear ESM flag */
                        esmREG->SR1[0U] = 0x80000000U;
                    }
                }
            }
        }
    }

  • and the loop can not be jumped out:
    while ((CCMSR & 0x100U) != 0x100U)
    {
    }/* Wait */
  • Hi Leo,

      Earlier you were asking why the ESM error flag "CCM-R4F - self-test" was not set after the self-test error forcing mode completes. So it seems that you were at least able to run the test and not stuck in while ((CCMSR & 0x100U) != 0x100U). I wonder what has changed since then. Can you rerun again after a power cycle and without the debugger connected? Looking at the code you posted, the flag corresponding to the ccmr4 selftest is cleared by the code, highlighted in red below.

                    /* Configure CCM in selftest error-forcing mode */
                    CCMKEYR = 0xFU;
                    /* Wait till selftest error-forcing is completed. */
                    /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
                    while (CCMKEYR != 0U)
                    {
                    }/* Wait */
                    if((esmREG->SR1[0U] & 0x80000000U) != 0x80000000U)
                    {
                        /* ESM flag not set */
                        selftestFailNotification(CCMSELFCHECK_FAIL2);
                    }
                    else
                    {
                        /* clear ESM flag */
                        esmREG->SR1[0U] = 0x80000000U;
  • thanks anyway
    I will do more tests on it. Appreciate your help.
    Best Regards
    Leo