AnsweredAssumed Answered

LwIP + FreeRTOS sending large data

Question asked by Otavio Borges on Mar 8, 2016
Latest reply on Apr 7, 2016 by Carlos_Musich


Hello all,

I'm currently working with LwIP and FreeRTOS to create a small HTTP server. I'm using an SD card to storage wwwroot data, and fatfs library to deal with reading/writting the SD card.

I've been able to read and send small data like HTML files and so, but when I try to send a larger file, like an image, I can read the data but netconn_write get stucked. As far as I know larger frames (over 1024 bytes) should be segmentated.

I've tried breaking the frames mannually without success. Seems that lwIP keeps receiving the file data and storaging in TCP buffer, and unless I close the connection (netconn_close) the data is no send. I tracked the packets with wireshark and either only the first frame is send or none at all and the code gets stucked on netconn_write.

 

Any ideas?

 

Thanks in advance.

PS.: I've attached the part of the code responsable for frame handling. netconnListener is called after I start listening on the desired port (80).

Original Attachment has been moved to: packetSend.c.zip

Outcomes