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

Separate usb2 usb3 stacks #9

Merged
merged 7 commits into from
Feb 22, 2024
Merged

Separate usb2 usb3 stacks #9

merged 7 commits into from
Feb 22, 2024

Conversation

kauwua
Copy link
Collaborator

@kauwua kauwua commented Jan 26, 2024

Support separate USB2/USB3 stacks : by default, both are set to use usb_device_0 so the user does not need to be concerned with this. But if the user wants to, the variables usb2_backend_current_usb_device and usb3_backend_current_usb_device can be modified to point to usb_device_0 and usb_device_1 (or another device struct).

You need the Hydradancer board for that (HydraUSB3 board with a USB3 port without USB2 downgrade, as the USB2 downgrade is used as a separate USB connection).

All examples have been tested for regressions with the new Hydradancer board and the previous HydraUSB3 boards, and a new example test_firmware_usb_loopback_separate_usb_stacks has been added to test the separate stacks by creating two loopback devices on the same WCH569 chip. The script test_loopback.py has been updated to select a device by adding --num_device to run the test in parallel for both devices.

usb_device_0 and usb_device_1 are predefined with default values so that the user does not have to set all endpoint handlers, even for endpoints that are not used (which isn't intuitive). I've also thought about letting the user define the devices and only give the pointer, but i'm leaving this for now.

@kauwua kauwua merged commit f2a89d5 into main Feb 22, 2024
4 checks passed
@kauwua kauwua deleted the separate_usb2_usb3_stacks branch April 17, 2024 15:54
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.

1 participant