I am supporting a legacy product that is using the 21065L. I would like to replace a memcpy() with a DMA copy to improve the throughput.
The original code is:
UNSIGNED32 *extMem = 0x10000000;
UNSIGNED32 *intMem = 0x0000D000;
memcpy(extMem, intMem, 100);
The DMA code is:
// DMA off *pDMAC1 = 0;
// set DMA control regs *pIIEP1 = (UNSIGNED32)(intMem); // internal RAM *pIMEP1 = 1; // single increment *pCEP1 = 100; // count *pEIEP1 = (UNSIGNED32)(extMem); // external RAM *pEMEP1 = 1; // single increment *pECEP1 = 100; // count
// turn DMA on *pDMAC1 = (DEN | TRAN | MASTER);
// wait for DMA to finish, to keep the same flow as with memcpy while ((*pDMASTAT & DMA7ST) != 0);
When I run this, nothing happens. It doesn't hang, it just falls through with no memory writes at all.
I'm sure it's something simple, as I'm not familiar with this device.
Yes. You are right. The BIT 7 of the DMA STAT register corresponds to External port DMA channel 1. I think I overlooked this information and assumed that Bit 0 corresponds to DMA channel 0 etc. But it is different here.