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: 
Highlighted
Adventurer
Adventurer
2,208 Views
Registered: ‎04-05-2018

VDMA & write to memory

Jump to solution

Hello, I am a newbie to programming.

I have one project with VDMA.  I'd like to use vdma just to write in memory and transmit frame to ethernet.

But i have some problems.

1. Why the record at the pixel address is repeated

2. When I write to memory one pixel ARM use 10 address(u can see on image)

Tags (1)
645797890.png
45123412351512.png
26312641.png
124124124124124.png
0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
3,009 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution

Thank's for your help @florentw.
I found a solution this problem. My clock was wrong.
Maybe you can help me tune vdma for cyclic data transfer.

0 Kudos
19 Replies
Adventurer
Adventurer
2,207 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution
int RegVal, status;

	    RegVal    = 0x04;
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x30, RegVal);
	    RegVal    = 0;
	    while(RegVal & (1 << 2))
	    {
	        RegVal    = Xil_In32(XPAR_AXI_VDMA_0_BASEADDR + 0x30);
	    }
	
	    RegVal            = Xil_In32(XPAR_AXI_VDMA_0_BASEADDR + 0x34);
	    RegVal            = RegVal | 0x1000;
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x34, RegVal);

	    
	    RegVal    = Xil_In32(XPAR_AXI_VDMA_0_BASEADDR + 0x30);
	    RegVal    = RegVal | 0x108B;
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x30, RegVal);

	    // VDMA Interrupt Init

		IntrCntrConfig	= XScuGic_LookupConfig(XPAR_PS7_SCUGIC_0_DEVICE_ID);
		if (IntrCntrConfig == NULL)	return XST_FAILURE;

		status			= XScuGic_CfgInitialize(&Intc, IntrCntrConfig, IntrCntrConfig->CpuBaseAddress);
		if (status != XST_SUCCESS)	return XST_FAILURE;
	    status = XScuGic_Connect(&Intc, XPAR_FABRIC_AXI_VDMA_0_S2MM_INTROUT_INTR, (Xil_InterruptHandler)DMA_TransferEnd_Handler, NULL);
	    if (status != XST_SUCCESS)
	    {
	        return XST_FAILURE;
	    }
	    XScuGic_SetPriorityTriggerType(&Intc, XPAR_FABRIC_AXI_VDMA_0_S2MM_INTROUT_INTR, 0, 3);
	    XScuGic_Enable(&Intc, XPAR_FABRIC_AXI_VDMA_0_S2MM_INTROUT_INTR);

	       
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC, ptrBufFrame);
	       
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC+4, ptrBufFrame+0x1BB8000);//307200(1BB8000) =640*480*(40)
	     
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC+8, ptrBufFrame+0x3770000);//307200 (3770000)=640*480*2*(40)
	    
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA8, 0x6400);//6400
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA4, 0x6400);
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA0, 480);
0 Kudos
Adventurer
Adventurer
2,150 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution
Who can help me in this question?
0 Kudos
Moderator
Moderator
2,145 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

Hi @ant_lipl_7030,

 

Why are you setting 0x6400 for A4 and A8? shouldn't it be 640?


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
2,139 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution

If i set 640 for A4 and A8, wouldn't all pixels are write to memory (look to image).

My imitator gives 16 bits per pixel (you can see on image after i multiplayer 640 *16. If i don't multiplayer Vdma gives only 16 pixel). But if i set 640 for A4 and A8, values in memory are written in the same way

1234123123124124.png
0 Kudos
Moderator
Moderator
2,135 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

Hi @ant_lipl_7030,

 

Yes sorry I forgot the bpc.

 

But 640x16 = 0x2800 not 0x6400... Could you clarify all you computation? I cannot find the match between your buffer size and you image size.

 

What is the format of your image?


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
2,122 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution
When i started this project i thought the same way. But when i when i started debugging i saw next image (my previous messedge). I found the desired value method by selection.
0 Kudos
Moderator
Moderator
2,116 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

HI @ant_lipl_7030,

 

Sorry I do not understand you. Is it fixed for you know?

 

Or do you still have issue? Could you please give some more details.

 

Thanks,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
2,111 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution

My design contain imitator of video signal, vdma and zynq(the first image). I want to write video signal to memory and transmit via ethernet. imitator of video signal gives 16 bit per pixel. Main problem is how data write in memory(the second image).

I write 0x6400 in 0xA8 and 0xA4 because if i write 0x2800  all pixel don't write to memory ( the third image ). Why this happens I do not understand

image.png
45123412351512.png
1234123123124124.png
0 Kudos
Moderator
Moderator
2,108 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

HI @ant_lipl_7030,

 

What is the value of ptrBufFrame? Could you try to "hard code" it (write the value directly in your code).

 

Did you read the error register of the VDMA to see if you had any error flagged?

 

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
2,147 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution
Value of ptrBufFrame is 0x01000000. Is error register of VDMA BaseAddr + 0x34h? if it is true then the value of fifth, twelfth, thirteenth, fifteenth bits is 1.
0 Kudos
Moderator
Moderator
2,144 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

Hi @ant_lipl_7030,

 

If you have error you cannot expect the VDMA to work properly. The 15th bit might be to watch.

 

Try to right 0xFFFFFFFF to 0x34 and try to read this register again and check if the 15th bit is still 0.

 

If yes this means that your configuration is not correct (might be HSIZE).

 

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
2,136 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution

Did i initialize all correct?

int init_vdma()
{

	int RegVal, status;	 
	    RegVal    = 0x04;
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x30, RegVal);
	    RegVal    = 0;	   
	    while(RegVal & (1 << 2))
	    {
	        RegVal    = Xil_In32(XPAR_AXI_VDMA_0_BASEADDR + 0x30);
	    }	   
	    RegVal            = Xil_In32(XPAR_AXI_VDMA_0_BASEADDR + 0x34);
	    RegVal            = RegVal | 0xFFFFFFFF;
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x34, RegVal);	 
	    RegVal    = Xil_In32(XPAR_AXI_VDMA_0_BASEADDR + 0x30);
	    RegVal    = RegVal | 0x108B;
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x30, RegVal);
		IntrCntrConfig	= XScuGic_LookupConfig(XPAR_PS7_SCUGIC_0_DEVICE_ID);
		if (IntrCntrConfig == NULL)	return XST_FAILURE;
		status			= XScuGic_CfgInitialize(&Intc, IntrCntrConfig, IntrCntrConfig->CpuBaseAddress);
		if (status != XST_SUCCESS)	return XST_FAILURE;
	    status = XScuGic_Connect(&Intc, XPAR_FABRIC_AXI_VDMA_0_S2MM_INTROUT_INTR, (Xil_InterruptHandler)DMA_TransferEnd_Handler, NULL);
	    if (status != XST_SUCCESS)
	    {
	        return XST_FAILURE;
	    }
	    XScuGic_SetPriorityTriggerType(&Intc, XPAR_FABRIC_AXI_VDMA_0_S2MM_INTROUT_INTR, 0, 3);
	    XScuGic_Enable(&Intc, XPAR_FABRIC_AXI_VDMA_0_S2MM_INTROUT_INTR);
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC, 0x01000000);
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC+4, 0x02BB8000);
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC+8, 0x03A2B8000);
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA8, 0x2800);//6400
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA4, 0x2800);
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA0, 480);
	    return 0;
}

Value  15th bit is 1.(value of 0x34h is 0x00019810).

But in hardware manager i see next image11111111111111111111111.png

0 Kudos
Moderator
Moderator
2,132 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

HI @ant_lipl_7030,

 

Did you try to write 0xFFFFFFFF to 0x34 before reading it? Writing 1 should clear the error.

 

Then if you still have the error, it could also come from your source. Are you sure you are sending the right amount for pixel. It could be that you are sending to much pixels.

 

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
2,127 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution
Yes, i write 0xFFFFFFFF to 0x34 before reading it.
0 Kudos
Adventurer
Adventurer
2,122 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution

@florentwwrote:

HI @ant_lipl_7030,

 

Did you try to write 0xFFFFFFFF to 0x34 before reading it? Writing 1 should clear the error.

 

Then if you still have the error, it could also come from your source. Are you sure you are sending the right amount for pixel. It could be that you are sending to much pixels.

 


what do you mean ?

0 Kudos
Moderator
Moderator
2,116 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

Hi @ant_lipl_7030,

 

To be sure that you keep having this error you should clear the status register by marking 1 to this bit:

Capture.JPG

 

As this is only a RO/WC register you can write 0xFFFFFFFF directly to the full register


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
3,010 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution

Thank's for your help @florentw.
I found a solution this problem. My clock was wrong.
Maybe you can help me tune vdma for cyclic data transfer.

0 Kudos
Moderator
Moderator
2,050 Views
Registered: ‎11-09-2015

Re: VDMA & write to memory

Jump to solution

Hi @ant_lipl_7030,

 

As the issue is now fixed, please kindly close this topic by marking your last reply as accepted solution.

 

For you query about tuning vdma for cyclic data transfer, please create a new topic on the video board giving a clear detail of what you want to do.

 

Best Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
2,047 Views
Registered: ‎04-05-2018

Re: VDMA & write to memory

Jump to solution
Thank's for your help @florentw.
0 Kudos