pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Pico-W to Pico-W STALL while sending UDP

Open marcos-diaz opened this issue 1 year ago • 1 comments

Steps to reproduce:

  • In the host Pico-W load Pico-W AP example.
  • In the second Pico-W load Pico-W UDP beacon example.
  • Run both Picos and make them connect to each other.
    • In the AP code change ap_name and ap_password.
    • Pass WIFI_SSID and WIFI_PASSWORD while compiling to match these.
  • For more chances of this bug appearing faster, decrease BEACON_INTERVAL_MS to 100 or even 10.

Expected results:

  • UDP packets keep being sent (and ignored), for as long as the Picos are running.

Actual results:

  • UDP packets are sent for a few seconds.
  • Eventually (at what seems to be completely random time), the sender Pico will start throwing errors such as:
STALL(0;45-45): timeout
[CYW43] send_ethernet failed: -1
Failed to send UDP packet! error=-12
  • The CYW43 becomes increasely unresponsive, until it completely stall, and never recovers.

Special notes:

  • Funny enough it seems these Picos do their work perfectly when connected to other 3rd-parties:
    • Pico-W as AP can receive a lot of small UDP packets/second from a Python script without issues.
    • Also Pico-W as a sender can send a lot of small UDP packets to a Python AP.
    • But when mutually connected they do not like each other.

marcos-diaz avatar Mar 07 '24 14:03 marcos-diaz

Findings in other thread: cyw43-driver #111

marcos-diaz avatar Apr 08 '24 12:04 marcos-diaz

I have the devices a couple of meters apart and I can't seem to reproduce this problem. I've seen the occasional failure but it recovers and continues ok. I have the beacon interval set to 10ms. Are you in a particularly noisy wifi environment? I've tried using different channels and it seems ok.

peterharperuk avatar Nov 06 '24 15:11 peterharperuk

I see similar errors when using MQTT client with SDK 2.0.0.

[CYW43] STALL(0;166-166): timeout
[CYW43] send_ethernet failed: -2
[CYW43] STALL(0;166-166): timeout
[CYW43] STALL(0;166-166): timeout
[CYW43] STALL(0;166-166): timeout
[CYW43] STALL(0;166-166): timeout
[CYW43] STALL(0;166-166): timeout
[CYW43] STALL(0;166-166): timeout

Everything can run smoothly weeks/months and then suddenly CYW43 stops working (and I see above messages on serial console).

What I noticed that toggling the LED (every second or so) using cyw43_arch_gpio_put() would trigger the problem much more frequently. So perhaps changing the beacon to toggle the onboard LED would trigger the issue much more frequently...

(https://forums.raspberrypi.com/viewtopic.php?p=2251261#p2251261)

tjko avatar Nov 27 '24 02:11 tjko

Any news on this item?

@tjko Interesting to read about the led, I have been pulling that every 1 second, myself. Do you have any new findings? My device seems to keep working as I have been outputting serial data... But the led stops blinking..

rvt avatar Aug 29 '25 20:08 rvt

@rvt, disabling power management seemed to help as a workaround for me. I haven't encountered this issue since adding following:

cyw43_wifi_pm(&cyw43_state, CYW43_NONE_PM);

tjko avatar Aug 29 '25 20:08 tjko

Interesting,

I was using cyw43_wifi_pm(&cyw43_state, cyw43_pm_value(CYW43_NO_POWERSAVE_MODE, 20, 1, 1, 1));

I will try just cyw43_wifi_pm(&cyw43_state, CYW43_NONE_PM); and see what happens...

Note: CYW43_NONE_PM expands to cyw43_pm_value(CYW43_NO_POWERSAVE_MODE, 10, 0, 0, 0) 🤔

rvt avatar Aug 30 '25 08:08 rvt