Skip to content
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

Pico W hangs after upgrading SDK from v2.0.0 to v2.1.0 #2192

Closed
Slion opened this issue Jan 18, 2025 · 13 comments
Closed

Pico W hangs after upgrading SDK from v2.0.0 to v2.1.0 #2192

Slion opened this issue Jan 18, 2025 · 13 comments
Assignees

Comments

@Slion
Copy link

Slion commented Jan 18, 2025

On Pico W RP2040.
I have an app using btstack in poll mode, tinyusb and lwip.
I was hoping to switch from Pico W to Pico 2 W but SDK v2.1.0 introduced some bug.
With the watchdog it keeps rebooting a few seconds after restart.
After disabling the watchdog it hangs and those logs are trickling in:

[CYW43] do_ioctl(2, 263, 16): timeout
got unexpected packet 0
[CYW43] do_ioctl(0, 262, 9): timeout
Ignoring packet with wrong id 9 != 10
[CYW43] do_ioctl(0, 262, 9): timeout
Ignoring packet with wrong id 11 != 12

or

[CYW43] do_ioctl(0, 262, 9): timeout
got unexpected packet 0
[CYW43] do_ioctl(0, 262, 9): timeout
got unexpected packet 0
[CYW43] do_ioctl(0, 262, 9): timeout
got unexpected packet 0
[CYW43] do_ioctl(0, 262, 9): timeout
got unexpected packet 0
[CYW43] do_ioctl(0, 262, 9): timeout
got unexpected packet 0
[CYW43] do_ioctl(0, 262, 9): timeout
got unexpected packet 0

I tried various combinations of tinyusb and other sub-modules without joy.
Also tried both cyw43-driver from 2.0.0 and 2.1.0 .
Notably tried tinyusb v0.18.0 as mentioned in #2170.
I looks like the issue lies with changes to the SDK itself.

Upgrade from SDK v1.5.0.to v2.0.0 was a breeze in comparison.
I guess I'll put back my shiny RP2350s in the drawer, keep on working with RP2040 and wait out the storm, hoping v2.2.0 brings clearer skies.

@Slion Slion changed the title Board hangs after upgrading SDK from v2.0.0 to v2.1.0 Pico W hangs after upgrading SDK from v2.0.0 to v2.1.0 Jan 18, 2025
@peterharperuk
Copy link
Contributor

@Slion could you try the develop branch? Is there any way we can reproduce the problem you're having?

@Slion
Copy link
Author

Slion commented Jan 18, 2025

I sure could try the develop branch at some point.
I'm afraid it's a closed source project using multiple USB configurations and Bluetooth, no WiFi. Not sure when I'll have the time to try reproduce the issue outside the project.

Not sure what could be causing this. Could it be because both USB and CYW43 are busy at the same time?

@peterharperuk
Copy link
Contributor

Are you using freertos?
If not, which async method? Poll or background thread?
Which btstack example would be closest to your app?
Do you have the same problem with rp2040 in the latest sdk?

@Slion
Copy link
Author

Slion commented Jan 19, 2025

Are you using freertos?
If not, which async method? Poll or background thread?

I've edited the first post last night to mention I'm using poll mode.
I used background thread mode on that project for the longest time but ran into issues with it once I started using pico-vfs.

@Slion
Copy link
Author

Slion commented Jan 19, 2025

Do you have the same problem with rp2040 in the latest sdk?

That issue is with rp2040 Pico W on SDK 2.1.0.
No issue with rp2040 Pico W on SDK 2.0.0.

@Slion
Copy link
Author

Slion commented Jan 19, 2025

Which btstack example would be closest to your app?

HID host. Actually last night when trying the HOG host example I may have gotten a couple of freeze too. No logs though. But the logs mentioned in the first post sometimes only show up after a minute or so.

@peterharperuk
Copy link
Contributor

Ok, thanks. It might be related to #2186
I'll have to check what we did to change polling timing in the last release

@Slion
Copy link
Author

Slion commented Jan 19, 2025

Looking at #2190 it seems you guys are still working out a proper fix for this issue, right?

@Slion
Copy link
Author

Slion commented Jan 19, 2025

If it's a polling issue you might be able to reproduce it using the HID host example and adding a high speed timer that blinks the LED, something like that:

btstack_run_loop_set_timer_handler(&hid_timer, &hid_timer_callback);
btstack_run_loop_set_timer(&hid_timer, 1);
btstack_run_loop_add_timer(&hid_timer);

Maybe only blink every 250ms by checking the elapsed time in the callback.

@peterharperuk
Copy link
Contributor

Yes I still have some work to do on that issue. However if it's not too much trouble it would help a lot if you could tell us if the changes in that pr stops the problem happening.

@peterharperuk
Copy link
Contributor

@Slion Thanks for the HID host suggestion. I could reproduce the messages you were seeing and it does look like the same issue. I'll mark this as a duplicate of #2186 if you don't mind.

@Slion
Copy link
Author

Slion commented Jan 20, 2025

@peterharperuk Glad you could reproduce it. I'm assuming you don't need me to test your fix with any urgency then.

Did you need to add the timer and LED blinking to the HID host example to reproduce it? Did you need to connect a Bluetooth device? Could you post the changes you made to the HID host example?

@peterharperuk
Copy link
Contributor

I'm assuming you don't need me to test your fix with any urgency then.

Correct.

Could you post the changes you made to the HID host example?

See the attached.

0001-Test-for-Issue-2192.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants