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
Visitor netstar_77
Visitor
1,074 Views
Registered: ‎05-21-2018

AXI VDMA Configuration

Jump to solution

Hello.

I am working with Kintex-7 FPGA, and trying to get it working with AXI VDMA for different resolutions.
I am able to get it output 1080p resolution by setting stride, vsize and hsize directly in memory registers.
However, when resolution change on the fly, and I have made microblaze to change this settings also, 
VDMA stops working. However it doesn't show any error flags in status register, just no output.
I have used Xilinx API for VDMA, but for some reason it is not clear what routines is need to be used to change hsize and vsize.
If it is one of routines from vaxivdma_channel.c then there is no info about setting BdPtr.

Here is my VDMA code;

 

VConfig = XAxiVdma_LookupConfig(DMA_DEVICE_ID_1);
	if (!VConfig) {
			xil_printf(
			    "No video DMA found for ID %d\r\n", DMA_DEVICE_ID_1);

			return XST_FAILURE;
		}
	VConf2 = XAxiVdma_LookupConfig(DMA_DEVICE_ID_2);
	if (!VConf2) {
			xil_printf(
			    "No video DMA found for ID %d\r\n", DMA_DEVICE_ID_2);

			return XST_FAILURE;
		}

	Status = XAxiVdma_CfgInitialize(&AxiVdma0, VConfig, VConfig->BaseAddress);
	if (Status != XST_SUCCESS) {

		xil_printf(
		    "Configuration Initialization failed %d\r\n", Status);

		return XST_FAILURE;
	}
	Status = XAxiVdma_CfgInitialize(&AxiVdma1, VConf2, VConf2->BaseAddress);
	if (Status != XST_SUCCESS) {

		xil_printf(
		    "Configuration Initialization failed %d\r\n", Status);

		return XST_FAILURE;
	}


	FrameCfg0.ReadFrameCount = NUMBER_OF_READ_FRAMES;
	FrameCfg0.WriteFrameCount = NUMBER_OF_WRITE_FRAMES;
	FrameCfg0.ReadDelayTimerCount = DELAY_TIMER_COUNTER;
	FrameCfg0.WriteDelayTimerCount = DELAY_TIMER_COUNTER;

	FrameCfg1.ReadFrameCount = NUMBER_OF_READ_FRAMES;
	FrameCfg1.WriteFrameCount = NUMBER_OF_WRITE_FRAMES;
	FrameCfg1.ReadDelayTimerCount = DELAY_TIMER_COUNTER;
	FrameCfg1.WriteDelayTimerCount = DELAY_TIMER_COUNTER;


	xil_printf("\n--Write memory config-- \r\n");
	Status = WriteSetup(&AxiVdma0);
	if (Status != XST_SUCCESS) {
		xil_printf(
			"Write channel setup failed %d\r\n", Status);
		if(Status == XST_VDMA_MISMATCH_ERROR)
			xil_printf("DMA Mismatch Error\r\n");

		return XST_FAILURE;
	}
	Status = WriteSetup(&AxiVdma1);
	if (Status != XST_SUCCESS) {
		xil_printf(
			"Write channel setup failed %d\r\n", Status);
		if(Status == XST_VDMA_MISMATCH_ERROR)
			xil_printf("DMA Mismatch Error\r\n");

		return XST_FAILURE;
	}

	xil_printf("\n--Read memory config-- \r\n");
	Status = ReadSetup(&AxiVdma0);
	if (Status != XST_SUCCESS) {
		xil_printf(
			"Read channel setup failed %d\r\n", Status);
		if(Status == XST_VDMA_MISMATCH_ERROR)
			xil_printf("DMA Mismatch Error\r\n");

		return XST_FAILURE;
	}
	Status = ReadSetup(&AxiVdma1);
	if (Status != XST_SUCCESS) {
		xil_printf(
			"Read channel setup failed %d\r\n", Status);
		if(Status == XST_VDMA_MISMATCH_ERROR)
			xil_printf("DMA Mismatch Error\r\n");

		return XST_FAILURE;
	}


	xil_printf("\n-- Start VDMA -- \r\n");
	Status = StartTransfer(&AxiVdma0);
	if (Status != XST_SUCCESS) {
		if(Status == XST_VDMA_MISMATCH_ERROR)
			xil_printf("DMA Mismatch Error\r\n");
		return XST_FAILURE;
	}
	Status = StartTransfer(&AxiVdma1);
	if (Status != XST_SUCCESS) {
		if(Status == XST_VDMA_MISMATCH_ERROR)
			xil_printf("DMA Mismatch Error\r\n");
		return XST_FAILURE;
	}

 

and then I have to do this, to get a correct resolution settings

	Xil_Out32((UINTPTR)(VDMA2_BASE+0x58), 0x01001E00L);
	Xil_Out32((UINTPTR)(VDMA2_BASE+0xA8), 0x01001E00L);


	Xil_Out32((UINTPTR)(VDMA2_BASE+0x54), 0x00001E00L);
	Xil_Out32((UINTPTR)(VDMA2_BASE+0xA4), 0x00001E00L);


	Xil_Out32((UINTPTR)(VDMA2_BASE+0x50), 0x00000438L);
	Xil_Out32((UINTPTR)(VDMA2_BASE+0xA0), 0x00000438L);

Anyone have any idea about using the API for resolution, and changing it on the fly.

Thanks.

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
796 Views
Registered: ‎10-04-2017

Re: AXI VDMA Configuration

Jump to solution

Hi @gcsimmonsjr,

 

As @reaiken mentioned. The example design is an excellent place to start and to see an example of how the API is added to an application.

 

If you are having trouble finding the API documentation using the tools, you can find it directly on the Xilinx Wiki. Here is the direct link to the AXI VDMA Standalone Driver source code. This API can also be viewed in your browser here.

 

For all video applications, I suggest referencing our Video design hub. This is found online or in the document navigator application and has links to all of the video API's.

 

-Sam

 

 

Don't forget to reply, kudo, and accept as solution.

Xilinx Video Design Hub
8 Replies
Explorer
Explorer
1,001 Views
Registered: ‎07-18-2011

Re: AXI VDMA Configuration

Jump to solution

@netstar_77

 

Stop and restart your VDMA when you do a resolution change. 

Don't do the full VDMA initialization from start, just stop it and reconfigure the format registers, then restart:

    XAxiVdma_DmaStop(...);

    Reconfigure your VDMA registers...

    XAxiVdma_DmaStart(...);

 

Visitor netstar_77
Visitor
980 Views
Registered: ‎05-21-2018

Re: AXI VDMA Configuration

Jump to solution

Thank you for answer reaiken.

Your suggestion helps me understand Xilinx API little more, however it does not help us with this issue.

Thanks one more anyway.

0 Kudos
Explorer
Explorer
968 Views
Registered: ‎07-18-2011

Re: AXI VDMA Configuration

Jump to solution

@netstar_77

Also, rather than directly writing  VDMA registers using Xil_Out32(...), you should use the API commands and data structures.

If you don't know where to access them, open up SDK and open the system.mss file under your <filename>.bsp folder, and go to the Peripheral Drivers section and click on Documentation beside the VDMA driver.  This will open a file in your browser with all the API commands and data structures.  You can use configuration data structures to set your VDMA settings.

I highly suggest you start with the Xilinx example code.  If you go to the aforementioned system.mss file in SDK and click on the Import Examples link, it will import a VDMA example folder with C code and header files that you can view to gain an understanding of how to set up and initialize the data structures and configure the VDMA using the API commands.

 

 

 

 

Adventurer
Adventurer
937 Views
Registered: ‎05-28-2018

Re: AXI VDMA Configuration

Jump to solution

(FYI, I happen to be working on this same project.)

Yes, however, for some reason there IS NO API documentation for the VDMA. There is for all the other Peripheral IPs, like Microblaze IP blocks, and some of the Video IP blocks (Chroma Resampler, RGB2YCrCb, Video Timing Controller,) and of course, there is no API documentation for our custom RTL blocks.

Any idea as to WHY there is no API Documentation on this block?

There doesn't seem to be any for the Microblaze Interrupt controller either, and I find this puzzling.

BSP.png
0 Kudos
Explorer
Explorer
925 Views
Registered: ‎07-18-2011

Re: AXI VDMA Configuration

Jump to solution

@gcsimmonsjr   @netstar_77

Which version of Vivado are you using?  I am using 2018.2.2 and 2018.3 and there is documentation in both for the axi_vdma IP. 

Perhaps you don't see it because you changed the name of the IP in one of the instances?  I have found it is best to keep the IP block names as Xilinx assigns them and assign them aliases in a header file if you want to be able to more easily understand them in your code.   You can run into odd situations in the xparameters.h file if you change the IP names, and your code will not be portable to other projects because the name won't match what is in xparameters.h if the IP names change.

 

bsp.jpgvdma.jpg

Adventurer
Adventurer
921 Views
Registered: ‎05-28-2018

Re: AXI VDMA Configuration

Jump to solution

2017.4.  This program started out using 2017.1, but later I upgraded (painfully) to 2017.4.

I believe the version of the core we are using is 6.3.

Good suggestion regarding IP block names!  I wouldn't have anticipated that one!

0 Kudos
Adventurer
Adventurer
903 Views
Registered: ‎05-28-2018

Re: AXI VDMA Configuration

Jump to solution

Funny. Version 6.3 is the ONLY version that doesn't have API documentation. Must have been an oversight!

0 Kudos
Moderator
Moderator
797 Views
Registered: ‎10-04-2017

Re: AXI VDMA Configuration

Jump to solution

Hi @gcsimmonsjr,

 

As @reaiken mentioned. The example design is an excellent place to start and to see an example of how the API is added to an application.

 

If you are having trouble finding the API documentation using the tools, you can find it directly on the Xilinx Wiki. Here is the direct link to the AXI VDMA Standalone Driver source code. This API can also be viewed in your browser here.

 

For all video applications, I suggest referencing our Video design hub. This is found online or in the document navigator application and has links to all of the video API's.

 

-Sam

 

 

Don't forget to reply, kudo, and accept as solution.

Xilinx Video Design Hub