Can't connect sockets to send data with FreeRTOS-TCP

As a test, could you try to make a connection using a terminal program, e.g. puTTY ?
Can you make it connect to 192.168.1.40 port 5050, using a raw interface type?

I am also thinking of a recent issue, but that was slightly different: the packets from the FreeRTOS device were stopped at the PC.
Only after the PC had done a ping to the device, it was allowed to reply.

In your case, the ARP requests seem to arrive well, and the device gives a proper answer (a8:61:0a:ae:82:c1).

An ARP request is a kind of broadcast, all EMACs will hear it.

A TCP packet is a unicast, going to a particular MAC address. Are you sure that your device has set the MAC-address in the EMAC?

About your FreeRTOSIPConfig.h : that looks OK to me.