01-23-2017 02:37 AM
Dear forum
Im tryng to use DMA writing my code, using the driver provided by SDK.
Following the Adam tutorial , the wxample is working...I would like to understand
what is the problem of memory allignment. This mem allignment test is done in
the driver function named XDmaPs_BuildDmaProg(), in particular in 4 if() that i pase here.
Questions are before single if() ...............
XDmaPs_BuildDmaProg()
{
....
//----------> This if() test if data Source Address is alligned with Burst Size . Why is related to SrcInc ?????
if (ChanCtrl->SrcInc)
SrcUnaligned = SrcAddr % ChanCtrl->SrcBurstSize;
//------------------->Same question like before
if (ChanCtrl->DstInc)
DstUnaligned = DstAddr % ChanCtrl->DstBurstSize;
// What means ?????????
if ((SrcUnaligned && DstInc) || (DstUnaligned && SrcInc)) {
ChanCtrl = &Mem2MemByteCC; // <---------------------------------point to other channel setting...
}
if (ChanCtrl->SrcInc) {
MemBurstSize = ChanCtrl->SrcBurstSize;
MemAddr = SrcAddr;
} else if (ChanCtrl->DstInc) {
MemBurstSize = ChanCtrl->DstBurstSize;
MemAddr = DstAddr;
}
/* check whether the head is aligned or not */
Unaligned = MemAddr % MemBurstSize;
.....
}
Thanks for your time.
Roberto
01-27-2017 12:28 PM
@rob69 alignment is only an issue if burst is requested which is what SrcInc indicates.
02-01-2017 01:27 AM
Thanks for reply
looking at Channel Control Register of DMA, the src_inc bit tell if during the burst ,we want auto increment or not.
I understand it is not related to have or not a burst,
or not ?
If I dont want burst, just set Burst_len=1 (0 in register)
or not ?
thanks
02-13-2017 01:08 AM
Some news about this problem......??
Thanks