Skip to main content
krex
Explorer
May 26, 2023
Solved

undefined reference to `netconn_set_sendtimeout'

  • May 26, 2023
  • 1 reply
  • 1730 views

I'm using the example for ModbusF429TCP from a GitHub repo for Modbus and get the following error: undefined reference to 'netconn_set_sendtimeout' I'm unfortunately still very new to STM32 and that's why I'm slightly overwhelmed now

GitHub repo is Modbus-STM32-HAL-FreeRTOS/Examples/ModbusF429TCP at master · alejoseb/Modbus-STM32-HAL-FreeRTOS · GitHub

Best answer by MidnightProg

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.

1 reply

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!!!