Hello,
the Wiznet 5500 datasheet does not state how the Sn_RX_RSR register behaves in case of overrun. To explain my understanding problem, let’s look into an example:
Suppose we are working with socket 0 in TCP mode, and we have configured a receive buffer size of 2K (2048 bytes). Now we are going into the listen state; the S0_RX_RSR will be 0 immediately after doing this.
Now suppose the w5500 receives 2047 bytes at socket 0, but we do not read those bytes. After having received that data, S0_RX_RSR will be 2047.
Now suppose the w5500 receives one more byte. How does S0_RX_RSR behave then? Does it take the value 2048, or does it already wrap around and take the value 0? (Note: I am quite sure that it does take the value 2048 since this is the only thing which makes sense, but I’d like to have this confirmed by somebody who knows for sure).
Finally, the most important questions:
Suppose the w5500 again receives one more byte. How does it behave then?
-
Does S0_RX_RSR keep its current value, i.e. does it keep the value 2048, or does it wrap around, i.e. does it take the value 0? In other words, is S0_RX_RSR a wrap-around-register, or is it a saturated register?
-
Does the w5500 overwrite old data in case of overrun, i.e. if it has received as many bytes as fit into the buffer, and if it receives one more byte, does it overwrite the “oldest” byte in the ring buffer, or does it just ignore the newly received byte?
Thank you very much in advance for any clarification!