-
Notifications
You must be signed in to change notification settings - Fork 1.3k
STM32(F4) USB HID support #4752
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
Comments
USB HID (and MIDI) are theoretically available, but they are not turned on. The problem is that the USB physical interface (PHY) that is connected to the USB connector only has 4 endpoint pairs. One pair is reserved for control purposes, one pair is used for mass storage (CIRCUITPY), and two pairs (well, 1.5), are used for the CDC serial (REPL connection). So that leaves none for anything else. There is another USB PHY on the chip, a HS-capable one with more endpoints, but it is not connected to anything. It is not connected on the PyBoard either. I'm not sure why, but I think there was some reason. With dynamic USB descriptors available in CircuitPython, it would be possible to disable the REPL and enable HID. It wouldn't be that pleasant a development experience. You might consider a different board with more endpoints, such as an RP2040, a SAMD, etc. |
Is there documentation on how to disable the REPL? Or better yet, route it to the serial port so I can just hook up a separate adapter to get to it. |
This is all really, really new, and we're still getting the edges smoothed off, but we will think about enabling the possibility of HID while at the same time leaving it off at runtime by default on the STM32F4 boards. See the |
Most of the STM chips have HS peripherals but no HS PHY. They require a separate UTMI chip for the HS PHY. That's why they aren't used very often. |
@dhalbert thanks, calling The cherry on top would be access to the REPL via the dedicated serial pins, is there any way to do that? |
Although it doesn't solve the issue in CircuitPython, I think it's worth mentioning this Arduino library: https://www.onetransistor.eu/2020/03/usb-multimedia-keys-on-arduino-stm32.html This library worked with my STM32F411 using the stm32duino core, which also appears to explicitly support the F405 Express you have @Gigahawk . |
I've bought a Feather STM32F405 Express and was expecting I could get it to act as a USB keyboard, but turns out USB_HID (and quite a lot of other features) aren't implemented for STM32 chips yet.
Is there any effort being made to implement USB_HID support?
The text was updated successfully, but these errors were encountered: