-
Notifications
You must be signed in to change notification settings - Fork 14
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
UDP Binding stuck in infinite loop #280
Comments
Hmm. A quick fix would be to rebind in the loop, but this shouldn't occur in the first place. Are you able to try out the code here? If it is intermittent it could be the chip missing the chip-select: #252 (comment) |
Oh, that's really odd, that seems to be working :O Edit: Fyi, that specifically works when I have spi_cs.set_high().unwrap();
w5500_hl::ll::eh0::reset(&mut w5500_reset, &mut delay).unwrap(); when I set the SPI |
:/ Your chip probably has a fast clock speed and the default HAL implementation doesn't assert chip select low for long enough. I haven't merged that "fix" yet because I don't have a good solution for embedded-hal 1.0 yet. |
Interesting find. Do you know if that will cause a problem with networking as well? |
We've only seen it in these two locations so far, but it will cause problems with any accesses over the SPI bus given enough time. |
I'm experiencing something similar.
This
hangs yielding
Is there any chance to get this working? |
it is "fixed" (read: worked around) for EH0 on the main branch. I have been meaning to make a release, I'll do that today. For EH1 there's no control for me, so it's up to the HAL authors to keep CS high long enough to meet the hold times. The W5500 base trait can also just be implemented directly if changing the HAL isn't easy. |
Thanks I'm pasting updated snippet.
It is still stuck, should it work? |
Yeah, that should work. I have been running a DHCP client device for a little over a year now without issues. What is the system frequency and SPI bus frequency of your device? |
Describe the Problem
I'm building an application with the w5500-evb-pico. Upon setting up the SPI and initializing the registers, I used the
Udp::udp_bind
call to bind Sn0 to some port. However, this often blocks forever (or until the watchdog resets the chip). I've narrowed it down toin
udp_bind
being the problematic loop and the reason is that the SocketStatus is Closed for some reason. This happens more often than not and I'm not sure what the issue may be here. I've tried with 2 different wiznets and both experience the same problem.Expected Behaviour
udp_bind
doesn't block.Steps to Reproduce
Setup a w5500-evb-pico, connected over ethernet to a computer. Initialize the w5500 eh0 vdm
I can share some source code as well but it's not much different from what's here: https://github.com/newAM/w5500-issue-252/blob/main/src/main.rs, but I can try running that specifically to see if I have the same issue on that source.
The text was updated successfully, but these errors were encountered: