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

PIO USB support #1412

Merged
merged 53 commits into from
May 16, 2022
Merged

PIO USB support #1412

merged 53 commits into from
May 16, 2022

Conversation

hathach
Copy link
Owner

@hathach hathach commented Mar 30, 2022

Describe the PR
Add support for pico-pio-usb, allow TinyUSB can be used with both native usb (rhport0) and pio-usb (rhport1). Currently pio-usb and native usb must be on different mode. For recommendation, native should be device and pio-usb as host, since device has an stricter timing constraint, while in host mode, rp2040 basically control all the timing.

To test this PR

  • check out this branch, and submodule lib/Pico-PIO-USB
  • compile example host/hid_to_cdc, which is configured to use native usb as cdc device, and pio usb as host to get hid input.
  • any input event e.g mouse move, button will be printed to cdc on the native usb.

requires sekigon-gonnoc/Pico-PIO-USB#22

@hathach hathach changed the title Pio host PIO USB support Apr 15, 2022
@hathach hathach marked this pull request as ready for review May 3, 2022 09:31
@hathach hathach merged commit c2bcda8 into master May 16, 2022
@hathach hathach deleted the pio-host branch May 16, 2022 09:29
@kilograham
Copy link
Collaborator

@hathach can you please back this out... this touches a bunch of the Pico SDK integrations (and does weird stuff like setting the clock unconditionally).

Perhaps we dropped the ball on reviewing this, but it needs some more work to not just pull in PIO support when the user doesn't want it.

@kilograham
Copy link
Collaborator

We can start a discussion again on the code. Particularly, the user should explicitly opt into "dual" USB, and the existing TinyUSB base INTERFACE libraries should not include it.

@kilograham
Copy link
Collaborator

actually, i just added a PR instead #1467

@hathach
Copy link
Owner Author

hathach commented May 21, 2022

We can start a discussion again on the code. Particularly, the user should explicitly opt into "dual" USB, and the existing TinyUSB base INTERFACE libraries should not include it.

Right, I agree that user need to explicitly specify the dual USBs. I am not too familiar with the way pico-sdk wrapper for tinyusb lib/target definition, but I did try to add a separated target/lib for pio_usb, and user indeed need to initialize that in addition to normal tinyusb_device/host.

actually, i just added a PR instead #1467

thanks, I am currently off for a couple of days, will review it next week.

@kilograham
Copy link
Collaborator

Right, I agree that user need to explicitly specify the dual USBs. I am not too familiar with the way pico-sdk wrapper for tinyusb lib/target definition, but I did try to add a separated target/lib for pio_usb, and user indeed need to initialize that in addition to normal tinyusb_device/host.

Yes, it was actually nice and separate, the weirdness we have with keeping things happy when doing raw TinyUSB examples (which includes pico-sdk within it's build) and SDK (which includes TinyUSB within it's build) and pico-examples which uses TinyUSB examples build as a sub-build just needed a little jiggling!

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

Successfully merging this pull request may close these issues.

2 participants