WIZnet Developer Forum

Problems initializing TX Buffer

Hello everyone.

I’m kind of a beginner with W5500 Chip and I do have some problems sending data.
I want to run a socket in server mode and this works well until I want to send data to the client.
For debugging I read the Socket register and print it out to a serial console. Here is what I get:

00000000: 21 00 00 17 00 50 08 00   27 46 0f f5 c0 a8 28 22 
00000010: a5 7c 05 b4 00 00 80 00   00 00 00 00 00 00 02 02 
00000020: 08 00 ee 9c ee 9c 00 00   01 2b 01 2b ff 40 00 00 

As one can see the socket is running in TCP mode with DO_DELAY enabled (NO_DELAY doesn’t make a difference) and a connection is established. Read pointers are already modified, since I parsed an HTTP request from my webbrowser.
The problem now is, that the TX-Write and -Read Buffer pointer do not get initialized. If I do issue a SEND command, the W5500 send its whole memory (Seen in wireshark). After the first send command the pointers stand correct, but for me it’s not an option to send the whole memory.
I already tried a different Socket but nothing changed.
I think this post ([url]W5500 TCP - write to TX buffer before connection up]) is somewhat related to it, but doesn’t solve my problem, since my pointers do not contain 0 after connection is established.
After resetting the interrupts there is a 1sec. delay and the printout is done after processing RX-Buffer so I don’t think of a timing issue.

As hardware I’m using an Arduino Ethernet shield 2 but not the Arduino IDE.

So please can someone point me to what I’m missing.
Thank you

You assume that “initialized” means set to 0. It is not correct assumption.

Your TX buffer is initialized.

It says that TX buffer has 2K free space, its RD address is ee9c and its WR address is ee9c. You should start writing at this address, and increase WR pointer with the number of bytes. Then issue SEND command.

If you do not do it and just issue SEND command, W5500 sees that the difference between pointers is whole buffer (ee9c & 7ff) - (ee9c & 7ff) which is 0, but 0 means one full leap through buffer = 2K in size.

Chip is behaving properly.

Thank you very much for your reply. It now works as you said. I think I got a bit misguided by the post I quoted earlier where it said: [quote][…]but I’m pretty sure that the pointers contain 0 after reset[…][/quote]

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.