WIZnet Developer Forum

W5500 TX_FSR out of range

I try to integrate the w5500 in my design and startet with a simple server, fixed ip. I open the socket in TCP mode, wait for sock_established and send some html bytes. I see the received bytes (some browser stuff like GET / HTTP/1.1 Host: User-Agent…). I send the answer, however, this does not arrive at the other side - instead there are garbage bytes. During further investigation, I connected a logic analyzer on the spi line and counterchecked my data in software against real transmission on the line. Good.

As a test, I read the TX_FSR register (double reading + compare), got 0x0800 at start.
After writing some bytes, this register shows garbage: ie 0x7F5A, what is really out of possible range. Again, I can see these values on the Logic Analyzer!

Additional Information: raw data log on the other side shows a repeated 2k memory content, most of the bytes are rubbish, some bytes contain my html string sent to the w5500. Seems that the chip is ‘looping freely’ through the output memory.

Sending is done with: read the tx_wr pointer, write the data at this location, increment tx_wr by sizeof(data), write tx_wr to the chip, issue a SEND command.

Can you give me a hint on this topic?

Obviously solved: reading of tx_wr must be done just before sending, there is some shift during link establish.

Question: can you tell, whether tx_wr is shifted by the chip in case of sock_established? Or can I cache this pointer in my code to speed up the interface?

The data transfer process is as follows.

Sn_TX_WR is a value that is increased by the user and is not automatically increased by the chip. When the user increases the Sn_TX_WR value and transmits the SEND command, the data is transmitted, and when the data transmission is completed, the value is increased by the Sn_TX_RD chip.

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