I created a project by CubeMx and enabled Ethernet in RMII mode plus LWIP.
I am trying to send UDP packet with this code :
IP4_ADDR(&client1IpAddr , 192 , 168 ,0,2);
ethTxBuffer_p = pbuf_alloc(PBUF_RAW_TX , bufferSize , PBUF_RAM);
memcpy(ethTxBuffer_p ->payload , fakeBuffer , bufferSize);
status = udp_sendto(udpPcb1_p ,ethTxBuffer_p ,&client1IpAddr , 5222);
and in the main function :
every thing is Ok until packet length is smaller than MTU size which is 1500 byte. when i increased the packet size to 1600 no packet was sent.
then i increased MEM_SIZE from 1600 to 10240 and now i can see the fragmented packets with Wireshark(network sniffer) in my PC but the packets checksum are incorrect, so they will be dropped.
is there any parameter that should be changed? i dont think that this is the LWIP 's bug.
i am working on it more than a week.please help me.
any suggestion would be appreciated.
thanks in advance