2
\$\begingroup\$

I have an STM32F723. I'm trying to configure it so that my computer recognizes it as a MIDI device via USB.

I searched the internet for examples, and read up on USB and MIDI.

However, I'm lost in all this flow of information.

I use CubeMX and CubeIDE, do you have a SIMPLE example of configuration?

For the moment I just want Windows to recognize my card as a MIDI device.

I have managed to get Windows to recognize my card as an audio device but I don't know what else I need to do to implement MIDI.

I think I need to add MIDI files with functions to implement MIDI through USB, but I don't know what files, I see everything on the internet I'm lost.

\$\endgroup\$
7
  • 5
    \$\begingroup\$ This is absolutely not going to be a simple project unless you can find somebody who's already done it. How is your C programming ability? \$\endgroup\$
    – pjc50
    Feb 3, 2021 at 11:08
  • \$\begingroup\$ Many people have already made MIDI projects on other series of STM32 F4, F0, F1 cards ... But they do very complex and advanced things which makes their code unreadable and I get lost in it. So for now I just want to start by having my card detected as a MIDI device, I think it can't be very hard, but I'm lost :( My skills in embedded programming in C are very basic ... \$\endgroup\$
    – sylvaing
    Feb 3, 2021 at 11:26
  • 3
    \$\begingroup\$ Why do you assume it is not very hard, if other people made very complex code to make the device act as MIDI endpoint? \$\endgroup\$
    – Justme
    Feb 3, 2021 at 11:43
  • \$\begingroup\$ From scratch, you would need to make both, device driver for PC system and USB MIDI device in the MCU. It would be better to study the complex code. \$\endgroup\$ Feb 3, 2021 at 12:08
  • 3
    \$\begingroup\$ @MarkoBuršič No that incorrect; operating systems do have drivers for standard MIDI class drivers, just like they have drivers for standard mass storage class drivers. \$\endgroup\$
    – Justme
    Feb 3, 2021 at 12:43

5 Answers 5

4
\$\begingroup\$

The MIDI class is not supported by the STMCube HAL but it is well known and implemented, you just need to google a bit.

I am currently doing a stm32 project with midi as well and I am using these two projects as reference:

Both have the midi usb class there one for stm32f1xx and another for stm32f4xx. For those I had made it work in a stm32f411CE (Blackpill board) with cont.trol configuring first the project as USB Audio class and later adding the MIDI class and initializing MIDI class Instead of AUDIO.

\$\endgroup\$
0
\$\begingroup\$

No, there is no simple way. The F7 HAL for USB device does not implement a MIDI device class. Feel free to use CDC class as a base for building your own MIDI device class.

\$\endgroup\$
1
  • \$\begingroup\$ I know that HAL doesn't implement a MIDI class and that it has to be created, I was just wondering if there were some simple enough examples of MIDI classes? \$\endgroup\$
    – sylvaing
    Feb 3, 2021 at 11:40
0
\$\begingroup\$

https://github.com/sebseb7/stm32-midi-demo/blob/master/midi/usb.c is worth a try.

This is a midi audio class configuration with midi included. I haven't tried it yet. I nave a midi audio class device generated by the STM32CubeIde and that is showing up as a 'STM Audio Device' in my device manager when I plug it in.

\$\endgroup\$
0
\$\begingroup\$

I can suggest you my implementation of the midi driver, which is compatible with last STM32CubeMX: https://github.com/Hypnotriod/midi-box-stm32 There you will find the guide about changes in the generated code you need to do to make everything working.

\$\endgroup\$
0
\$\begingroup\$

You can see an example of a MIDI implementation on an STM32 here.

Here you can trace the commit history and understand what needs to be changed to turn the STM32 into a MIDI device.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Hi, If you are affiliated to the link in your answer, please edit your answer to disclose that affiliation as required by this site rule, to prevent possible deletion as spam (undisclosed promotion). Thanks. \$\endgroup\$
    – SamGibson
    Nov 7, 2022 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.