TCP Data Receive problem with W5100
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: TCP Data Receive problem with W5100
by Eugeny ·
You seem to be closing socket (without disconnect) as soon as connection is established. RST is an indication of the closed socket at W5100 side.
RE: RE: TCP Data Receive problem with W5100
by javadhabibi ·
I don’t disconnect the connection at all. It seems when the PSH flag or in some case FNS flag in my TCP packet is set as 1*, the connection closed.
RE: TCP Data Receive problem with W5100
by Eugeny ·
PSH flag received from remote device within the packet can not close socket on W5100. You close it yourself by your code/FPGA as soon as connection is established.
RE: TCP Data Receive problem with W5100
by javadhabibi ·
The device is directly connected to my laptop.
I read that PSH is push flag and means that layer 4 should push the data to layer 5. that’s not true?
I have nothing to do with Socket 0 Command Register([0x0401) to close the connection.
RE: TCP Data Receive problem with W5100
by Eugeny ·
Push flag has nothing to do with INT pin. This is true.
You must dig into your W5100 driving code. As I asid I suspect you close socket immediately when it got to established state. It is true?
RE: TCP Data Receive problem with W5100
by javadhabibi ·
I have 2 Line of code deal with 0x0401 address(S0_CR). All are set in initialize:
1- set it to 0x01 => open it
2- Set it to 0x02 => LISTEN mode
Is it false !?
RE: TCP Data Receive problem with W5100
by Eugeny ·
Looks like you follow chapter 5.2.1.1 steps (at least I hope so). Try socket status register instead of interrupt bits to see what socket status is at each point of time. It is impossible to tell you exactly what is going on because you did not provide detailed information on common and socket register settings. But there seem to be some configuration or logical mistake.
RE: TCP Data Receive problem with W5100
by irina WIZnet ·
As @Eugeny said, you have to follow chapter 5.2.1.1 step…
when connection operation occurs, Sn_SR value change from SOCK_INIT(0x13) to SOCK_ESTABLISHED(0x17).
You should check whether or not it’s Sn_IR is Sn_IR_CON(0x01).
RE: TCP Data Receive problem with W5100
by javadhabibi ·
Hi again
I developed my code one good step and now i see CON INT and RECV INT.
After receiving an interrupt, I read S0_IR(just Socket_0 interrupt is masked) and then:
1- if connection interrupt=> wait for data RECV interrupt
2- if data RECV interrupt => Data Reading procedure and then go to RE_OPEN state
3- else => go to RE_OPEN state
RE_OPEN state: close socket(send X"10" to Sn_CR) and re-open it and set the listen Mode on and wait for new INT
I cant see the last ACK from W5100 and it is probably because of I can’t understand the Disconnecting protocol. can any one explain it in the Register_level(so that i can implement it on FPGA)?
RE: TCP Data Receive problem with W5100
by Eugeny ·
What you want to achieve in overall? What task 5100 is going to perform?
Remote device is not expected to send data in more than one packet? Why you close socket as soon as something is received? See my first question - what ar you doing with W5100?
RE: TCP Data Receive problem with W5100
by javadhabibi ·
The ethernet connection is for sending command from PC to FPGA board. Every command is 6 Byte (in one PKT) and maybe send one command in an hour.