---
title: "W5100s Sn_RX_WR wrap issue"
url: "https://maker.wiznet.io/forum/15618"
markdown_url: "https://maker.wiznet.io/forum/15618/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Peter_Sti"
created: "2025-03-01T22:01:23+09:00"
last_activity: "2025-03-06T13:43:06+09:00"
language: "en"
views: 3
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5100s Sn_RX_WR wrap issue

## Question

Asked by Peter_Sti on 2025-03-01 in Ethernet Chips.

How to use W5100s in persistance TCPIP Mode?

The attempt to receive data in a persistant open socket (2k RX & TX size) ends as soon as the rx_wr pointer will reach the configured RX size. Expected (ring buffer) wrap arround does not happen!

A test with all relevant informations below (in half duplex communication) , does receive 4 bytes and answers by a couple of more bytes till the RX Memory has been filled as follow:

after W5100_SKT_SR_ESTABLISHED:

*ReceivedSize() socket: 0, size: 4 *
*Receive() socket: 0x0 baseaddr: 0x400 realaddr: 0x6000, rx_rd_addr: 0x0, rx_wr_addr: 0x4 W51_readBurst() rx_rd_addr: 0x4, rx_wr_addr: 0x4*
*rcv: 0x42, 0x02, 0x08, 0x09, *
*rd_buf: 4540 *
*pb : 0x1A, 0x5B, 0x08, 0x05, 0x10, 0x0B, ....*
*Send(pb) socket: 0x0 baseaddr: 0x400 *

*ReceivedSize() socket: 0, size: 4 *
*Receive() socket: 0x0 baseaddr: 0x400 realaddr: 0x6004, rx_rd_addr: 0x4, rx_wr_addr: 0x8 W51_readBurst() rx_rd_addr: 0x8, rx_wr_addr: 0x8*
*rcv: 0x42, 0x02, 0x08, 0x09, *
*rd_buf: 4540 *
*pb : 0x1A, 0x5B, 0x08, 0x05, 0x10, 0x0B, ....*
*Send(pb) socket: 0x0 baseaddr: 0x400 *

*.... (508 times)*

*ReceivedSize() socket: 0, size: 4 *
*Receive() socket: 0x0 baseaddr: 0x400 realaddr: 0x67F8, rx_rd_addr: 0x7F8, rx_wr_addr: 0x7FC W51_readBurst() rx_rd_addr: 0x7FC, rx_wr_addr: 0x7FC*
*rcv: 0x42, 0x02, 0x08, 0x09, *
*rd_buf: 4540 *
*pb : 0x1A, 0x5C, 0x08, 0x05, 0x10, 0x0B, ...*
*Send(pb) socket: 0x0 baseaddr: 0x400 *

*ReceivedSize() socket: 0, size: 4 *
*Receive() socket: 0x0 baseaddr: 0x400 realaddr: 0x67FC, **rx_rd_addr: 0x7FC, rx_wr_addr: **0x800 W51_readBurst() **rx_rd_addr: 0x0, rx_wr_addr:** 0x800***
*rcv: 0x42, 0x02, 0x08, 0x09, *
*rd_buf: 4540 *
*pb : 0x1A, 0x5C, 0x08, 0x05, 0x10, 0x0B, ... ***~ 100Byte**
*Send(pb) socket: 0x0 baseaddr: 0x400*

*ReceivedSize() socket: 0, **size: **800 ***
*Receive() socket: 0x0 baseaddr: 0x400 realaddr: 0x6000, **rx_rd_addr: 0x0, rx_wr_addr: **0x800  W51_readBurst() rx_rd_addr: 0x0, rx_wr_addr: 0x800*
*rcv: 0x42, 0x02, 0x08, 0x09, 0x42, 0x02, 0x08, 0x09, 0x42, 0x02, 0x08, 0x09, ...*** (2kByte)*** ... 0x42, 0x02, 0x08, 0x09, 0x42, 0x02, 0x08, 0x09, 0x42, 0x02, 0x08,0x09**, **0x42, 0x02, 0x08,0x00**, *

What needs to be done to wrap arround?

And there is any other issue can't be explained, the byte on rx_rd_addr: 0x7FF is incorrect.

## Replies

### Reply 1 by louis_m, 2025-03-06

hello.

Is this a situation where you can't wrap around? What's the situation where you set a 2k buffer and then get another few bytes responding?

---

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