W5300 Sn_RX_RSR doesn't match Packet-info in indirect mode


I’ve been using the W5300 in 16-bit direct mode for the past several years have decided to try switching to indirect mode to reduce pin count, but as soon as I switch over, I noticed that Sn_RX_RSR reports a different value in 16-bit indirect mode.

In direct mode, both values would be the same, but in indirect mode, the Sn_RX_RSR value is rounded up if it is an odd number and includes the size of packet-info. Ex in direct mode, both packet-info and Sn_RX_RSR reads 9, but in indirect mode, Sn_RX_RSR would read 12 while packet-info reads 9. Has anybody else seen such behavior?



Sn_RX_RSR should not be equal to PACKET_INFO. The reason is as the below.
when PACKET_INFO = the real data size and PACKET_IFNO size is the length of PACKET_INFO header.
cf> PACKET_INFO should have the even length always.
PACKET_INFO size depends on the socket mode as TCP,UDP,IP and MAC.

I rather doubt why the two are equal in direct mode.
But, If you used in TCP with ALIGN mode (Sn_MR(ALIGN) = 1), it is possible becase no PACKET_INFO header add to the SOCEKT buffer.
Anyway, you doesn’t seem to use as TCP ALIGN mode if i guess your question.

Here, If data size is 9 in TCP mode with no ALIGN, Sn_RX_RSR is equal to 12 ( = 2(PACKET_INFO header) + 9(real data) + 1(dummy data) ).

For more detail, refer to Sn_RX_RSR & Sn_RX_FIFOR in W5500 datasheet.

Thank you.