2023-07-14 11:35 PM
Hi, I am using STM32F439 as TCP Server with LWIP TCPecho example.
I am properly receiving data of any length from TCP Client, and I am also able to send back the received data to TCP Client without any issues. However, if the received data length is more than 536 bits, the data length pointer will always indicate 536 as the length received.
Data Pointer: es-> p-> payload
Data Length Pointer: es-> p-> len
I am not able to get to the problem as why this is happening and I need the accurate length to send the data to other microcontroller via SPI.
It will of a great help if anyone could help me to solve this problem.
I am also attaching my tcpserverecho.c file for the reference.
Thank You.
2023-07-15 01:40 PM
I'm not sure if this solves your problem, but check if it helps:
Generally, the packet size gets restricted by the Maximum Transmission Unit (MTU) of network resources. MTU is the maximum size of the data transfer limit set by hardware in a network. The packet size should never exceed MTU
2023-07-16 10:59 PM
I think 536 is the default MTU for lwIP, which you can increase in the lwip_opt.h file up to 1500.
Further, make sure that your RX buffers are big enough.