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.

CSL Configured DMA on SYS/BIOS

Other Parts Discussed in Thread: TMS320C6455, SYSBIOS

Hello,

 I have configured EDMA using CSL and i have created my ISR function using EdmaEventHook(). It is working fine with normal CCS project but same code when i converted to SYS/BIOS project ISR is not working.

Please suggest any changes required in code. 

Regards,

Surajkumar

  • Hi Suraj,

    You should use SYS/BIOS Hwi module APIs to register ISR handlers. SYS/BIOS manages the interrupt controller and if you use CSL APIs to register ISRs, it conflicts with SYS/BIOS Hwi module.

    What target are you running SYS/BIOS on ?

    Best,

    Ashish

  • Thanks Ashish,

    I am using

    TMS320C6455 DSK.

    DSP/BIOS - 6.5.

     

    From main function i have created the thread, untill DMA is enabled everthing is fine. But after DMA is enabled interrupts are working fine but no other code in thread is executing (seems it is hanging).

    code is  interfaced the board through EMC using NDK.

  • Suraj,

    Can you share the code ? I would like to take a look just to make sure BIOS APIs are not conflicting with other APIs.

    Also are you using SYS/BIOS or DSP/BIOS ? I do not recongize DSP/BIOS 6.5 as a version.

    Best,

    Ashish

  • sorry, 

    I am using 

    SYS/BIOS 6.35.1.29.

    I have changed my interrupt logics using HWI. Interrupt is working fine.

    But on interrupt i am waiting for a flag to disable the EDMA in same TASK, although the flag is set in the ISR it is not validating the condition

    the task is going to idel function.

    I am using MCBSP1 with EDMA and i have configured the HWI as follows:

    var ti_sysbios_hal_Hwi0Params = new ti_sysbios_hal_Hwi.Params();
    ti_sysbios_hal_Hwi0Params.instance.name = "ti_sysbios_hal_Hwi0";
    ti_sysbios_hal_Hwi0Params.eventId = 43;
    Program.global.ti_sysbios_hal_Hwi0 = ti_sysbios_hal_Hwi.create(4, "&TxDMAIsr", ti_sysbios_hal_Hwi0Params);

    event ID 43 is given with reference to interrupt event number in datasheet.

    Interrupt no 4 is vector id.

    kindly verify the above configuration .

    CODE SNIPPET:

    In my main function I have created a 2 task as follows:

    Void main()

    {


    /* Ethernet Initalization Task*/
    Task_Params_init(&taskParams);
    taskParams.stack = taskEmacStack;
    taskParams.stackSize = sizeof(taskEmacStack);
    task=Task_create((Task_FuncPtr)Task_Transmit, &taskParams, &eb);
    if (task == NULL) {
    printf("Ethernet_task() failed!\n");

    /* Pheripheral Task*/
    Task_Params_init(&taskParams1);
    taskParams1.stack = taskEmacStack1;
    taskParams1.stackSize = sizeof(taskEmacStack1);
    task1=Task_create((Task_FuncPtr)Task_Pheriperal, &taskParams1, &eb);
    if (task1 == NULL) {
    printf("Task_Pheripheral() failed!\n");

    BIOS_exit(0);
    }

    In pheripheral task, using CSL i have configured EDMA  and enabling the MCBSP.

    (Interrupt logics are done with HWI as mentioned above).

    Void Task_Pheriperal(UArg a0, UArg a1)
    {

       fdOpenSession(TaskSelf());

        configureEDMA();

     fdCloseSession(TaskSelf());

    }

    Code snippet as follows:

    void configureEDMA()

    {

    CSL_edma3Init(&edmaContext);


    /* Edma Module Level Open */
    hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&EDMA_status);

    /* Query Module Info */
    CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INFO, &info);

    /********************************Setup for Tx******************************/

    /* Setup the DRAE Masks */

    regionAccess.region = CSL_EDMA3_REGION_0;
    regionAccess.drae = 0xFFFF;
    regionAccess.draeh = 0x0;

    CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_DMAREGION_ENABLE,&regionAccess);

    /* Open transmit channel */
    chParam.regionNum = CSL_EDMA3_REGION_0;
    chParam.chaNum = CSL_EDMA3_CHA_XEVT1;
    hChannel = CSL_edma3ChannelOpen(&ChObj,CSL_EDMA3,&chParam,&EDMA_status);

    /* Open Receiver channel */
    chParam1.regionNum = CSL_EDMA3_REGION_0;
    chParam1.chaNum = CSL_EDMA3_CHA_REVT1;
    hChannel1 = CSL_edma3ChannelOpen(&ChObj1,CSL_EDMA3,&chParam1,&EDMA_status);


    /* Transmit Channel setup */

    hParamBasic = CSL_edma3GetParamHandle(hChannel,CSL_EDMA3_CHA_XEVT1, &EDMA_status);
    hParamBasic1 = CSL_edma3GetParamHandle(hChannel,66, &EDMA_status);
    hParamBasic2 = CSL_edma3GetParamHandle(hChannel,67, &EDMA_status);
    hParamBasic3 = CSL_edma3GetParamHandle(hChannel,68, &EDMA_status);

    /* Receiver Channel setup */

    hParamBasic4 = CSL_edma3GetParamHandle(hChannel1,CSL_EDMA3_CHA_REVT1, &EDMA_status);
    hParamBasic5 = CSL_edma3GetParamHandle(hChannel1,69, &EDMA_status);
    hParamBasic6 = CSL_edma3GetParamHandle(hChannel1,70, &EDMA_status);
    hParamBasic7 = CSL_edma3GetParamHandle(hChannel1,71, &EDMA_status);


    /* Transmiter param setup */

    myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS,CSL_EDMA3_TCCH_DIS,\
    CSL_EDMA3_ITCINT_DIS, \
    CSL_EDMA3_TCINT_EN,\
    CSL_EDMA3_CHA_XEVT1, \
    CSL_EDMA3_TCC_NORMAL, \
    CSL_EDMA3_FIFOWIDTH_NONE, \
    CSL_EDMA3_STATIC_DIS, \
    CSL_EDMA3_SYNC_A,\
    CSL_EDMA3_ADDRMODE_INCR,\
    CSL_EDMA3_ADDRMODE_INCR \
    );

    myParamSetup.srcAddr = (Uint32)g_nTxBuff0; //Uint32 //pong
    myParamSetup.dstAddr = (Uint32)CSL_MCBSP_1_TX_EDMA_REGS;
    myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(2,g_unSineToneLen); //4,5184
    myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(2,0); //4,0
    myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamBasic2,1); //CSL_EDMA3_LINK_NULL //1
    myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,0);
    myParamSetup.cCnt = 1;

    CSL_edma3HwChannelSetupParam (hChannel, CSL_EDMA3_CHA_XEVT1);
    CSL_edma3HwChannelSetupQue(hChannel, CSL_EDMA3_QUE_1);
    CSL_edma3ParamSetup(hParamBasic,&myParamSetup);

    myParamSetup.srcAddr = (Uint32)g_nTxBuff2;
    myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(2,5184);
    myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(2,0);
    myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamBasic3,1);
    CSL_edma3ParamSetup(hParamBasic1,&myParamSetup);

    myParamSetup.srcAddr = (Uint32)g_nTxBuff1;
    myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(2,5184);
    myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(2,0);
    myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamBasic1,1);

    CSL_edma3ParamSetup(hParamBasic2,&myParamSetup);
    myParamSetup.srcAddr = (Uint32)g_nTxBuff0;
    myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(2,5184);
    myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(2,0);
    myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamBasic2,1);
    CSL_edma3ParamSetup(hParamBasic3,&myParamSetup);

    /******************************************************************/
    /* Receiver param setup */

    myParamSetup1.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS,CSL_EDMA3_TCCH_DIS,\
    CSL_EDMA3_ITCINT_DIS, \
    CSL_EDMA3_TCINT_EN,\
    CSL_EDMA3_CHA_REVT1, \
    CSL_EDMA3_TCC_NORMAL, \
    CSL_EDMA3_FIFOWIDTH_NONE, \
    CSL_EDMA3_STATIC_DIS, \
    CSL_EDMA3_SYNC_A,\
    CSL_EDMA3_ADDRMODE_INCR,\
    CSL_EDMA3_ADDRMODE_INCR \
    );

    myParamSetup1.srcAddr = (Uint32)CSL_MCBSP_1_RX_EDMA_REGS; //Uint32 //pong
    myParamSetup1.dstAddr = (Uint32)g_nRxBuff0;
    myParamSetup1.aCntbCnt = CSL_EDMA3_CNT_MAKE(2,5184); //4,5184
    myParamSetup1.srcDstBidx = CSL_EDMA3_BIDX_MAKE(0,2); //4,0
    myParamSetup1.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamBasic6,1); //CSL_EDMA3_LINK_NULL //1
    myParamSetup1.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,0);
    myParamSetup1.cCnt = 1;

    CSL_edma3HwChannelSetupParam (hChannel1, CSL_EDMA3_CHA_REVT1);
    CSL_edma3HwChannelSetupQue(hChannel1, CSL_EDMA3_QUE_1);
    CSL_edma3ParamSetup(hParamBasic4,&myParamSetup1);

    myParamSetup1.dstAddr = (Uint32)g_nRxBuff0;
    myParamSetup1.aCntbCnt = CSL_EDMA3_CNT_MAKE(2,5184);
    myParamSetup1.srcDstBidx = CSL_EDMA3_BIDX_MAKE(0,2);
    myParamSetup1.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamBasic6,1);
    CSL_edma3ParamSetup(hParamBasic5,&myParamSetup1);

    myParamSetup1.dstAddr = (Uint32)g_nRxBuff1;
    myParamSetup1.aCntbCnt = CSL_EDMA3_CNT_MAKE(2,5184);
    myParamSetup1.srcDstBidx = CSL_EDMA3_BIDX_MAKE(0,2);
    myParamSetup1.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamBasic5,1);
    CSL_edma3ParamSetup(hParamBasic6,&myParamSetup1);

    CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_CLEAR,NULL);

    CSL_edma3HwChannelControl(hChannel, CSL_EDMA3_CMD_CHANNEL_ENABLE, NULL);
    CSL_edma3HwChannelControl(hChannel1,CSL_EDMA3_CMD_CHANNEL_CLEAR,NULL);
    CSL_edma3HwChannelControl(hChannel1, CSL_EDMA3_CMD_CHANNEL_ENABLE, NULL);

    }

    Regards,

    Surajkumar

  • Hi Surajkumar,

    From the Hwi code, I am guessing you are running on a DSP (?). The Hwi code looks ok for a DSP.

    Surajkumar Mokhasi said:

    But on interrupt i am waiting for a flag to disable the EDMA in same TASK, although the flag is set in the ISR it is not validating the condition

    the task is going to idel function.

    I dont understand the above statement. Can you describe what is the Hwi function trying to do ? Also, it seems you expect some task to run after the Hwi function runs. Which task is this, what state is it in and are you unblocking this task from the Hwi ?


    Best,

    Ashish

  • Thanks Ashish,

    Using HWI with the above configuration code edma interrupt is working fine.

    DSP event 43 corresponds to EDMA interrupt both TX & RX i have routed to same ISR, By reading IPR register in ISR

    i am diffrentiating the channel.

    With SYS/BIOS it works fine.