cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `netconn_set_sendtimeout'

krex
Associate

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

1 REPLY 1
MidnightProg
Associate

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.