---
title: "Sn_RX_FIFOR problem"
url: "https://maker.wiznet.io/forum/10314"
markdown_url: "https://maker.wiznet.io/forum/10314/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "gbit"
created: "2014-06-17T14:09:18+09:00"
last_activity: "2017-05-04T08:33:12+09:00"
language: "en"
views: 709
replies: 3
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Sn_RX_FIFOR problem

## Question

Asked by gbit on 2014-06-17 in Ethernet Chips.

Hi,
W5300 configured as TCP server
When the W5300 receive more of 16383 byte the S0_RX_FIFOR refer to TX memory space:
Why the S0_RX_FIFOR is not automatically reset?
Is possible reset the S0_RX_FIFOR manually?
This is the receive code:

u32 lanRecv(u8 *buf, u32 len)
{
u16 pack_size=0;

if(LAN_SCKT_MR_REG & S0_MR_ALIGN)
{
lanReadBuf(buf, (u32)len);
setS0_CR(S0_CR_RECV);
return len;
}

lanReadBuf((u8 *)&pack_size,2); // extract the PACKET-INFO(DATA packet length)
if( LAN_MR_REG & MR_FS )
pack_size = ((((pack_size &lt;&lt; 8 ) & 0xFF00)) | ((pack_size >> 8)& 0x00FF));

lanReadBuf(buf, (u32)pack_size); // copy data
setS0_CR(S0_CR_RECV); // recv

return (u32)pack_size;
}

u32 lanReadBuf(u8 *buf, u32 len)
{
u32 idx;
for (idx = 0; idx &lt; len; idx+=2)
*((u16 *)(buf+idx)) = LAN_SCKT_RX_FIFO_REG;
return len;
}

Best Regards

## Replies

### Reply 1 by gbit, 2014-06-18

Hi,
I have set the RMS01R=0x4000 (64KB), the TMSR=0x4000 (64KB) and the MTYPER=0x00FF, is it correct?

As I told you before I have set the Socket 0 RX memory size register to 64KB but after 16KB the S0_RX_FIFOR return the first TX data sent. It seems that MTYPER is not correctly configured, but it is set with the first 8 blocks as TX memory (8*8KB=64KB)and the last 8 blocks as RX memory (8*8KB=64KB).

What is the mistake?

### Reply 2 by gbit, 2014-06-18

Yes, I want to use only one socket(S0) with 64KB Tx and RX memory length…
Maybe the problem is that I have set only the RMS01R?

### Reply 3 by gbit, 2014-06-18

Ok, that was the problem.
Thanks a lot.

Best Regards.

---

Source: https://maker.wiznet.io/forum/10314
