W6100 TCP Server RX Overflow

EDIT: I think I found the problem and it as on my end.


Apologies if this has been answered elsewhere.

I’m using the W6100 with a PIC32. I’ve been able to configure the W6100 as a TCP server using a varying number of sockets. My state machine is working such that I can receive packets and echo them back without problem. The weird part is the PIC crashes after I have transferred the amount of data equivalent to the RX buffer size. It appears to be an overflow problem.

I’ve been testing by using Packet Sender to open a socket, send data, then close the port. This results in Sn_RX_RD resetting to zero after a new connection is established. This appears to be the correct behavior but once the accumulated total of data sent exceed the RX buffer’s size the system crashes.

I have also tested with a persistent connection. In this case Sn_RX_RD is incremented correctly and I can see the deadly overflow approaching. My system again crashes once I send more data than the buffer can hold. I am attempting to catch this and prevent the crash but so far no luck.

I understand that my persistent connection overflow problem is most likely my fault and something I need to fix but I do not understand why sending X amount of data over many new connections causes the same overflow error. Documentation suggests buffer pointers are reinitialized after a new connection is established so it seems like my call to Sn_CR[RECV] is not being processed correctly.

Any help would be greatly appreciated!