Skip to content

Conversation

@ArcaneNibble
Copy link
Collaborator

This is batch 1 of reimplementing the EV3 USB support using a bespoke USB stack.

It currently provides only standard USB descriptors. When data is sent to the EP1 OUT endpoint, it will be echoed back (with the value 1 added to each byte) on EP1 IN.

The next steps will involve refactoring out some of the shared WebUSB/Microsoft descriptor creation code as well as hooking this up to existing command handlers.

Copy link
Member

@dlech dlech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty dense so I had to give up about half way through, but here a few comments anyway.

@ArcaneNibble ArcaneNibble force-pushed the usb branch 3 times, most recently from 441fb06 to fa15ccb Compare July 19, 2025 11:47
@ArcaneNibble
Copy link
Collaborator Author

Rebased this to be totally up to date with the latest merges. Also uses pbdrv_compiler_memory_barrier now.

@dlech dlech mentioned this pull request Jul 21, 2025
@ArcaneNibble ArcaneNibble force-pushed the usb branch 6 times, most recently from 8557289 to bbc7de3 Compare July 22, 2025 22:19
@ArcaneNibble
Copy link
Collaborator Author

I've just implemented all the requested changes.

Copy link
Member

@dlech dlech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some work on USB in the meantime, so I found a few more details that I missed before with better trained eyes.

And it would be nice if we could make the commit messages a bit more descriptive for our future selves.

Otherwise, this looks good to go.

The TI CDC-ACM serial port is to be replaced by the custom Pybricks protocol.
For now, delete all of the existing code and stub out necessary functions.
Delete this library so that we do not accidentally use it.
It is not license-compatible with the GPL.
These are the most basic steps needed for a USB peripheral to be detected.
After this commit, hosts will notice a USB device, but the device will
not function because none of the required USB requests are handled.
These data types are defined in Chapter 9 of the USB standard
and consistute the "USB Device Framework".
After this commit, the brick will be able to enumerate as a USB device.
There is no data transfer implemented, but requests mandated by the USB
standard are implemented so that the device is fully detected.
This currently implements an echo test rather than hooking up command handlers.
This scaffolding is required before implementing the Pybricks protocol.
@ArcaneNibble
Copy link
Collaborator Author

Done!

@dlech dlech merged commit f66b96d into pybricks:master Jul 23, 2025
16 checks passed
@dlech
Copy link
Member

dlech commented Jul 23, 2025

OK! Let's call it good enough and move on to the next one.

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.

3 participants