Forums

DMA Chaining SHARC ADSP-21369

Started by jjca...@gmail.com November 14, 2007
Hi!
I made a code to transfer from external (SDRAM) to internal memory
using "memory to memory" mode in DMA.
Now I need to use a circular buffer using chained DMA but... it doesn
=B4t work!
That's part of the code:
-----------------------
.=2E..

    //Proceed from Block A to Block C
    TCB_Block_A[0] =3D (int) TCB_Block_C + 3 + PCI ;
    TCB_Block_A[3] =3D (unsigned int) Block_A + PCI;//- OFFSET;

    //Proceed from Block B to Block A
    TCB_Block_B[0] =3D (int) TCB_Block_A + 3 + PCI ;
    TCB_Block_B[3] =3D (unsigned int) Block_B + PCI;// - OFFSET ;

    //Proceed from Block C to Block B
    TCB_Block_C[0] =3D (int) TCB_Block_B + 3 + PCI ;
    TCB_Block_C[3] =3D (unsigned int) Block_C + PCI;// - OFFSET ;


    // Enabling Chaining
    // Block A will be filled first
    *pCPEP0 =3D (unsigned int) TCB_Block_A - OFFSET + 3 ;

    *pCPEP1 =3D (unsigned int) TCB_Block_C - OFFSET + 3 ;

 	*pEBEP0 =3D (unsigned int) imgOriginal;
 	*pEBEP1 =3D (unsigned int) imgFinal;

 	*pELEP0 =3D sizeof(unsigned int) * COLUMNA;
 	*pELEP1 =3D sizeof(unsigned int) * COLUMNA;

 	// Now setup the DMA control registers
     *pDMAC1 =3D DEN |  TRAN | CHEN | CBEN; //DMADR / TRAN is "1" :
Write to External Memory
     // Now setup the DMA control registers
     *pDMAC0 =3D DEN |  CHEN | CBEN; //DMADR is "0" : Write to Internal
Memory
.=2E.
----------
Do you see the problem? I didn't found too much information about
this... and no examples...  :(
Thanks!