Skip to main content
This topic has been closed for replies.
MidnightProgBest answer
Explorer II
January 27, 2024

I encountered the same error when compiling a project with the MODBUS-LIB library

My solution is put to <project>/LWIP/Target/lwipopts.h

 

 

#define LWIP_SO_SNDTIMEO 1

#define LWIP_SO_RCVTIMEO 1

 

On another forum library author Alejandro Mera (3 years ago) answered:

You have to enable the timeout APIs of LWIP for RX and TX in the option file, otherwise the system gets stuck when a TX or RX fails.

For example:

Modbus-STM32-HAL-FreeRTOS/Examples/ModbusF429TCP/Middlewares/Third_Party/LwIP/src/include/lwip/opt.h

  #define LWIP_SO_RCVTIMEO 1
 
But in my case it turned out it was necessary to put both defines - for "rcv" and "snd" too.

2 replies

MidnightProgBest answer
Explorer II
January 27, 2024

I encountered the same error when compiling a project with the MODBUS-LIB library

My solution is put to <project>/LWIP/Target/lwipopts.h

 

 

#define LWIP_SO_SNDTIMEO 1

#define LWIP_SO_RCVTIMEO 1

 

On another forum library author Alejandro Mera (3 years ago) answered:

You have to enable the timeout APIs of LWIP for RX and TX in the option file, otherwise the system gets stuck when a TX or RX fails.

For example:

Modbus-STM32-HAL-FreeRTOS/Examples/ModbusF429TCP/Middlewares/Third_Party/LwIP/src/include/lwip/opt.h

  #define LWIP_SO_RCVTIMEO 1
 
But in my case it turned out it was necessary to put both defines - for "rcv" and "snd" too.
Explorer
December 5, 2024

#define LWIP_SO_SNDTIMEO 1

#define LWIP_SO_RCVTIMEO 1

Everything works. Thank you!!!