AnsweredAssumed Answered

[bug report]  DmaErrorIntHandler() of adi_dma_bf60x.c

Question asked by chris@dw on Jul 5, 2013
Latest reply on Jul 15, 2013 by bala

I just found a bug in the DmaErrorIntHandler() of adi_dma_bf60x.c

 

take the run time value of :

 

AdiDmaBitWiseRegistry[0] = 0x20000000

AdiDmaBitWiseRegistry[1] = 0x00000002

 

the registered ChannelNumber should be 29 and 33

but, the following code turns out to be 29 and 31

 

"C:\Analog Devices\CrossCore Embedded Studio 1.0.2\Blackfin\lib\src\services\source\dma\adi_dma_bf60x.c"

 

static void DmaErrorIntHandler(uint32_t SID, void *pCBParam)

{

..... code skipped

 

    /* DMA Channel number to which the interrupt belongs */

    uint8_t     ChannelNumber = 0;

    /* Bitwise registry value to work on */

    uint32_t    OpenChannels;

 

    /* FOR (All Bitwise registy entries) */

    for (i = 0; i < ADI_DMA_NUM_REGISTRY; i++) <== ChannelNumber should reset as i*32

    {

        /* FOR (All DMA channels marked as open in this bitwise registry) */

        for (OpenChannels = AdiDmaBitWiseRegistry[i]; OpenChannels > 0; )

        {

            /* IF (This DMA Channel is open) */

            if ((OpenChannels & 1) == 1u)

            {

                /* IF (DMA error is for this channel) */

..... code skipped

                    /* Found DMA channel that generated the error interrupt */

                    bChannelFound = true;

                    /* quit this loop */

                    break;

                } /* End of IF (DMA error is for this channel) */

            } /* End of IF (This DMA Channel is open) */

 

            /* Move to next DMA channel */

            OpenChannels >>= 1;

            /* Increment channel number */

            ChannelNumber++;

 

        } /* End of FOR (All DMA channels marked as open in this bitwise registry) */

 

 

        /* IF (Found DMA channel that generated the error interrupt) */

        if (bChannelFound)

        {

            /* quit this loop */

            break;

        }

 

 

    } /* End of FOR (DMA channels that are open) */

 

.....

 

}

Outcomes