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.

VCP2 ISR not triggering on C6670

I'm using CCS v 5.2 on a C6670 EVM.

I have integrated the VCP2 code to my project using an example VCP2 BER project which I found on net. The VCP2 BER project has been ported to the C6670 and verified to be working ok individually. After integrating the VCP2 functionality to my project I find the VCP2 is not working. What I observe is that after starting the VCP2 - using ---> VCP2_start(hVcp2);  -----> there is no call to any of the ISR's EDMA_ISR or VCP2_ISR. Instead I can see that the program enters a infinite loop and stays within the ASM functions __CSL_intcIsrNMI  and  _CSL_intcNmiDummy. I have looked at every possible setting and configuration and also memory placement. I would be glad if someone helps me in this regard.

I will attach the file I use for configuring and calling of the VCP2.

The only difference I can see between the VCP2 BER project and my project is that my project RTSC enabled and I use a config file instead of a linker command file.

Thanks,

Anoop

  • VCP2 Init function:
    --------------------------

    /*------------------------------------------------------------------------------*/
    /* ti_vcp2_init - init function for VCP2 */
    /*------------------------------------------------------------------------------*/
    int ti_vcp2_init(void)
    {
    Int32 VCP2Status;
    
    UInt32 coreNum, VCP2instNum;
    
    // anoop - .text is in MSMCSRAM which has an address of 0x0C000000
    //volatile Uint32* powerOnFlagPtr = (volatile Uint32*)0x0C000000;
    volatile Uint32* powerOnFlagPtr;
    
    coreNum = CSL_chipReadReg (CSL_CHIP_DNUM);
    
    if (coreNum==0)
    {
    KeyStone_main_PLL_init (8, 1); //for 122.88MHz input clock
    edma_Init();
    }
    
    //Configure L1 as 32KB cache, L2 cache 256KB
    
    // anoop - cache is allocated in TCP init.
    //CACHE_setL1DSize(CACHE_L1_32KCACHE);
    //CACHE_setL2Size(CACHE_256KCACHE);
    CACHE_setL1PSize(CACHE_L1_32KCACHE);
    
    
    //Enable VCP2 corresponding to the coreId (any VCP2 can be used on any core).
    if(coreNum == 0)
    {
    *(powerOnFlagPtr) = VCP2_POWER_ON_IN_PROGRESS;
    
    if( enableVcp2(CSL_VCP2_A) != SUCCESS )
    {
    printf("\n[Core%d]: Error, Couldn't enable VCP2-%d", coreNum, CSL_VCP2_A);
    return(FAILURE);
    }
    
    *(powerOnFlagPtr) = VCP2_POWER_ON_COMPLETE;
    
    }
    else
    {
    while(*(powerOnFlagPtr) != VCP2_POWER_ON_COMPLETE)
    {
    CACHE_invL2((void *)powerOnFlagPtr,4,CACHE_WAIT);
    }
    printf("\n[Core%d]: Power enable complete.", coreNum);
    }
    
    
    vcpParameters.frameLen = 0;
    vcpParameters.rate = 3;
    vcpParameters.constLen = 9;
    vcpParameters.yamTh = 0;
    vcpParameters.stateNum = 0;
    vcpParameters.decision = 0;
    vcpParameters.readFlag = 1;
    vcpParameters.tbConvrgMode = 0;
    vcpParameters.tailBitEnable = 0;
    vcpParameters.traceBackIndex = 0;
    vcpParameters.outOrder = 0;
    vcpParameters.perf = VCP2_PERF_MOST_CRITICAL;
    
    //----
    VCP2instNum = coreNum;
    edma3Init(coreNum,VCP2instNum);
    
    /* Initialize the VCP2 */
    // Get handle to desired VCP2 instance
    ghVcp2 = VCP2_init(&pVcp2Obj, VCP2instNum, &VCP2Status);
    if ( VCP2Status != CSL_SOK)
    {
    printf("Error initilization VCP2!\n");
    return 1;
    }
    
    return 0;
    
    }
    
    
    ===========================================================================================
    
    VCP2 core function
    -----------------------------
    
    Uint32 ti_vcp2_func(Int8* pInSoftDecs, Uint32 InpLen, Uint32* pVcpOutDecisions)
    {
    volatile Uint32 error = 0;
    Uint32 outReg[3], length, decisionPerWord, nDecisionWords;
    
    VCP2_Params *hVcpConfigParms = &VcpConfigParms;
    VCP2_ConfigIc *hVcpConfigIc = &VcpConfigIc;
    VCP2_UserData *hVcpUserData;
    Uint32* hVcpDecisions = pVcpOutDecisions;
    Uint32* hVcpOutParms = outReg;
    VCP2Handle hVcp2 = ghVcp2;
    
    vcpParameters.frameLen = InpLen;
    
    
    
    /* Fill out VCP2_ parameters */
    VCP2_genParams(&vcpParameters, &VcpConfigParms);
    
    /* Calculate the VCP2_ IC values */
    VCP2_genIc(&VcpConfigParms, &VcpConfigIc);
    
    /* if convergent mode, frame size must be incremented by the convergence distance */
    if (VcpConfigParms.traceBack==2)
    {
    length=VcpConfigParms.frameLen+VcpConfigParms.convDist;
    }
    else
    {
    length=VcpConfigParms.frameLen;
    }
    
    // Memory allocations --------------------
    
    /* allocate buffer for branch metrics */
    if ((branch_metrics=(Int8*)calloc((length+vcpParameters.constLen-1)*(0x1<<(vcpParameters.rate-1)),sizeof(Int8)))==NULL)
    {
    return 1;
    }
    /* allocate memory for decisions */
    if (vcpParameters.decision)
    {
    /*
    * the VCP2 function will write 1 SD per 32-bit word
    * but the pointer passed to the VCP2() function will point
    * to SD packed data (2 per 32-bit word)
    */
    decisionPerWord=1;
    }
    else
    {
    decisionPerWord=32;
    }
    if (VcpConfigParms.traceBack==2)
    {
    nDecisionWords=VCP2_normalCeil(length,decisionPerWord);
    }
    else
    {
    nDecisionWords=VCP2_normalCeil(length+vcpParameters.constLen-1,decisionPerWord);
    }
    if ((decisions=(Uint32*)calloc(nDecisionWords+10,sizeof(Uint32)))==NULL)
    {
    return 1;
    }
    
    if ((decisions_soft=(Uint32*)calloc(nDecisionWords+10,sizeof(Uint32)))==NULL)
    {
    return 1;
    }
    // ----------------------------------
    hVcpUserData = (VCP2_UserData *)branch_metrics;
    
    
    ComputeBranchMetrics(pInSoftDecs, branch_metrics, 3, InpLen);
    
    /* Program EDMA3.0 to service User Channel */
    vcp2SubmitEdma(hVcpUserData, hVcpConfigParms, hVcpConfigIc, hVcpDecisions,
    hVcpOutParms, hVcp2);
    
    /* Enable DMA & VCP Interrupts */
    Setup_Interrupt();
    
    /* Start the VCP to begin the EDMA transfers */
    VCP2_start(hVcp2);
    
    asm(" IDLE");
    
    // Copy the Decoded symbols to another buffer!!!! ------------------------------
    //////////// TBD
    
    // FREE memory ------------------------
    free(branch_metrics);
    free(decisions);
    free(decisions_soft);
    
    return(error);
    
    } /* Vcp2 */

  • Hi Anoop,

    The only difference I can see between the VCP2 BER project and my project is that my project RTSC enabled and I use a config file instead of a linker command file.
    Are you able to run the VCP2 code with RTSC enabled ?
    You are facing the problem when you use the *.cfg file instead of *.cmd file ?
    You just remove/comment-out your code in that combined code & try to run the code and check.
    ----------------
  • Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com). Please read all the links below my signature.

  • Hi shankari,

    I haven't tried running the VCP2 code with RTSC enabled since the VCP2 BER didnt have RTSC configuration in it.

    In my project I have other things like TCP3D and FFTC working fine with .cfg so now I'm integrating VCP2 which is not working. Without VCP2 my project works fine even with RTSC (.cfg) file.

    As I mentioned, the ISR's are not being triggered. Any ideas.

    Thanks,

    Anoop

  • Hi Anoop,

    As your project also includes TCP3D and FFTC,  have you tried running just the VCP2 part in your project environment with TCP3D and FFTC disabled? I would try that as a first step to make sure that there are no project specific issues. Once you have this tested, enable TCP3D and check if that creates any conflicts with the EDMA configuration for VCP2.

    -Nitin