Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE
Dear support team,
I am currently implementing a TCP server which shall provide connection to 2 different TCP ports.
The lwIP stack works fine with 2 connections as long as I am transferring data only at 1 of the 2 connected clients.
When I start to transfer data on both connections at the same time, the lwIP stack crashes. (sometimes after a few seconds, sometimes after 10+ seconds)
It also does not react to ICMP echo requests anymore.
Debugging (after the lwIP stack does not respond anymore) shows that the 'mem_free' function, being called from 'f2838xif_process_transmit' does always result in a 'memory double free' error condition.
The packet descriptor pointer 'pktDescPtr' does not become zero and therefore the function stays in the while loop forever.
Problematic 'double free' procedure in mem.c: => see image: https://ibb.co/Y7hjR52
Infinite while loop in 'f2838xif_process_transmit' function including stack trace: => see image: https://ibb.co/CQSxTNW
I also enabled the lwIP stats showing multiple 'illegal' entries in the mem section.
=> see image: https://ibb.co/71zLJwg
So I decided to check these 'illegal' memory entries in your default 'enet_lwip' demo application.
I enabled the lwIP stats in your demo application and downloaded it.
Result:
These 'illegal' memory events also occur in the TI demo application.
After a device reset, the counter is zero.
When sending 2-4 ICMP echo packets to the TI, the counter raises to 8 and stays at this value.
Sending additional ICMP echo packets do not raise the value anymore.
But when browsing the HTTP page included in the demo, the counter increases by 1 for every HTTP connection (web page reload or pushing the button).
Connecting with a debugger shows that this 'illegal' entries are caused by the (same) 'double free memory' procedure.
The only difference is that the demo application seems to recover from this error and leave the while loop in the function 'f2838xif_process_transmit' which I've mentioned above.
My application currently doesn't use the TI RTOS but uses the functions, provided in the TI 'enet_demo' application.
Is it possible that this might be an concurrency issue? (but it also occurs in the TI demo application)
Thank you,
Markus