CIP Protocol on W5500
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: CIP Protocol on W5500
by Eugeny ·
To my understanding any TCP packet, by the design of the TCP protocol, is being acknowledged with ACK. And this action does not depend on higher level protocols.
CIP is located at layers 5-7, above TCP, the ACK response you are talking about is at the layer 4 (TCP).
RE: CIP Protocol on W5500
by Vien Huy Nguyen ·
Maybe I will just send back the response after the ACK.
Also, what is the proper method to read the receive buffer? This is what I have right now:
uint8_t* readBuf;
if (getSn_RX_RSR(2))
{
uint16_t length = getSn_RX_RSR(2);
wiz_recv_data(2, readBuf, length);
for(int i =0; i <length; i ++)
{
printf(“%d-”,readBuf);
readBuf++;
}
}
The output printed on the terminal doesn’t match what I see on Wireshark. Am I missing something?
RE: RE: CIP Protocol on W5500
by Eugeny ·
See W5100 datasheet chapter 4 on the low-level buffer data access method. I do not know how to properly use
wiz_recv_datasystem call from your library (if it handles circularity of the buffer or you must handle it in your application). Check the sources of library you use.RE: CIP Protocol on W5500
by Vien Huy Nguyen ·
This function is from W5500.h, there are also 2 more read functions in socket.h. I have to see how they differ and which is the right function to use.
I have another question about the registers used for receiving process. Sn_RX_RSR returns the numbers of new receiving data in bytes. Sn_RX_RD returns the address where I should start reading the buffer to get the data. So start reading from Sn_RX_RD address for Sn_RX_RSR bytes gives me the latest received data Am I understanding this correctly? How do I clear the buffer after reading it? Or will it keep adding data until the end of the memory allocated for it, then goes back to the beginning and overwrite the old data?
RE: RE: CIP Protocol on W5500
by Eugeny ·
Yes, correct, but you must do the reading within circular buffer therefore may require 2 transactions to read the data if data spans the boundary.
You do not need to. It will be rewritten by the new data.
Absolutely. In such a circular manner. Writing for sending works in very similar way, but uses different register set and different RAM space.
RE: CIP Protocol on W5500
by Vien Huy Nguyen ·
Thanks Eugeny. This does clear things up a lot.