-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
W5500-EVB-PICO - Unexplained TCP & UDP Transfer Speed Delays and Variations...Very Slow #15645
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
Comments
There were a lot of speed tests done during the original development for this board, though more to do with TCP throughout than latency. Would you be able to try re-running some of the tests described in #8540 (comment) it would be helpful to know if the support has regressed since then, or if your use case wasn't tested originally? Separately, I'm not sure if it still works this way but I think if you change the LWIP setting to 0 in https://github.com/andrewleech/micropython/blob/6f27e1c9681de46e0c6ef859dd8be4fc6fd7cf1d/ports/rp2/boards/W5100S_EVB_PICO/mpconfigboard.cmake#L4 it'll build in the mode where it uses the external stack on the chip rather than LWIP software stack in micropython. The chip stack was often quicker, but has less features. |
If you are explicitly constructing the Without an interrupt pin there is a 64ms latency between polls of the Wiznet, see // Poll lwIP every 64ms by default
#define LWIP_TICK_RATE_MS 64 (If you construct the Wiznet without any arguments then it uses default SPI and pins and enables the interrupt pin.) |
Hmmm, it looks like we need to document the interrupt pin in the |
That was it!
Added the INT pin as specified by the W5500-EVB-PICO pinout, now I'm seeing 6-10ms round trips (still a little slower than than the wiznet build or PC to PC, but much more reasonable). Yes, please add that to the docs, I'm not sure I would have found it otherwise. Thank you guys for the quick support, hopefully this helps someone else in the future |
Yes, documenting the I just added the I used the following initialisation code to hopefully remain compatible with any potential non-LWIP firmware build:
Q: Is there any better way at runtime to detect if LWIP is enabled? |
Yeah just want to follow up on this, if this could be documented (it looks like it hasn’t been updated), I think this would be super useful for both those using the W550-EVB-Pico, or even just the w5500 chip. I spent quite a bit of time searching into this (weeks) before I was able to figure it out. |
@BB486999 in case you haven't already seen it, have a look at #13718 - I now include the following early in my initialisation code to ensure the SPI is running at full speed otherwise the baudrate can be limited to 24MHz due to the PERI clock running at only 48MHz:
The above code should ensure the CPU and PERI clocks are always both set to 125MHz on an RP2040... in theory it would be 250MHz on an RP2350 (I think...) |
Another potential cause for intermittent speed / dropout issues has been found and addressed in #16664 |
Port, board and/or hardware
W5500-EVB-PICO
MicroPython version
MicroPython v1.23.0 on 2024-06-02; W5500-EVB-Pico with RP2040
Reproduction
Master Code running on a PC:
Slave Code on the W5500-EVB-PICO
And corresponding w5500 library for reference:
When running the following code (round trip UDP messages, one down to slave, one back up to master) with MicroPython official release 1.23.0, I get about 65 ms round trip per message.
When running with WizNet's own v2.0.0 release on their website (https://github.com/Wiznet/RP2040-HAT-MicroPython/releases), I am looking at around 2-5ms per message. Note that this is roughly in the same range if I ran the master and slave code on two separate PCs with the same setup (2-5 ms per message).
I don't want to have to use the WizNet micropython build because it is incredibly unstable (print statements are delayed, misses keyboard interrupts when stopping, lacking many features/functions, etc.), but I really need the speed for my application. Why is the MicroPython build so much slower, is this a bug that can be addressed? Thanks
Expected behaviour
Micropython Official 1.23.0 build UDP back and forth: ~ 65 ms
WizNet v2.0.0 Micropython build UDP back and forth: ~ 2-5 ms
PC to PC UDP back and forth: ~ 2 ms
Expected is micropython official build to be ~ 2-5 ms
Observed behaviour
Micropython build is significantly slower sending UDP messages (tens of milliseconds slower) than using WizNet's v2.0.0 build or compared to PC to PC UDP messaging.
PC to PC: ~2 ms
PC to Wiznet v2.0.0 micropython w5500-EVB-PICO: ~2-5 ms
PC to Micropython v1.23.0 build W5500-EVB-PICO: ~65 ms +
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
The text was updated successfully, but these errors were encountered: