The first two connections use the following pcbs: 0xbab4 (pcb first connection) 0xba18 (pcb second connection)
n+1 (third connection in this example) gets this pcb 0xbab4 (reuses pcb from first connection)
=> Now we have "lost" the lpcb 0xb76c !!!
n+2 gets this pcb
0xb76c (this was the starting address of first "listening pcb", this "normal pcb will overlap with second lpcb !!!)
=> This overwrites the "last remaining" listening pcb !!!
If I leave MEMP_NUM_TCP_PCB at 2, but increase the MEMP_NUM_TCP_PCB_LISTEN to 6 I get almost identical behavior (different addresses obviously) with the same failure at n+2 connection (one lpcb dropped at n+1, last remaining lpcb overwritten at n+2).
I will not rule out that some LWIP settings (maybe pcb memory allocation settings?) are wrong in my project. Is there any setting I could try?