Bytes missed when reading RX FIFO from W5300
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: Bytes missed when reading RX FIFO from W5300
by Eugeny ·
I assume you have checked that expected FA 18 actually come in the packets from the network.
I see you deactivate CS slightly later than RD. Try activating and deactivating them together at the same time, if it is possible by your design.
RE: RE: Bytes missed when reading RX FIFO from W5300
by sensiwood ·
Thanks for your prompt reply Eugeny.
Yes I have confirmed that expected FA 18 appeared on the network every time (as I observed in Wireshark capture files).
Our CPU treats W5300 registers as an external memory range, so the time sequence of CS and RD becoming low/high are controlled its bus access controller. Currently as I tried, the only parameter I can tune is BUS ACCESS DELAY which will decide the low level time of both CS and RD(WR). I ever changed the low level time to the maximum value CS 480ns and RD 420ns (approx.). The interesting finding is, the position of missed bytes changes from 27/28th (FA 18) to 26/27th bytes (FF FA). Below is the screen shot from the logical analyzer.
RE: Bytes missed when reading RX FIFO from W5300
by sensiwood ·
Can somebody give a support on this issue?
After verifying more samples from the stock, we found even the chips with the same prints can produce the different performance. E.g. two chips with the same print ‘PMHN1-010 1704’, one has the byte missed issue, but the other does not have. We are still investigating our PCB and peripherals to W5300 but did find valuable clues to go forward.
So I appreciate if someone from the support team provide us some ideas that what is the potential reason for this phenomenon. Is it clock, register mis-configured, time sequence, or anything else?
The customer system test has to be suspended due to this finding. We earnestly look forward to your response. Thanks a lot!
RE: Bytes missed when reading RX FIFO from W5300
by sensiwood ·
Another interesting finding is, if we changed certain bytes value in the packet (from the 3rd party device), the byte missing phenomenon will disappear.
As described originally in this post, the test packet was
00 3F 00 6E 00 00 00 39 6E 03 36 F9 A0 9F FF D5 54 81 FF E0 07 C3 FF 11 FF 00 00 FF FA 18 FF FF F5 3F FF 24 A9 FF F9 C0 00 7F DF FF FD 00 00 00 01 AF FF BF 1F FF FA FF FF FF FF 55 5F FD B5 01 FF
If I changed FF FA to 00 00, the bytes missing phenomenon disappeared!
00 3F 00 6E 00 00 00 39 6E 03 36 F9 A0 9F FF D5 54 81 FF E0 07 C3 FF 11 FF 00 00 00 00 18 FF FF F5 3F FF 24 A9 FF F9 C0 00 7F DF FF FD 00 00 00 01 AF FF BF 1F FF FA FF FF FF FF 55 5F FD B5 01 FF
Further, I found the edge value is FE FF / FF 00. That means, if the value of this 16-bit is equal or larger than FF 00, the bytes missing phenomenon will happen; otherwise, the bytes missing phenomenon cannot observed.
We were using Modbus TCP protocol from application level to identify and test this issue. But currently we do not believe it is related to protocol because the bytes missing phenomenon was captured on the interface of data reading from W5300.
Modbus TCP protocol does not have CRC on application data level, so it cannot detect the corrupted data and just put the received bytes into local memory. For other protocols which have CRC on application data, the abnormal packet will be discarded directly without impacting the local memory of user program. And at the same time, as explained at the beginning of this message, the issue is also binary content dependent (as least it is what I observed so far), so these might be the reasons we did not detect this before.
Thanks!
RE: RE: Bytes missed when reading RX FIFO from W5300
by Eugeny ·
Does this sound similar?
RE: Bytes missed when reading RX FIFO from W5300
by sensiwood ·
Thanks for telling me this story, Eugeny.
I have forwarded it to my hardware colleague (sorry I am not) and also had a browsing.
As I understood, it seems two changes made a difference
In our system, CPU operates W5300 using memory mapping so may be different to your system. As I tried so far, it seems I cannot control RD signal separately by changing CPU control register solely.
How did you make it? In FPGA?
I appreciate if you share more details you did with FPGA codes so we will review if we can do similarly on our board.
RE: Bytes missed when reading RX FIFO from W5300
by Eugeny ·
Yes. The trick is to deactivate RD and CS together. I did deactivate RD several nanoseconds earlier, and it caused this issue. I have no explanation for this effect. But the fix worked, since then I had no single issue with data corruption.
Noise may also be a significant factor in my opinion. W5x00 are high speed high precision devices, and small spike on the input pin may be treated as legitimate change of the level causing issues in driving the chip further. As I underdstand the probability of the issues in 5V signalling environment is much higher that in native 3.3V environment.
RE: Bytes missed when reading RX FIFO from W5300
by sensiwood ·
Hi Eugeny,
Thanks for providing so valuable information. As you advised, we tried to make some flying wires on the board and secure the rising edges of RD and CS are close to each. Amazingly the phenomenon disappeared!!! I am still running the setup on my desktop but from last 60 hours or so, the performance was good which is a big difference comparing to the original schematics in the same setup.
I appreciate the story you shared and it helped us a lot!
@ Wiznet Support Team:
I also have a big concern about Wiznet chip itself that if this is eventually verified (I think Eugeny’s story has verified), the specification of W5300 has a big issue in this detail but you guys did not show up here yet to explain what is the technical reason of this phenomenon and how to fix it. It is quite frustrating.
If we have to change the schematics, it would be an enormous impact to our existing products and product compatibility performance between hardware and firmware. I appreciate if somebody stands up and confirms what we understood is correct or not.
Thanks!
RE: RE: Bytes missed when reading RX FIFO from W5300
by Eugeny ·
The cause of the issue can be simple, and not much “dependent” on the W5x00 chip itself: 5V environment, or noisy signals may cause false positive, and W5x00 treats this noise as data access. For example, RD is being deactivated before CS us deactivated, but there’s a “closing” spike in 0-5V scale down to 1V on RD line, and W5300 thinks that host reads the data, and increases the counter. That’s why these two bytes are being “eaten” from the stream. Of course WIZnet may have made some measures against this issue, but it is (a) consumes silicon considerably (I did this task for one of my devices), and (b) then there will be a probability of false negatives.
I am speculating here as I do not know definite answer
can only provide educated guess.