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
1,478 Views
Registered: ‎04-05-2018

Ethernet and VDMA

Jump to solution

Maybe someone can help me.

I want transmit video to ethernet and recieving signal of control. But i have some problem. After i have initialized vdma in my project, the receiving part of the ethernet stops working.

int main()
{
	struct ip_addr ipaddr, netmask, gw;

	/* the mac address of the board. this should be unique per board */
	unsigned char mac_ethernet_address[] =
	{ 0x00, 0x0a, 0x35, 0x00, 0x01, 0x02 };

	echo_netif = &server_netif;

	init_platform();

	/* initliaze IP addresses to be used */
	IP4_ADDR(&ipaddr,  192, 168,   1, 10);
	IP4_ADDR(&netmask, 255, 255, 255,  0);
	IP4_ADDR(&gw,      192, 168,   1,  1);

	print_app_header();
	print_ip_settings(&ipaddr, &netmask, &gw);

	lwip_init();
  	/* Add network interface to the netif_list, and set it as default */
	if (!xemac_add(echo_netif, &ipaddr, &netmask,
						&gw, mac_ethernet_address,
						PLATFORM_EMAC_BASEADDR)) {
		xil_printf("Error adding N/W interface\n\r");
		return -1;
	}
	netif_set_default(echo_netif);	
	/* now enable interrupts */
	platform_enable_interrupts();
	/* specify that the network if is up */
	netif_set_up(echo_netif);	
start_application();
	int Status;
	Status =  GPIOControl_Init();
	if (Status != XST_SUCCESS) {
		 xil_printf("Initializaton GPIO failed with error = %d\r\n",Status);
		 return XST_FAILURE;
		} else {
		 xil_printf("Initializaton GPIO is OK \r\n");
		 		}

	GPIO_Write(0x01);
	GPIO_Write(0x00);
	init_vdma();	// if i delete this code ethernet will work normal
/* receive and process packets */
	while (1) {
		xemacif_input(echo_netif);
		transfer_data();
	}  
	/* never reached */
	cleanup_platform();
	return 0;
}

If i delete initialization vdma receiving part of ethernet work normal

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 | 0x1000;// 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, ptrBufFrame);
	  
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC+4, ptrBufFrame + 0x4B0000);//307200(1BB8000) =640*480*(40)
	
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC+8, ptrBufFrame + 0x960000);//307200 (3770000)=640*480*2*(40)

	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA8, 0x500);//640*2
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA4, 0x500);
	    Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA0, 480);
	    return 0;
}

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
1,973 Views
Registered: ‎04-05-2018

Re: Ethernet and VDMA

Jump to solution

Hi @bwiec!
I know reason my problem, but i don't know how do it. I think I've break the ethernet interrupts after i tune in vdma interrups.

How i can tune in interrupts vdma and ethernet together in my project ??

Help, please!

 

0 Kudos
10 Replies
1,451 Views
Registered: ‎02-12-2018

Re: Ethernet and VDMA

Jump to solution
hello,
you should check your interrupt configuration.
0 Kudos
Xilinx Employee
Xilinx Employee
1,425 Views
Registered: ‎08-02-2011

Re: Ethernet and VDMA

Jump to solution
Could be many things. Can you detail exactly what happens when the 'ethernet stops working?'

One thing to be careful about is to make sure the VDMA's data buffers aren't over-lapping and corrupting some code region of memory (check your linker script).

How are you allocating ptrBufFrame ? Make sure your appropriate linker script section has enough memory to store multiple full frames of video data plus whatever else is going on in the code.
www.xilinx.com
0 Kudos
Adventurer
Adventurer
1,412 Views
Registered: ‎04-05-2018

Re: Ethernet and VDMA

Jump to solution

Hi @bwiec, thank's for your answer. 

'ethernet stops working' it's mean that board doesn't recive packets if i initialization vdma.

Can you explain or  give me link what is 'check your linker script' and how i can do it (i am beginner in programming).

I don't understand about  "How are you allocating ptrBufFrame ?"  sorry i am beginner.

0 Kudos
Adventurer
Adventurer
1,411 Views
Registered: ‎04-05-2018

Re: Ethernet and VDMA

Jump to solution
Hi @theultimatesource, thank's for your answer! i am trying verify this
0 Kudos
Xilinx Employee
Xilinx Employee
1,396 Views
Registered: ‎08-02-2011

Re: Ethernet and VDMA

Jump to solution

 

Hi @bwiec, thank's for your answer. 

'ethernet stops working' it's mean that board doesn't recive packets if i initialization vdma.

Can you explain or  give me link what is 'check your linker script' and how i can do it (i am beginner in programming).

I don't understand about  "How are you allocating ptrBufFrame ?"  sorry i am beginner.

 

That's okay, no problem. In SDK, right-click on the C project and select 'Generate Linker Script.' Post a screenshot of it.

 

Can you post a snippet of code showing how you declared ptrBufFrame variable? i.e. Did you use malloc, or just declare a huge array statically? Or is it just a pointer with no allocation at all? Is it global or local?

www.xilinx.com
0 Kudos
Adventurer
Adventurer
1,373 Views
Registered: ‎04-05-2018

Re: Ethernet and VDMA

Jump to solution
ptrBufFrame is just a pointer. It's global
u32 ptrBufFrame = 0x01000000;
0 Kudos
Adventurer
Adventurer
1,366 Views
Registered: ‎04-05-2018

Re: Ethernet and VDMA

Jump to solution
I noticed that receiving doesn't independ from vdma. if i add to echo example my code ( i create new udp_pcb, then do blind and connect), i see what receiving stop working
0 Kudos
Adventurer
Adventurer
1,974 Views
Registered: ‎04-05-2018

Re: Ethernet and VDMA

Jump to solution

Hi @bwiec!
I know reason my problem, but i don't know how do it. I think I've break the ethernet interrupts after i tune in vdma interrups.

How i can tune in interrupts vdma and ethernet together in my project ??

Help, please!

 

0 Kudos
1,261 Views
Registered: ‎02-12-2018

Re: Ethernet and VDMA

Jump to solution
@ant_lipl_7030,
told ya 😉. what happens is that you configure your interrupts for lwip, then reconfigure them AGAIN for VDMA ergo lwip stops working. you'll need to do that separately.
Adventurer
Adventurer
573 Views
Registered: ‎04-05-2018

Re: Ethernet and VDMA

Jump to solution
Hello, @theultimatesource !!
Yes, you told, but I understand that I do not initialize the VDMA interrupt at all. My code is wrong. I don't know how to set the interrupt correctly. maybe can u me help in this issue?
0 Kudos