i am using the LPC1768 webserver_freertos LPCOpen example. i am running into strange problems with an PC application connected via TCP to the MCU. because i spent hours of debugging and can't really find the problem, i tried to reproduce some similiar behavior with the original code. and that was quite easy.
i just brought the webserver_freertos example (vanilla code) running and just modified the netconn_fs.c in the following way:
const static char http_index_html = "<html><head><title>Congrats!</title></head><body><h1>Welcome to our lwIP HTTP server!</h1>
near line 135:
netconn_write(conn, http_html_hdr, sizeof(http_html_hdr)-1, NETCONN_NOCOPY);
modified to call netconn_write more often:
i think that should be a harmless change - but the webserver isn't responding any longer. i captured the whole traffic with wireshark. there are problems with TCP fragement overlaps. (wireshark capture attached)
the interesting part: it is working, as soon as i call netconn_write really often:
another workaround is, to enabled TCP_NO_DELAY:
is there anything, i made wrong? i think, that should work ...
additionally i found some possible other problems in that example code:
configASSERT is not defined. defining it will produce some assertion errors. for example: the eth rx/tx tasks are started with priorities 5 and 6. but FreeRTOS config only allows 5 priorities. so the tasks will be running at the same priority (which is 4). the tcp ip thread is running with priority 3. but lwipopts.h says, tcp ip thread should run at higher priority than MAC threads ... chaning that, wont' change any to above errors.
are there any suggestion, what should help?