UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
7,298 Views
Registered: ‎10-13-2015

Zynq: PS_DMA done handler

I'm using PS DMA, like xdmaps_example_w_intr.c project.

 

After initializing interrupts, I'm calling my function to copy data

 

 

int XDMA_PS_memcpy(char *pDst,char *pSrc, size_t len){
	// Some code
	XDmaPs_SetDoneHandler(&DmaInstance,Channel,DmaDoneHandler,(void *)Checked);
	status=XDmaPs_Start(&DmaInstance, Channel, &DmaCmd, 0);

	while (!Checked[Channel]&& (TimeOutCnt < TIMEOUT_LIMIT)) {
		   TimeOutCnt++;
	}

	if (TimeOutCnt >= TIMEOUT_LIMIT) {
		xil_printf("%d Timeout FAILED :-( \r\n",cmd_cnt);

	xil_printf("%d Exit XDMA_PS_memcpy  \r\n",cmd_cnt);
return status;	
}

 

 

And 

 

void DmaDoneHandler(unsigned int HandleChannel, XDmaPs_Cmd *DmaCmd, void *CallbackRef)
{
	Checked[HandleChannel] = 1;
}

 

 

Just the same as example.  Checked - global variable for both functions.

 

But the problem is that DmaDoneHandler launching only when programm leave XDMA_PS_memcpy.

 So console dout looks like

 

 

1 Timeout FAILED :-(
1 Exit XDMA_PS_memcpy
Handled channel 0
2 Timeout FAILED :-(
2 Exit XDMA_PS_memcpy
Handled channel 0
3 Timeout FAILED :-(
3 Exit XDMA_PS_memcpy

 

If I disable timeout counter, just waiting till while (!Checked[Channel]), it will never be finished.

 

What kind of problem it may be? Wrong interrupt setting?

 

0 Kudos
2 Replies
Visitor yangtuzi3000
Visitor
1,058 Views
Registered: ‎07-02-2017

Re: Zynq: PS_DMA done handler

 

I have a zedboard,

I want to wite data to DDR and read back through PS_DMA,

How to write the test app and driver modules?Anywhere have examples?

 

ThankYou!

 

0 Kudos
Newbie chihp
Newbie
32 Views
Registered: ‎11-12-2019

Re: Zynq: PS_DMA done handler

Have you solved the problem? I'm having the same problem now. Can you help me, please? Thank you.

0 Kudos