WIZnet Developer Forum

"Sn_TX_RD", "Sn_TX_WR" and "Sn_TX_FSR" reading problem [W5500]

Hello.
Before any question excuse me for my English. My language isn’t English.
I want to write a simple test code for W5500 with Arduino Due. W5500 works as a client and
my PC works as a server. The code saves a character in TX buffer and sends it to my PC.
My code performs the following tasks:

  • loading common registers with appropriate values
  • opening the socket0 in TCP mode
  • connecting to server
    until here all things are perfect, but when i run send command (Sn_CR=0x20), the server receives arbitrary bytes. I perform updating process of Sn_TX_WR with respect to data sheet.
    Also, according to W5500 data sheet after connecting to server in TCP
    mode, the value of Sn_TX_RD and Sn_TX_WR will be re-initialized to 0x0000.
    But when i read these registers after connect command (Sn_CR=0x04), W5500 returns arbitrary numbers for both and these values are same for these registers. Also the value of Sn_TX_FSR
    reads as 0X0800 which is correct.
    When i read these registers after send command (Sn_CR=0x20), W5500 returns 0x0000 for
    Sn_TX_WR and Sn_TX_RD and an arbitrary number for Sn_TX_FRS.
    I don’t know where is the problem. Can anyone help me???
    Thanks in advance.

What software is acting as a server on your PC, and how do you know the problem isn’t there?

The problem solved!
A little mistake in writing to tx buffer.
But i wondering why W5500 returns an arbitrary numbers for Sn_TX_RD and Sn_Tx_WR registers after connecting to server?
Server software on pc is a simple c code downloaded from internet and has been tested.
Thanks for your reply.

These shoud be an arbitray number because TCP packet have sequence number and it can be hacked if the number is exposed easy to see.

Thank you.

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