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

🪲[BUG] host code (or at least sample) should assert bus reset #143

Open
shuffle2 opened this issue Sep 20, 2024 · 3 comments
Open

🪲[BUG] host code (or at least sample) should assert bus reset #143

shuffle2 opened this issue Sep 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@shuffle2
Copy link

Describe the bug you encountered:

I'm new user of pico-pio-usb, so I started with usb host example code. I was confused because I wasn't seeing the device respond to host packets at all. Eventually I realized that bus reset was required.

What did you expect to happen instead?

Example code to work.

What actually happened in your case?

host example code appeared to not work for unknown reason.

Additional information

Following code should be put somewhere.

pio_usb_host_port_reset_start(0);
// 10ms by spec. Note e.g. Windows uses ~15ms
sleep_ms(10);
pio_usb_host_port_reset_end(0);
@shuffle2 shuffle2 added the bug Something isn't working label Sep 20, 2024
@sweetlilmre
Copy link

sweetlilmre commented Oct 8, 2024

@shuffle2 I've followed your comments from #122 I'm going to give this a try and see if it helps in my use-case.
Do you have any example you can share where you have host support working and can you give some detail on what device you have connected and your configuration?
I'll be basing my tests on the host_hid_to_device_cdc project, now that the others have been deprecated in main.

@sweetlilmre
Copy link

sweetlilmre commented Oct 9, 2024

I finally had time to have a look. Using the host_hid_to_device_cdc project, my device (PS3 controller) enumerates.

This is without using your bus reset code example (the device also works when adding the bus reset code).

With the deprecation of the Pico-PIO-USB host stack (528616d) I'm assuming my issue was related to that and using TinyUSB as the host stack sorts that out. I do have some weird issues with quickly disconnecting and reconnecting the device, seem to have to wait around 3-5s between reconnects for it to be successfully recognised again (I think I saw an issue on this somewhere).

HTH

-(e)

@sweetlilmre
Copy link

@shuffle2 further testing:

  multicore_launch_core1(core1_main);
  
  pio_usb_host_port_reset_start(0);
  // 10ms by spec. Note e.g. Windows uses ~15ms
  sleep_ms(10);
  pio_usb_host_port_reset_end(0);

Adding your reset example as above seems to make disconnect / reconnect more reliable, though not totally so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants