Hello everyone,
I am sending 12.800 byte from source to destination with eDMA 32 channel. I am initializing channels in turn from 0 to 31 without waiting channels to complete transmission. Each channel carry 400 byte.
I would like to learn what is the completion sequence among the channels. I supposed that first channel which I initialize would complete its transmission firstly. Also I supposed that the last channel which I initialize would complete its transmission lastly.
I would like to learn whether there is a relationship between starting sequence and finishing time.
I attached a part of my code about that.
volatile uint32_t i,j;
uint32_t sourceData[3200];
uint32_t destData[3200];
static void eDMA_Init(DMA_Type* dma, uint32_t channel, uint32_t *sourceAddr, uint32_t *destAddr, uint32_t ByteCount)
{
// SOURCE ADRESS
dma->TCD[channel].SADDR = (uint32_t)sourceAddr;
// SMOD AND DMOD ARE 0
// SSIZE AND DSIZE ARE 8 BIT (0X0)
dma->TCD[channel].ATTR = 0x0000;
// SOFF IS 1 BYTE. AFTER COMPLETİNG A TRANSFER, THIS IS ADDED TO SDADDR.
dma->TCD[channel].SOFF = 1;
// NBYTE IS 400
dma->TCD[channel].NBYTES.MLNO = ByteCount;
// SLAST IS -400. THIS VALUE IS USED TO RETURN SADDR TO FIRST ADRESS VALUE
dma->TCD[channel].SLAST = -ByteCount;
// DESTINATION ADRESS
dma->TCD[channel].DADDR = (uint32_t) destAddr;
dma->TCD[channel].DLASTSGA = -ByteCount;
// THE NUMBER OF MAJOR LOOP
dma->TCD[channel].CITER.ELINKNO = 1;
// DOFF IS 1 BYTE. AFTER COMPLETİNG A TRANSFER, THIS IS ADDED TO DADDR.
dma->TCD[channel].DOFF = 1;
// BITER IS EQUAL TO CITER. AFTER CITER REACHES O, CITER WILL BE EQUAL BITER AGAIN.
dma->TCD[channel].BITER.ELINKNO = 1;
dma->TCD[channel].CSR = 0;
DMA_0->TCD[channel].CSR |= (0x1<<1);
dma->CR = 0xC;
dma->TCD[channel].CSR |= 0x1;
// SECOND WAY TO START DMA
//DMA_0->SSRT = 0;
}
uint32_t channel = 0;
uint32_t *p = sourceData;
uint32_t *q = destData;
for(channel = 0; channel<32; channel++)
{
eDMA_Init(DMA_0, channel, p, q, 400);
p += 100;
q += 100;
}