Author Topic: SDK example with 3 Ethernet run with lwip on TE0729  (Read 613 times)

david.sakharov

  • Active Member
  • *
  • Posts: 9
SDK example with 3 Ethernet run with lwip on TE0729
« on: February 08, 2022, 05:46:22 PM »
Hi
im using TE0729 with its carrier board TEB729 for my project.
i need all its 3 Ethernet port for my application.
i implement my project in vivado 2019.1 based on trenz example,and export it to sdk 2019.1.
i create the hardware and board support package (bsp) with lwip library.
lwip does not support multi port Ethernet so i create emacps library myself and add it to the application project.
when i run my project with sdk debugger,all 3 Ethernet work fine with sending and receiving packet.
but when i program my application on qspi flash and boot from it,the application stop and hang on 2nd outgiong Ethernet package.this package come out of netif-setup () function.
i run sdk udp client pref example with same bsp,it work fine when i program it on qspi flash and boot from it.
all bsp file and fsbl.elf are same with my application bsp and fsbl files.
i also test my emacps library with that example,it work fine.
but this example configure only 1 Ethernet port.
my question is :
does anyone run a application with 3 Ethernet port work with lwip on TE0729
and test it with boot from qspi?
i really appreciate for the help
br
david

david.sakharov

  • Active Member
  • *
  • Posts: 9
Re: SDK example with 3 Ethernet run with lwip on TE0729
« Reply #1 on: February 12, 2022, 06:22:30 AM »
******* BEST SOLUTION *******
hi
I finally create a sdk project and test it.all 3 ethernet interface work fine and i use lwip for all of them.i share this so maybe it will be useful for others.
note that i create my project with vivado/sdk 2019.1 version
i create the vivado project based on Trenz TE0729 board refer to link below :
https://shop.trenz-electronic.de/Download/?path=Trenz_Electronic/Modules_and_Module_Carriers/5.2x7.6/TE0729/Reference_Design
i create the hardware platform refer to bit file exported from above project.
after that i create board support package (bsp) project with lwip211 with default value parameters.
then i modify the following file in lwip source files:

1.in xpqueue.c file, i change NUM_QUEUES value from "2" to "8"
the  NUM_QUEUES  is at line 36 of xpqueue.c file
xpqueue.c file is located at ".../libsrc/lwip211_v1_0/src/contrib/port/xilinx/netif"

2.in xtopology_g.c file i change line 17 parameter "XPAR_FABRIC_AXI_ETHERNETLITE_0_IP2INTC_IRPT_INTR" to "XPAR_FABRIC_AXI_ETHERNETLITE_1_IP2INTC_IRPT_INTR"
the modification is changing 0 to 1 on above file.
 xtopology_g.c file is located at ".../libsrc/lwip211_v1_0/src/contrib/port/xilinx/netif"

then i create udp client prif project from application porject example menu and modify it for 3 ethernet interface
the modification is
1.add 2 mac address to project.
2.add 2 netif struct to project
3. add 2  xmac_add() function refer to 2nd and 3rd ehternet base address(refer to xparameter.h file)
4.add xemacps_input() for aded netif file.

note that for PS ethernet interface i create my own library and add it to the project.
i did it because lwip does not support Zynq ps Ethernet and axi_ethernetlite at same time
i hope this post would be help
best regards
david

JH

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1969
Re: SDK example with 3 Ethernet run with lwip on TE0729
« Reply #2 on: February 16, 2022, 09:14:24 AM »
Hi,
good to hear that you get it running and thanks for sharing this information.
br
John