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
Participant mojtaba.ahmadi
Participant
1,044 Views
Registered: ‎05-20-2018

how to write data on VDMA and send data to Video_out to show on LCD by zynq

Jump to solution

hello.

I designed my board such as picture below to work with a LCD connecting with HDMI to z-turn 7z020 board.

Capture.PNG

I used these IPs: AXI VDMA, Video Timing Controller, Axi-4 stream to Video Out.

now, I want to write a C code in SDK to transfer some data as a picture to my LCD.

I initialize VDMA by this code and it is OK:

 

int main()
{
    init_platform();
    xil_printf("----------------------------------------------------- \r\n");
    int status;

    //Checking and configuring VDMA
	status = run_triple_frame_buffer(&AxiVdma, XPAR_AXI_VDMA_0_DEVICE_ID, 1024, 600, XPAR_PS7_DDR_0_S_AXI_BASEADDR + 0x1000000, 100, 1);
	if (status != XST_SUCCESS)
	{
		xil_printf("VDMA Transfer of frames failed with error = %d\r\n",status);
		return XST_FAILURE;
	}
	else
	{
		xil_printf("VDMA Transfer of frames started Successfully \r\n");
	}

	status = XAxiVdma_DmaStart(&AxiVdma, XAXIVDMA_READ);
	if (status != XST_SUCCESS) {
		xil_printf("Start read transfer failed %d\n\r", status);
	}
	else
	{
		xil_printf("start DMA Succseeded \r\n");
	}

    cleanup_platform();

    return 0;
}



 

I assume that I should use Xil_Out32 function to write data on VDMA base address and see it on LCD, like this:

int BaseAddress = XPAR_AXI_VDMA_0_BASEADDR;
xil_printf(" \r\n ---- write values on VDMA ---- \r\n"); for (i = 0; i < 10; i++) { addr = BaseAddress + 4 * i; xil_printf("address is: %d and values is %d \r\n", addr, i); Xil_Out32(addr, i); }

 

but it seems wrong. not only I do not have any output, but also when I read the same address that have been written, their values are wrong.

 

I want your help to get what should I do about it? how can I send my data to Video out for showing on LCD by VDMA?

thank you.

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
Voyager
Voyager
962 Views
Registered: ‎03-28-2016

Re: how to write data on VDMA and send data to Video_out to show on LCD by zynq

Jump to solution

Take a look at XAPP1205.  It is a bit dated, but it should still give you a good example for the hardware and the software.

 

https://www.xilinx.com/support/documentation/application_notes/xapp1205-high-performance-video-zynq.pdf

 

Here is a link to some pages on the forums for an intro to video:

 

https://forums.xilinx.com/t5/Video/Xilinx-Video-Series/td-p/849583

 

Ted Booth - Tech. Lead FPGA Design Engineer
www.designlinxhs.com

View solution in original post

3 Replies
Voyager
Voyager
1,020 Views
Registered: ‎03-28-2016

Re: how to write data on VDMA and send data to Video_out to show on LCD by zynq

Jump to solution

You are correct that you need to write the video data to the DDR memory so that the VDMA can read it.  The problem is you are writing to the VDMA's baseaddress which is the location of the VDMA's registers.  Check out Chapter 2 of PG020 to better understand the VDMA's register set.

 

https://www.xilinx.com/support/documentation/ip_documentation/axi_vdma/v6_3/pg020_axi_vdma.pdf

 

From the name of your function ("run_triple_frame_buffer()"), it sounds like you are planning to use the VDMA to cycle through 3 different buffers.  Each of these buffers will need to contain a complete frame.  The start addresses of these buffers are specified in the register set of the VDMA.  The size of each buffer is specified by the Vertical Size Register, the Horizontal Size Register and the Stride Register.  Keep in mind that the Horizontal size and the Stride size are specified in the number of bytes not the number of pixels.  Once you understand how the frame will be laid out in memory, you can then write the video data into each of the three buffers.

Ted Booth - Tech. Lead FPGA Design Engineer
www.designlinxhs.com
Participant mojtaba.ahmadi
Participant
972 Views
Registered: ‎05-20-2018

Re: how to write data on VDMA and send data to Video_out to show on LCD by zynq

Jump to solution

@tedbooth thank you for your response.

I checked PG020 out and got good information. but because I am new on zynq programming, I need an example of how to implement the mentioned programming flow in the document or what you said. would you mind introducing me an example code reading video data from DDR by VDMA?

I can write on DDR base address but how should I read it from VDMA? and how to send read data to axi_4s_video_out to show?

I saw examples of XILINX SDK about axivdma but did not get what I was looking for.

now, I just want to show a moving square on LCD by this design. I write 0xffffff on part of memory and now want to show it on lcd and shift it for moving.

0 Kudos
Voyager
Voyager
963 Views
Registered: ‎03-28-2016

Re: how to write data on VDMA and send data to Video_out to show on LCD by zynq

Jump to solution

Take a look at XAPP1205.  It is a bit dated, but it should still give you a good example for the hardware and the software.

 

https://www.xilinx.com/support/documentation/application_notes/xapp1205-high-performance-video-zynq.pdf

 

Here is a link to some pages on the forums for an intro to video:

 

https://forums.xilinx.com/t5/Video/Xilinx-Video-Series/td-p/849583

 

Ted Booth - Tech. Lead FPGA Design Engineer
www.designlinxhs.com

View solution in original post