Enhance USB support for RP2 port #11283
-
I'd like to have a go on improving the USB support on the Intermediate milestones could be:
I started doing some stuff, managed to have multiple CDC interfaces visible on USB. But now it's time to decide on the setup of the API bindings, specifically how the module should be named, etc. Maybe other things that needs considerations? I thought I'd drop this here so that I can align early on the work. Or perhaps somebody else is already doing similar things 😄 Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
@projectgus has been working on similar USB improvements for some time now - it'd be great if you could help test and provide feedback! See his work in #9497 and micropython-lib#558. |
Beta Was this translation helpful? Give feedback.
-
Hi @hoihu! Yes, the long term goal is very much to allow the kinds of thing you've mentioned and to (eventually) have them in a cross-port API, although rp2 is where it's starting. The basic building blocks are in place in those PRs but I've been stalled on this for a while due to other commitments. As Matt says - testing, feedback, or working on some of the driver implementations or integrations would be amazing! Let me know what you think. The class driver work I've done so far has been basic HID, and then implementing MIDI as it looked simple (turns out MIDI is really not, haha!) But a CDC class driver (in Python) is planned as well, if that's of interest. |
Beta Was this translation helpful? Give feedback.
-
sorry for the delayed reply, @mattytrentini thanks for the pointer! @projectgus I saw your project and it's very interesting. I definitely want to try it out. Amazing to think that all the descriptor stuff and callbacks can be supplied via python - I guess that opens up a whole new level in USB configurability (without recompiling, C code fumbling etc). It's also much better for debugging I presume.. Looks very clean and well documented. Might be also an option for other platforms too. Maybe handling USB low level in python has some performance impacts? But it could well be that this doesn't matter much for a lot of USB devices. As for collaboration I'm willing, but can't promise anything since I'm (as you..) also busy with other staff. I'm on macOS so any testing would be around that platform. Still I want to try it out! My next steps are to use your PR and make the example work, then continue with adding a new CDC interface (hopefully) |
Beta Was this translation helpful? Give feedback.
-
Noted that there is support for USB Host in the official RP2040 repo. Any plans to link this up with micropython? |
Beta Was this translation helpful? Give feedback.
Hi @hoihu!
Yes, the long term goal is very much to allow the kinds of thing you've mentioned and to (eventually) have them in a cross-port API, although rp2 is where it's starting.
The basic building blocks are in place in those PRs but I've been stalled on this for a while due to other commitments. As Matt says - testing, feedback, or working on some of the driver implementations or integrations would be amazing! Let me know what you think.
The class driver work I've done so far has been basic HID, and then implementing MIDI as it looked simple (turns out MIDI is really not, haha!) But a CDC class driver (in Python) is planned as well, if that's of interest.