RX Buffer Read Address offset error
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: RX Buffer Read Address offset error
by Hamish ·
Hmmm. Stranger still.
If a UDP datagram with an even number of octets is received, then I’m always subtracting 1 from the real address to access the correct RX buffer data. With UDP datagrams with an odd number of Octest, the -1 offset is only applied alternately to read the correct data from the socket RX buffer.
Now looking to see if I can work the correct offset out from the RX Write pointer less the RX buffer size.
Will update again with anything new learned.
RE: RE: RX Buffer Read Address offset error
by dkay ·
There are not enough information about c function like _WIZ_GoTo(), NET_Accept, etc.
But, I guess this part occurs problem.
if(RecOS > 0x07FF){ // Time to circulate buffer
RecOS = 0; // Restart
_WIZ_GoTo(BufRX); //
//
}//End If //
if you set the socket# rx memory size to 2KB, you should not read data over 2KB.
And RecOS has 16-bit data. It can not be limited to less than 0x800.
Therefore, you should not set the rx memory address to the base address (BufRX) even if RecOS is greater than 0x0800.
WIZnet supports a example code at the below site.
https://wizwiki.net/wiki/doku.php?id=products:w5100s:driver_temp
We can support you easier, when you use our example code(ioLibrary_Driver).
If the problem will not be solved, we need more information about your source code.
I hope your problem will be solved. If not, please leave reply.
thanks.
RE: RX Buffer Read Address offset error
by Hamish ·
The NET_Accpet is the datagram processing function.
This I am aware of, however, I have not yet managed to receive much beyond 1K without hitting issues.
I have looked at this Atmel code. My implimentation uses a Microchip PIC18…
Since my last post, I have identified more strange things, when updating socket RX_RD pointer, reading back the value does not allways return the value written, and in some cases when it was previously something like 32, it may then read zero.
In relation to this, reading the socket buffer size may then also still be at the value is was prior to the read causing a continual read loop. Sending another datagarm to the WIZchip will then clear / change this value,
so I am not inclined to believe that there is an issue with reading the register.
For any one interested, I have also determined that reading one more octet from a socket RX buffer than reported by the socket RX_SZ register will override any value written to the RX buffer Read pointer and then report an RX_SZ buffer read size of 2047 bytes/octets. That is not explained in the manual…
RE: RX Buffer Read Address offset error
by Hamish ·
Hi all.
I have discovered something that may be useful to others, related to my last post.
If, when reading in a datagram from the RX buffer, data should then be written to the TX buffer in response,
be aware that moving the last read/write address pointer before completeing the RX cycle and calling RECV
may break setting the RX_RD socket pointer write. This in turn has the effect of not resetting the socket RX Size register, giving the impression that a new datagram has been received.
My advice, therefor, is to to ensure mutual exclusion of receive and send routines.
This point about reading the entire content of the RX buffer and then setting the RX_RD offset pointer
without interleave could be explained in the user manual or errata, if there be such a thing…