Adding USB-MIDI support to stmhal port?
Posted: Mon May 02, 2016 2:30 pm
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
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