# Using LWIP in FreeRTOS

**URL:** <https://forums.freertos.org/t/using-lwip-in-freertos/3773>\
**Category:** Kernel\
**Created:** [April 2, 2013, 7:27am UTC](https://forums.freertos.org/t/using-lwip-in-freertos/3773 "2013-04-02T07:27:03Z")\
**Posts on this page:** 4\
**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:** [April 2, 2013, 7:27am UTC](https://forums.freertos.org/t/using-lwip-in-freertos/3773/1 "2013-04-02T07:27:03Z")

</div>

**[biradarajinkya](https://sourceforge.net/u/biradarajinkya/)** wrote on [Tuesday, April 02, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/a9fbb4cf/#a9a6):

Hi,  
I am using freeRTOS v 5.0.2. Target hardware is STR912 comstick.  
Earlier I was using uip demo project available on freeRTOS site .  
Now I want to use lwip demo project . So that I can send a UDP packet to STR912 in network.

And one more thing I want to ask here is can we send UDP packet using uip.  
If yes the what things need to be taken care of.

Because the socket.c and socket.h files are not a part of uip directory.  
These(socket.c and socket.h) files are located in " \Demo\Common\ethernet\lwIP\_130\src\include\lwip".

And also on google groups i found a reply saying - An lwIP demo is also available upon request .  
So how can I get the lwip demo for STR912 .

[http://groups.google.com/group/osdeve\_mirror\_rtos\_freertos-discussion/browse\_frm/month/2007-08?pli=1](http://groups.google.com/group/osdeve_mirror_rtos_freertos-discussion/browse_frm/month/2007-08?pli=1)  
[https://sourceforge.net/projects/freertos/forums/forum/382005/topic/1812192?message=4490998](https://sourceforge.net/projects/freertos/forums/forum/382005/topic/1812192?message=4490998)

- 

Thanks,  
Ajinkya

---

<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:** [April 2, 2013, 1:16pm UTC](https://forums.freertos.org/t/using-lwip-in-freertos/3773/2 "2013-04-02T13:16:28Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, April 02, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/a9fbb4cf/#79f9):

The FreeRTOS code you are using is \*very\* old, and the lwIP code is moderately old.

You can find a FreeRTOS/lwIP 1.4.0 integration that runs in the FreeRTOS windows simulator here :  
[http://interactive.freertos.org/entries/20290712-FreeRTOS-Win32-project-with-lwIP-web-server](http://interactive.freertos.org/entries/20290712-FreeRTOS-Win32-project-with-lwIP-web-server)

lwIP has three APIs, each of which has greater abstraction.&nbsp; The Raw API is the lowest, and the Sockets is the highest.&nbsp; The sockets file are therefore not part of the core lwIP functionality, but use the core functionality to provide a familiar sockets like API.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [April 2, 2013, 2:35pm UTC](https://forums.freertos.org/t/using-lwip-in-freertos/3773/3 "2013-04-02T14:35:48Z")

</div>

**[biradarajinkya](https://sourceforge.net/u/biradarajinkya/)** wrote on [Tuesday, April 02, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/a9fbb4cf/#7cb2):

Thankyou sir for your reply,

What I want to do is receive a UDP packet and take a action depending on the “command/code” received in packet.  
For this purpose i need “lwip\_recvfrom” function as I came to know from  
[http://www.freertos.org/FreeRTOS-Plus/FreeRTOS\_Plus\_UDP/FreeRTOS\_UDP\_IP\_Embedded\_Ethernet\_Tutorial.shtml](http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_IP_Embedded_Ethernet_Tutorial.shtml)

What you meant is use the lowest abstraction (RAW API) and have the required functionality (sockets)?&nbsp; Right?

Can you please guide how to upgrade to current version for a target platform (STR91x in this case) and using this “FreeRTOS Win32 project with lwIP web server” for a target platform.

and lastly can we have socket functionality using “uip” stack, which has been provided in uip webserver demo.

---

<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:** [April 2, 2013, 3:21pm UTC](https://forums.freertos.org/t/using-lwip-in-freertos/3773/4 "2013-04-02T15:21:25Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, April 02, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/a9fbb4cf/#fd3c):

The page you [link to](http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_IP_Embedded_Ethernet_Tutorial.shtml) is **not** lwIP but a propriatory UDP stack developed by Real Time Engineers Ltd directly.&nbsp; To use that code you would need to [create a functions to interface the UDP stack to the ST MAC drivers](http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Porting.shtml).

I believe uIP can be used with UDP, but I have never done it myself, so couldn’t offer any advice on that.

Regards.
