STM32F107VC Running a FreeRTOS with TCP

1.5k Views Asked by At

I need to develop an application on my eval board: STM3210-c (chip: stm32f107vc) which creates threads. Each thread creates a TCP client and is able to connect to a different slave.

I thought about using FreeRTOS & lwip (and preferably working with the socket functionality of the lwip).

But I want to use sockets, I don't want to have to manage the packets. I've tried to compile the LwIP with support for sockets but I can't get it to compile.

The flags I've set in lwipopts.h are:

#define LWIP_TIMEVAL_PRIVATE 0 #define LWIP_NETCONN 1 #define LWIP_SOCKET 1

When I try to compile I get an error that lwip/netbuf.h does not exist.

  1. Is there an example of code how to use freertos & lwip sockets?
  2. Is there a different library which I need to consider?

    • I am using VisualGDB.

Any offers or code sample would be highly appreciated.

2

There are 2 best solutions below

1
On

Not lwIP, but the following may offer an alternative that is tightly integrated with FreeRTOS http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP-IP_FAT_Examples_ST_STM32F407.html

0
On

Did you try to generate your project with stm32cube? Just add LwIP there and enable sockets API. Everything works perfectly.

And you can download examples for stm32 from STM32Cube Embedded Software. There are examples with sockets API.