# lwip for Zynq

**URL:** <https://forums.freertos.org/t/lwip-for-zynq/4985>\
**Category:** Kernel\
**Created:** [May 11, 2015, 9:22pm UTC](https://forums.freertos.org/t/lwip-for-zynq/4985 "2015-05-11T21:22:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 11, 2015, 9:22pm UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/1 "2015-05-11T21:22:27Z")

</div>

**[seanbzd](https://sourceforge.net/u/seanbzd/)** wrote on [Monday, May 11, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#7c4c):

Is there a lwip package available from freertos that I can use on my microzed? I tried to follow instructions from [http://www.freertos.org/FreeRTOS-Plus/FreeRTOS\_Plus\_TCP/TCP\_Networking\_Tutorial\_Adding\_Source\_Files.html](http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial_Adding_Source_Files.html) but I’m stuck on step 2 talking about “creating network drivers for other chips”. The downloaded package says “To\_Be\_Released\_Soon.txt” for this step. Any ideas? Thanks.

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [May 12, 2015, 3:28am UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/2 "2015-05-12T03:28:36Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Tuesday, May 12, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#1d76):

Hi Sean,

A driver for FreeRTOS+TCP (not lwIP) is almost ready. It is developed and tested on a Microzed. TCP runs very fast with a nett speed up to 10 MB/sec (on a 100 mbit LAN).

If you like drop an email to [http://www.freertos.org/RTOS-contact-and-support.html](http://www.freertos.org/RTOS-contact-and-support.html) and we will send you the driver as it is now.

Regards.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [May 12, 2015, 6:48am UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/3 "2015-05-12T06:48:02Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, May 12, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#2818):

Sean - I’m not sure if you realise, but the title of your post mentions lwIP, but the link in your post is to FreeRTOS+TCP - which are completely different products.

If you want lwIP then there is a demo in the FreeRTOS .zip file download ([http://www.freertos.org/RTOS-Xilinx-Zynq.html](http://www.freertos.org/RTOS-Xilinx-Zynq.html)), if you want FreeRTOS+TCP then we can send you the code (as per Hein’s post).

Regards.

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [May 12, 2015, 7:49am UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/4 "2015-05-12T07:49:22Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Tuesday, May 12, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#4168):

And if you decide to use lwIP, you may also contact us 🙂  
I’m curious about the experiences with the EMAC drivers that are used for lwIP.

Thanks,  
Hein

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 12, 2015, 11:09am UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/5 "2015-05-12T11:09:40Z")

</div>

**[seanbzd](https://sourceforge.net/u/seanbzd/)** wrote on [Tuesday, May 12, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#9b89):

My mistake, for some reason I thought TCP was part of the lwip. I’m interested in freeRTOS+TCP for now. As suggested, i sent an email to the support group asking for it. Thanks.

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [May 12, 2015, 1:46pm UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/6 "2015-05-12T13:46:28Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Tuesday, May 12, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#b6c0):

When reading your post, many people will think: TCP **is** part of lwIP!

Some history:

lwIP (light-weight IP) and uIP (micro-IP) are both TCP/IP stacks, originally developed by Adam Dunkels. They are libraries for embedded applications which allow you to communicate through Ethernet / Internet. The libraries have been ported to many platforms and they are supported by, but not depending on FreeRTOS.

Since about half a year, FreeRTOS has its own TCP/IP-stack which is called FreeRTOS+TCP. It supports TCP, UDP, ICMP and it includes higher protocols like DHCP, nameservers (DNS, LLMNR, NBNS) and HTTP and FTP.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 14, 2015, 1:46am UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/7 "2015-05-14T01:46:39Z")

</div>

**[seanbzd](https://sourceforge.net/u/seanbzd/)** wrote on [Thursday, May 14, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#5b54):

Hein, Thanks for the clarification.

I have imported the FreeRTOS+TCP project I received over email from Richard. The HW platform says it is for ZC702. I have Microzed xc7z010 board I’m using. I’ve built the project I received, customized IP Address, default gateway etc…and when I try to run it, the application is having problems like, allocating heap memory, creating Queues in the main() etc…should the project as-is not expected to work on the board that I have? probably a stupid question but i am more of a application programmer.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [May 14, 2015, 9:09am UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/8 "2015-05-14T09:09:36Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, May 14, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#5b54/6035):

Hein has sent you a hardware project for the Microzed xc7z010.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 14, 2015, 8:52pm UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/9 "2015-05-14T20:52:24Z")

</div>

**[seanbzd](https://sourceforge.net/u/seanbzd/)** wrote on [Thursday, May 14, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#307c):

Thanks. I was able to get the standalone project I received from Hein work build and work. Now I’m trying to port just the TCP portion of it into my application. But it has references to the FreeRTOS+FAT. It is not clear to me whether this is needed for TCP to work? I would like to port the minimum set possible into my application because I’m only interested in TCP.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [May 14, 2015, 9:29pm UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/10 "2015-05-14T21:29:27Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, May 14, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#307c/6621):

FreeRTOS+FAT is only needed if you want to run the FTP or HTTP servers.

Regards.

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [May 15, 2015, 7:00am UTC](https://forums.freertos.org/t/lwip-for-zynq/4985/11 "2015-05-15T07:00:39Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Friday, May 15, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/dd12aa2f/#d425):

Hi Sean,

In order to include TCP/UDP into your Xilinx application you only need to include these source files:

```
TCP/IP stack:
    FreeRTOS-Plus-TCP\FreeRTOS_ARP.c
    FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c
    FreeRTOS-Plus-TCP\FreeRTOS_DNS.c
    FreeRTOS-Plus-TCP\FreeRTOS_IP.c
    FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c
    FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c
    FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c
    FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c
    FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c
    FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_1.c

Port for Xilinx:
    FreeRTOS-Plus-TCP\portable\NetworkInterface\Zynq\NetworkInterface.c
    FreeRTOS-Plus-TCP\portable\NetworkInterface\Zynq\uncached_memory.c
    FreeRTOS-Plus-TCP\portable\NetworkInterface\Zynq\x_emacpsif_dma.c
    FreeRTOS-Plus-TCP\portable\NetworkInterface\Zynq\x_emacpsif_hw.c
    FreeRTOS-Plus-TCP\portable\NetworkInterface\Zynq\x_emacpsif_physpeed.c

```

As you are one of the first users of this port, please keep us informed about how things are going.

Your platform has a lot of fast DDR RAM. If you want really high-speed TCP connections, allow bigger buffers.

```
/* Define the size of RX stream buffer for TCP sockets. */
#define ipconfigTCP_RX_BUF_LEN ( 65536 )

/* Define the size of TX stream buffer for TCP sockets. */
#define ipconfigTCP_TX_BUF_LEN ( 65536 )

/* The number of available network buffer descriptors.
Depends on how many concurrent TCP connections there will be. */
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 36

/* Normally the maximum allowed value for MTU: */
#define ipconfigNETWORK_MTU 1500

```

If performance is important, just play with the parameters (see also the socket option `FREERTOS_SO_WIN_PROPERTIES`). You can also look at the communication with a capture program like Wireshark.

Regards.
