2016-10-28 09:55 AM
Hi.
Is there a library out there or an example for the STM32F7 Discovery board that deals with simple MIDI over USB? I want to be able to both receive and send note commands. I would prefer to use an IRQ routine rather than polling a register in order to detect an incoming message. #stm32f746g-discovery-usb-midi #usbmidi-example-code2016-10-28 07:51 PM
I wrote a USBMidi project built on Keil for the Nucleo STM32F7xx boards. It should be easily adapted to the STM32F746-discovery board. I use it to receive MIDI only, but it is simple to write code to send MIDI as well (all the subroutines are in usbh_midi.c).
2016-10-29 09:32 AM
Thanks Chris.
Seems to be a bunch of broken dependencies such as usbh_core.h but I think I can sort that out.2016-10-29 06:15 PM
2016-10-30 03:25 PM
How do I know the corresponding port names for the F746 Discovery board?
2016-10-30 05:30 PM
2016-11-01 08:33 AM
Could you send all the usb related files? I've tried to get the missing ones myself but they all come in different versions. For example the file usbd_core.h is different from the usbh_core.h where the latter is supposed to mean ''host''? These files do not seem to be generated by STM32CubeMX. I did as you said and got me a mxconstants.h although the names don't seem to correspond to those in the files you supplied.
So far this challenge has proven to be the hardest so far. With that said to get the audio part to work was really tough not to mention the UART. The only project I can find that explicitly supports USB MIDI for the F746Discovery is ''fluidsynth'' but although all initialization routines are called successfully I cannot see the device listed by the ''lsusb'' command. I saw in other threads that you've struggled with this.2016-11-01 09:48 AM
These files are supplied by ST as firmware for the F7 series of boards. I am currently using STM32Cube_FW_F7_V1.5.0 as my base structure for all my projects. I usually leave the directory structure intact (as ST originally created it) so that the project templates for each different compiler finds the files (i.e. - the drivers, middleware, BSP, etc.)
Did you download the firmware for F7 boards from ST? What compiler are you using to build the project?2016-11-01 10:14 AM
Thanks Chris.
Hopefully these files will make this work for me. I rarely use the generated code from STM32CubeMX (except system clock config) since it doesn't look the same as the firmware examples. Also it isn't coupled to the BSP libraries that I use. The BSP libraries seem to work for me while the CubeMX generated code rarely does. I've got the STM32Cube_FW_F7_V1.4.0 but maybe I should upgrade to V1.5.0 I'm using Ac6 System Workbench in Ubuntu as my development IDE. Edit: Another important question I have is about ''host'' and ''device'' mode. I see there are different libraries for these two situations. How is your device configured? I'd like to use it as ''host'' if an OTG adapter is hooked to it and ''device'' if hooked to a pc. How can I make it autodetect this? Seems counterintuitive to hardcode the device into host or device making the OTG adapter useless?2016-11-01 01:48 PM
I am using USB Host only since I am creating a
. This way I can just plug any Class-compliant keyboard/controller directly to the board and play or edit parameters in real-time without needing to worry about device/product id's and external device drivers.