2015-08-22 07:48 AM
Stm32f407
lwip 1.4.1
when trying to process udp packets in a simple socket based udp echo server with mtu size of 1500 bytes echo failed at packet payload size of 1472 bytes. Fixed this by changing hardware checksum to software checksum in low level ethernet unit function and enabling software checksum in lwipopts. Lwipopts provides no way of disabling hardware checksum. However after fine tuning lwipopts hit a barrier where can only echo back up to 32767 bytes. What options to set to increase this size up to 64kbytes?2015-08-22 08:10 AM
Hi,
Can you please post the actual changes in source code or options you did for having larger than 1500bytes MTU in lwip? I'm also interested in this. Regards, Christos2015-08-22 09:22 AM
Hi
No probs:In the function low_level_init() in ethernetif.c file change the following line:heth.Init.ChecksumMode = ETH_CHECKSUM_BY_SOFTWARE;Then in MX lwip options just enable the relevant checksum options. From what I found on the web there used to be an option in lwipopts to disable this but it is no longer there!Using wireshark the packets were being echoed but the checksum was being calculated for each block so the receiving program would discard. Once checksum was changed to SOFTWARE packets were being received intact.This got me to echoing back packets up to ~26000 byte mark. I modified some lwip options to get this up to ~ 32736 bytes:PBUF_POOL_SIZE - 32MEMP_NUM_REASSDATA - 28
MEMP_NUM_FRAG_PBUF - 28
IP_REASS_MAX_PBUFS - 28
PBUF_POOL_BUFSIZE - 1514However cannot get above this limit - consistently fails at this point.Emilio