Adding lwip to WIN32-MingW demo


Is there an easy way to add lwip to the Win32-MingW project?
Alternatively, following the link Adding the TCP/IP Source Files to an RTOS Project,
I got stuck on compiling problems.

The MingW and Visual Studio projects both use the same kernel port. There are several FreeRTOS+TCP projects that use WinPCap to get raw access to the Ethernet. You could use the same WinPCap driver as a starting point of an lwIP port.

Thank you very much.
I followed indication. Start from a rtos project working, and I choose win32-mingw then added the tcp directories and files as indicated ( the same files in the visual studio tcp working project) but it not compiles. Win32 must not be defined and I should tell that I am using gcc compiler…
Maybe the right place where to tell is in pcap.h file but what to do is for me too hard to do. That’s why I asked for a Mingw tcp working project.
Better was to have a lwip working under windows simulator as stm uses lwip.

Have you also see these demo’s with FreeRTOS and FreeRTOS+TCP?

It uses the FreeRTOS TCP/IP stack (not lwIP). You you can run it from Visual-C

…as stm uses lwip

+TCP also supports all STM devices:

A new unified STM driver is being developed right now.

If you have any further questions, you can ask them here.

1 Like

Hein Tibosch.
I followed the link "TCP_Networking_Tutorial_Adding_Source_Files "
to add TCP/IP files to my Win32-MingW project.
Unfortunately I am not able to make them compile.
At the end of compilation I have:

c:\mingw\include\stdio.h:345:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘__mingw__snprintf’

I think I miss some define to tell the system that new files must be compiled with Mingw but I do not know

what to do and where to do.

Best regards

See this thread: Build demo TCP project using MinGW - #9 by rum

Hello Richard Barry,

unfortunately it does not help, but I found that MINGW32
is defined.
Best Regards

Hello Richard,

I think you could help me.

I follow tutorial to add the TCP/IP support to my project.

First I add all the source file as indicated in point 1.
At point 2. I should add NetworkInterface.c and If I want to run Windows Simulator I should add that in WinPCap.
At point 3 I add BufferAllocation_c
At point 4 the compiler, which I am using GCC
At point 5 FreeRTOSIPConfig.c, which I choose from FreeRTOS_Plus_TCP_Echo_Qemu_mps2

In this way it does not work.

Does anyone have success in importing TCP/IP support to MingW project and provide some indication?

Best Regards

Can you share the complete compiler output?

It compiles, only there is incompatibility in StreamBuffer_t struct definition.
It is defined in two different files, one in FreeRTOS and one in FreeRTOS TCP plus, I do not know how to fix.

How did you determine this incompatibility? Unless you share some code or output or something which helps me understand the problem you are facing, it is hard for me to provide any meaningful suggestion. Try to share your code if you can.