Corrupt or incomplete UDP packets with W5500
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: Corrupt or incomplete UDP packets with W5500
by barak ·
Running wireshark for a few minutes showed exactly the same packet size being send repeatedly:
217 0.267572 192.168.2.30 192.168.2.255 DMX Channels 572 ArtDMX (0x5000)
length is always correct at 572 and it’s the only packet sent on this interface, which eliminates any extraneous reasons for data being off when parsed.
Another look at the logs reveals a potential source for this issue, notice the changing numbers logged in available data, current RX pointer and parsed UDP packet size:
The first few reads return available numbers that are all divisible by 538, and result in correct packet parsing - 8 bytes of header and a parsed payload size of 530. Packets are parsed one at a time so you’d expect numbers to increment slowly by 8 and 530 on the pointer, and decrease as slowly on the available side.
However, timestamp 12958 reveals a wrong available data value returned, 416, despite the code correctly reading only 530 bytes in the line before, the available data dropped from 6456 to 416, and corrupted packets follow - payloads of 769, 0 3601, resulting in flush since it catches that the wrong value finally exceeds the max packet size.
The available value is returned following the ioLibrary:
and increment using similar logic to the library adjusted for 8K buffers, which works most of the time when there is less data throughput so I imagine the logic is sound.