W5500 TCP - write to TX buffer before connection up

Hi

I am using the W5500 in a new design and it is working well. To send data over TCP I currently:

Open a TCP socket
Wait for the connection to come active
Write to the TX buffer
Issue a SEND command

This works fine but I would like to change the order to:

Open a TCP socket
Write to the TX buffer
Wait for the connection to come active
Issue a SEND command

When I tried this it did not work. Is there a way of writing to the TX buffer before the TCP connection is active?

Bill

The socket has to be connected.
You can not fill the TX buffer of a disconnected socket because you do not know in which location write … the two TX buffer pointers are updated only upon connection.

Hi Coccoliso

Can I do this:

Open a TCP socket
Write message to FIFO and save TX_WR pointers
Wait for the connection to come active
Modify TX_RD and TX_WR pointers to point to message in FIFO
Issue a SEND command

The reason I want to do this is that my host has very little RAM and I want to save my message in the W5500 FIFO.

I do not remember the post but I’m pretty sure that the pointers contain 0 after reset but during the operations of opening of the socket containing two identical random values that are overwritten to the connection with the real value so I do not think that will work.
The buffers are used as random-access memory as long as the socket is connected.