-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Udp sockets corrupt the w5500 device #44
Comments
Closed
Yes, I've tested it with 2 sockets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, implementing some changes in #42 to the UDP and testing with multiple sockets at once makes me to believe that there is something wrong with the way the TX buffer (maybe even RX buffer) are used.
Pseudo code:
What ends up happening in this scenario is that the
socket_2
gets into the infinite loop that waits for aSendOk
orWriteTimeout
and never receives one.What I've managed to track so far is when I set the new
TX write pointer
and directly read it back beforeCommand::Send
, instead of having the newly set pointer it once again has0
.Another (maybe unrelated to this one issue) is that at some point (even if I comment out the socket_2 code) I started to get
WriteTimeout
from the firstsocket_1.send()
.This leads me to believe that it was left in an invalid state and flashing over and over didn't help with this issue either.
It did require a device reset (power down + up) to get it back working.
API improvement is needed
The main issues that were causing this problem were 2:
Device.connect
is not called, Udp socket is not being opened #46send
- it should at least return an error if there's no destination remote address setThe text was updated successfully, but these errors were encountered: