DMA Read issue in T4240 custom board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DMA Read issue in T4240 custom board

Jump to solution
1,259 Views
appalanaidug
Contributor II

Hello,

 

We are trying to read data from QDR connected to virtex7 FPGA  from T4240 processor in our custom board.

The processor and fpga are interfaced with PCIe. DMA channel in the T4240 processor is configured for the same.

Counter data is being written to QDR at the rate of 1ms. While we are trying to read the same counter data from the processor continuously,certain values are missing.

data read:(0..1...270...271..541..542...811..). All intermediate values are missing.

 About 333ms of pause is observed between jumped values. Also, "pcie_rreq_tvalid" signal is being low for the counter values missed. The read request itself is not sent to fpga for the missed counter values.

DMA configuration is as shown;

 

*(unsigned int *)(mptr+DMA1_SATR0)=0x00040000 | (src >>32);
*(unsigned int *)(mptr+DMA1_DATR0)=0x00040000; 
*(unsigned int*)(mptr+DMA1_BCR0)=size; //BCDMAREAD;
*(unsigned int *)(mptr+DMA1_SAR0)=src&0xFFFFFFFF; //0x04000000; //FPGA
*(unsigned int*)(mptr+DMA1_DAR0)=dest;

 

*(unsigned int *)(mptr+DMA1_MR0)=0xF<<24|0x4; //0x4; //Directmode , no single write , no CDSM_SWSM
*(unsigned int *)(mptr+DMA1_MR0)^=1<<0;
*(unsigned int *)(mptr+DMA1_MR0)|=1;

 

Every time, a delay of 333 ms is observed, due to which we are missing the counter data. Is this delay attributed to DMA configuration?

 

Any help in this regard is requested

Thanks in advance.

 

 

0 Kudos
Reply
1 Solution
1,234 Views
ufedor
NXP Employee
NXP Employee

> We have observed the delay of approx 300ms by using gettimeofday() function

This looks like an OS issue - not a DMA one.

Can you try a real-time patch?

View solution in original post

0 Kudos
Reply
3 Replies
1,253 Views
ufedor
NXP Employee
NXP Employee

Points to check:

 

1) modify the DATR0 value as follows:

*(unsigned int *)(mptr+DMA1_DATR0)=0x00050000;

 

2) before setting the DMA1_MR0[CS]=1

a) implement debug timestamp print to ensure that DMA is started on a regular basis

b) implement debug print of the DMA1_SR0 to ensure that CB=0

 

0 Kudos
Reply
1,248 Views
appalanaidug
Contributor II

Hello ufedor,

Thanks for the response..!!

For Step 1. We have modified DMA_DATR0 to  0x00050000; but still the issue remains the same.

For Step 2. We have checked the status register DMA1_SR0 and found (CB) to be 0;

 Regarding time stamp:

1. We have observed the delay of approx 300ms by using gettimeofday() function but no delay is observed in TeraTerm Time stamp;

We are initializing the transfer as below:

vq1_dest=0x80000000;
vq1_rdhandle=PCIeDev_Open("/dev/VIRTEX-I-EP"); //8014
PCIeDev_BARAcc(vq1_rdhandle,1);
vq1_src=DMABAR(vq1_rdhandle);
printf("\n vQ1 Src address %lx",vq1_src);
vq1_addr=memory_map(vq1_dest); 

 

The function is as below:

while(1)

{

gettimeofday(); \\ Here time stamp is printed 

Dmaread(); \\ All registers are set in this function

}

 

Dmaread function itself seems not getting called regularly.

Help in this regard would please us. Thank you...!!

 

 

 

 

 

 

0 Kudos
Reply
1,235 Views
ufedor
NXP Employee
NXP Employee

> We have observed the delay of approx 300ms by using gettimeofday() function

This looks like an OS issue - not a DMA one.

Can you try a real-time patch?

0 Kudos
Reply