Data Sheet

© Copyright 2013 WIZnet Co.,Ltd. All rights reserved.
69
iEthernet
W5200
src_ptr = gSn_RX_BASE + src_mask; // src_ptr is physical start address
/* get the received size */
len = get_Byte_Size_Of_Data_packet // get Byte size of DATA packet from Packet-INFO
/* if overflow SOCKET RX memory */
If((src_mask + len) > (gSn_RX_MASK + 1))
{
/* copy upper_size bytes of get_start_address to destination_address */
upper_size = (gSn_RX_MASK + 1) – src_mask;
memcpy(src_ptr, dst_addr, upper_size);
/* update destination_address */
dst_addr += upper_size;
/* copy left_size bytes of gSn_RX_BASE to destination_address */
left_size = len – upper_size;
memcpy(src_ptr, dst_addr, left_size);
}
else
{
/* copy len bytes of src_ptr to destination_address */
memcpy(src_ptr, dst_addr, len);
}
/* increase Sn_RX_RD as length of len */
Sn_RX_RD += len;
/* extract 4 bytes CRC from internal RX memory and then ignore it */
memcpy(src_ptr, dst_addr, len);
/* set RECV command */
Sn_CR = RECV;
}
<Notice>
If the free size of the internal RX memory is smaller than the MACRAW data, a problem may
occasionally occur where some parts of that PACKET-INFO and DATA packet are stored to
the internal RX memory. Since the problem occurs as an analysis error for PACKET-INFO, it
cannot process the MACRAW data correctly. The closer the internal RX memory is to being
full, the higher the probability is for an error to occur. This problem can be resolved if user
allows some loss of the MACRAW data.
The solution is as follows:
▪ Process the internal RX memory as fast as possible to prevent that it closes to full.
Reduce the receiving load by reception only its MACRAW data by setting the MF (MAC Filter)
bit of S0_MR in sample code of SOCKET initialization.