AnsweredAssumed Answered

ADSP-21161 external SRAM DMA problem

Question asked by jsb on Aug 11, 2009
Latest reply on May 23, 2011 by Mitesh



I'm trying to DMA some data from external SRAM into internal RAM, which works for the first couple of transfers and then stops, with the "C" register in the "DMA Addresing" window stuck at the data length, rather than decrementing to zero, as in the previous successful transfers.



I initialise the DMA transfer with the following code, where N is the number of 32-bit words to transfer:

asm("dm(DMAC10) = %0;" : : "d" (0));
  asm("dm(CPEP0) = %0;" : : "d" (0));
  asm("dm(IMEP0) = %0;" : : "d" (1));
  asm("dm(EMEP0) = %0;" : : "d" (1));
  asm("dm(ECEP0) = %0;" : : "d" (N));


and then instigate each transfer with the following code:

*(volatile int*) DMAC10 = 0;
  *(volatile int*) CEP0 = N;
  *(volatile int*) IIEP0 = reinterpret_cast<int>(puDestBuffer);
  *(volatile int*) EIEP0 = reinterpret_cast<int>(puSourceBuffer);
  *(volatile int*) DMAC10 = MASTER | DEN | INT32 | PMODE4;


I don't instigate a new DMA transfer until CEP0 equals 0, but after a couple of DMA transfers, it sticks at N.


I have a DMA interrupt ISR that does nothing:

segment("seg_int_code") void DMAInterrupt(const int flags)


setup thus:

sysreg_bit_set(sysreg_MODE2, IRQ0E);
sysreg_bit_set(sysreg_MODE2, IRQ1E);
sysreg_bit_set(sysreg_MODE2, IRQ2E);
sysreg_bit_set(sysreg_MODE2, EP0I);

sysreg_bit_set(sysreg_MODE1, NESTM);


interrupts(SIG_IRQ0, CtrlMsgInterrupt);

    interrupts(SIG_IRQ1, TrigFinInterrupt);   
    interrupts(SIG_EP0I, DMAInterrupt);   

sysreg_bit_set(sysreg_MODE1, IRPTEN);


(some other interrupts flying around).


Any ideas as to what I'm doing wrong?