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.

Only interrupts after system reset

Other Parts Discussed in Thread: OMAPL138

Hi,

I'm using an interrupt from the EMDA controller to know when a buffer is transferred.

The interrupt is only called when I perform a 'system reset', 'restart' and 'resume' from the debugger.

When I just do a 'suspend', 'restart' and 'resume', the interrupt is no longer called.

I assume this has something to do with some stale interrupt state being left over or the McASP continuing to do DMA requests.

I've tried to re-initialize everything each time the code runs, but if my assumption is correct, than my code is not very successful.

I perform the following operations:

McASPTxReset(SOC_MCASP_0_CTRL_REGS);
McASPRxReset(SOC_MCASP_0_CTRL_REGS);

SetupPinMux();

PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_MCASP0, PSC_POWERDOMAIN_ALWAYS_ON, PSC_MDCTL_NEXT_ENABLE);

EDMA3Init(SOC_EDMA30CC_0_REGS, 0);
EDMA3Init(SOC_EDMA30CC_0_REGS, 1);

IntDSPINTCInit();

EDMA3FreeChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA, EDMA3_CHA_MCASP0_RX, EDMA3_TRIG_MODE_EVENT, EDMA3_CHA_MCASP0_RX, 0);
EDMA3FreeChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA, EDMA3_CHA_MCASP0_TX, EDMA3_TRIG_MODE_EVENT, EDMA3_CHA_MCASP0_TX, 0);
EDMA3ClrIntr(SOC_EDMA30CC_0_REGS, EDMA3_CHA_MCASP0_RX);

EDMA3RequestChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA, EDMA3_CHA_MCASP0_TX, EDMA3_CHA_MCASP0_TX, 0);
EDMA3RequestChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA, EDMA3_CHA_MCASP0_RX, EDMA3_CHA_MCASP0_RX, 0);
EDMA3DisableEvtIntr(SOC_EDMA30CC_0_REGS,EDMA3_CHA_MCASP0_TX);

SetupPaRAMSets();

IntRegister(C674X_MASK_INT8, userISR);
IntEventMap(C674X_MASK_INT8, SYS_INT_EDMA3_0_CC0_INT1);
IntEnable(C674X_MASK_INT8);

SetupMcASP();

IntGlobalEnable();

EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, EDMA3_CHA_MCASP0_RX, EDMA3_TRIG_MODE_EVENT);
EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, EDMA3_CHA_MCASP0_TX, EDMA3_TRIG_MODE_EVENT);

StartMcASP();

I'm I missing some part? The mcASP runs fine, no matter how I restart the code, which also means that the DMA is working. (The mcASP and DMA form a loopback). It's just that the completion interrupt is only called when I perform a 'system reset'.

Any insights will be highly appreciated.

Kind regards,

Remco Poelstra

  • Hi Remco,

    Is that code yours or released by TI ?

    Please refer to the function "EDMA3CCComplIsr" from OMAPL138 starterware package.

    OMAPL138_StarterWare_1_10_03_03/examples/lcdkOMAPL138/mcasp/mcaspPlayBk.c

  • Hi,

    It's mostly TI's code, but amongst a few mintor things, I've modified the DMA code to use three buffers in a concurrent fashion.

    My interrupt is directly from TI:

    /*
    ** EDMA transfer completion ISR
    */
    static void EDMA3CCComplIsr(void) //+- 330 cycles
    {
    	IntEventClear(SYS_INT_EDMA3_0_CC0_INT1);
    
        /* Check if receive DMA completed */
        if(EDMA3GetIntrStatus(SOC_EDMA30CC_0_REGS) & (1 << EDMA3_CHA_MCASP0_RX))
        {
            /* Clear the interrupt status for the 0th channel */
            EDMA3ClrIntr(SOC_EDMA30CC_0_REGS, EDMA3_CHA_MCASP0_RX);
        }
    }

    Works fine, as soon as the interrupts start. The other code references to this function as userISR, it's passed via a function argument.

    For some reason without the 'system reset', the interrupts are missed. After a 'system reset' the interrups get called fine. I've checked all register, that I could come up with, that could have anything to do with setting and triggering interrupts, but I don't see why they aren't making it to the core.

    Regards,

    Remco Poelstra