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.

Mismatch between DMA interrupt and the DMAIFR register (DMA interrupt flag register) on C5505 DSP



Hello,

I have discovered a very peculiar bug affecting DMA combined with interrupts on C5505 DSP, which I will try to describe below:

- In the current case I am using only one interrupt for DMA channel 0, all other DMA interrupts are disabled.
 When a DMA block transfer is complete from an I2S device into internal memory, the DMA triggers an interrupt
 to the CPU.

As you are aware of, the interrupts from the four DMA controllers are combined into a single CPU interrupt.
In order to determine which DMA channel generated the interrupt, the ISR (interrupt service routine) reads the bits
of the DMA interrupt flag register (DMAIFR). The ISR needs to clear the set bits manually by writing 1 ot them.

The DMAIFR contains 16 flag bits for DMA channel 0 to DMA channel A15.

In the normal situation, I expect to read 0x0001  in the DMAIFR  (as our only interrupt enabled channel is DMA channel 0).

However, in a very seldom situation  (can happen after several hours), I read 0x0000 in the DMAIFR:
which means that the global DMA interrupt is triggered to the CPU, but when the ISR looks for the DMA channel
responsible for triggering the DMA, it finds none, and therefore the ISR does not process the interrupt as it should.

Have you heard if such a bug/behaviour? Can you please forward this e-mail to support? If you need any extra information,
I can provide this as well.


DSP type: C5505             BIOS version: version 5.41.10.36

 


Here is a copy of the ISR code  used with the HWI dispatcher of DSP/BIOS:

/*** Interrupt Service Routines ***/
void dmaISR(void)
{
        Uint16 dmaIfrReg;


        /* Read DMAIFR regsiter - Determine the source of the interrupt */
        dmaIfrReg = CSL_SYSCTRL_REGS->DMAIFR;


        /* If DMA0 Ch.0 -> ADC interrupt */
        if ((dmaIfrReg & 0x0001) == 0x0001)
        {
                hwiAdcDmaRcv();                       /*  Handle ADC interrupt */

                 CSL_SYSCTRL_REGS->DMAIFR |= 0x0001;          /*  Clear the interrupt bit in DMAIFR */
        }
        else
        {

                /* This should never happen as only DMA Channel 0 is interrupt enabled */
                sendDebug(DBG_ERROR|DEBUG_ID_008, (int32_t) dmaIfrReg, 0);
        }
}

 

Regards,

Cyrille

  • Sorry that I don't have a solution for your problem.

    However, I do have a recommendation for you to try out and that is change:

    CSL_SYSCTRL_REGS->DMAIFR |= 0x0001;      

    to

    CSL_SYSCTRL_REGS->DMAIFR = 0x0001;   

    I know that you said all other DMA interrupt channels are disabled, so this should not matter. Not that I'd expect the DSP to do this, but suppose the dmaIfrReg=0x0001 and then the CSL_SYSCTRL_REGS->DMAIFR read value is 0x8001. The value that would get written back to the DMAIFR would be 0x8001.

    I'd also recommend taking a snapshot of the DMAIER register to ensure you indeed have 1 channel enabled and somehow interrupts are not getting reenabled.

    You had mentioned that your code runs for a number of hours until this issue occurs and I apologize that I don't know your application.  However, Is there any means to determine if the processor is resetting and possibly running another executable from an attached boot device ?

    Hope this helps.

  • Hello,

     

    I have tried your suggestion and used instead:      CSL_SYSCTRL_REGS->DMAIFR = 0x0001;   

    But I still see the same pborblem. I havs also ran the code in Debug mode and then in Relelase mode.

    Also I tried to download the code from Flash memory instead of using the debugger,b but I still see the problem.

     


    The only work-around that works for now is to detect when the DMAIFR = 0x0000 in the ISR, and still do the

    same processing that when DMAIFR = 0x0001. I also make sure that all other DMA channel interrupts

    are disabled.

     

    Could it be something wrong with the HWI_Dispatcher? I am using BIOS 5.41.10.36 on DSP C5505.

     

    Regards, Cyrille

  • Hi Cyrille,

    It looks like a silicon anomaly. Are you using a "production" chip or "evaluation" chip?

  • Hi Cong,

    The board that I have been using is an evluation board it seems: TMX320C5505AZCH12 (01A9PFW).

    I just received a new board of type: TMS320C550505AZCHA10 (06AP81W) but have not tested it yet

    against this bug.

     

    What are the differences between these two version? Were there corrections made? Is there an errata document describing

    potential issues?

     

    Best Regards,

     

    Cyrille

  • Hi Cyrille,

    AFAIK, TMX prefix is for experimental chips, while TMS is for "production" chips. Experimental chips usually have more anomalies than production chips do.

    Errata document is here: http://www.ti.com/litv/pdf/sprz310a, but it does not mention this problem.

    Have you tried to reduce SYSCLK?

  • Hi Cong,

     

    I have now tried the same code on the TMS device (production), and I see the same error.

    So at least, it is not related to TMS/TMX differences. Thanks for the errate document. I will go through it asap.

     

    I have tried to run the DSP at 40MHz as well as 15Mhz but see the same behaviour. So far, I have made a

    "work around" which seemsto address the  problem, but it would be interestign to see if anybody else

    has exprienced something similar.

    Regards,

     

    Cyrille