cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rob69
Visitor
Visitor
3,341 Views
Registered: ‎11-03-2015

DMA user code problem

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

0 Kudos
3 Replies
muzaffer
Teacher
Teacher
3,247 Views
Registered: ‎03-31-2012

@rob69 alignment is only an issue if burst is requested which is what SrcInc indicates.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
rob69
Visitor
Visitor
3,180 Views
Registered: ‎11-03-2015

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

 

 

0 Kudos
rob69
Visitor
Visitor
3,016 Views
Registered: ‎11-03-2015

Some news about this problem......??

 

Thanks

0 Kudos