Hi MicroPython developers,
a mid-term goal of mine is to add support to the stmhal port to act as a USB-MIDI device. This can be done in C already and there are example projects that show how to do it for the old STM32 firmware library and for libopencm3.
I am not a good C programmer though and I only started my foray into the ARM/STM32 world a little more than a year ago. I looked at how some of the simpler modules (e.g. leds) are implemented in upy and had no trouble understanding them (with the excellent hints from @dhylands on this forum). But the details of the STMCube USB driver are still a bit foggy to me. I have a basic understanding how USB communication works and I successfully used the usbmidi example projects by STM and adapted them to my needs, but currently I have no clue how they could be integrated into upy and turned into a generic usbmidi module. The STMCube package also doesn't mention support for USB-MIDI specifically, though it lists USB Audio support (which USB-MIDI builds on). Does this mean USB-MIDI is not supported by Cube directly?
Any hints on how I should go about this task? Which source code to look at, which documents to read? Would the USB_VCP class be a good model to structure the code after? What is the current situation regarding the USB VID/PID?
Chris
Adding USB-MIDI support to stmhal port?
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Adding USB-MIDI support to stmhal port?
I looked at this on a pyboard a while ago, this thread https://github.com/micropython/micropython/pull/955 suggests you should be able to set up usb as a midi hid device in pure micropython.
But the pyb functions described are undocumented, may have been removed.
Tim
But the pyb functions described are undocumented, may have been removed.
Tim
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Adding USB-MIDI support to stmhal port?
I don't think this would work. USB-MIDI is a configuration of the USB Audio class and not a HID device.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Adding USB-MIDI support to stmhal port?
Any further hints from anyone?
Re: Adding USB-MIDI support to stmhal port?
Hi,
Is this thread still reflecting the current situation?
I'm using an STM32 for a musical instrument, and would love to add USB MIDI out; but it seems non-trivial at this point (well, except for sending thourgh a USB Serial port, as in: https://github.com/cjbarnes18/micropython-midi).
Also, apparently, CircuitPython has USB MIDI support on STM32F405 (https://circuitpython.readthedocs.io/en ... index.html).
Thanks!
Is this thread still reflecting the current situation?
I'm using an STM32 for a musical instrument, and would love to add USB MIDI out; but it seems non-trivial at this point (well, except for sending thourgh a USB Serial port, as in: https://github.com/cjbarnes18/micropython-midi).
Also, apparently, CircuitPython has USB MIDI support on STM32F405 (https://circuitpython.readthedocs.io/en ... index.html).
Thanks!