Hello,
I am unable to make httpd server. I am working with the following platform:
CPU: STM32G407 (Cortex-M4)
LAN PHY: LAN8720AI
SO: FREERTOS V10.3.1
I configured the LWIP and FreeRTOS using CubeMX tool.
The ping command works fine.
I defined in fsdata.c a very simple webpage, a sort of "hello world" html.
I checked possible stack overflow and MallocFailed from freertos.
When I try to open the webpage I see from debugger that the TCP connection is set ESTABILISHED. But there is no packets sent from the board toward the client.
As soon as I try to open the webpage the whole LWIP stack stop working and also the ping fails until the next reboot.
I tried also to increase the MEMP_NUM_PBUF to 64 (from 16).
LwIP is initialized calling from DefaultTask():
MX_LWIP_Init()
The httpd server is initialized calling from DefaultTask():
httpd_init();
Enabling the LWIP_DEBUIG I cannot print everythink since the sprintf and the sent to UART is too slow, but enabling a message ring buffer I see something like this:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n0dd7c new 0x14 (0)\n chksum)\n)\nx0,
State: \030รน\002\b\003\n |1056668| 6716 | (id, flags, offset)\nn, fl
TCP connection established 56644 -> 31422
http_accept 0x2000dd34 / 0\n-----+\n(src port, dest port[...]
tcp_receive: ACK for 536927516, unacked->seqno 6511:0\n
tcp_receive: removing 536927468:134412984 from pcb->036934304\n\0, flags (\00x0)\n\00x0)\n\0\0\0\075c)\n"
The size in tcp_receive is quite suspect.
The last message I get seems to be "tcp_receive: removing 536927468 etc"
It looks a memory allocation issue but I can't figure the cause.
Thank you
Mario