cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 - USB MIDI

isaacjack
Associate II

Hi

I
'm working on a project which requires USB MIDI functionality. I looked into a couple of videos where USB MIDI implementation was done on other boards, but when I try to do the same on mine it's not working. I'm using a NUCLEO board (H755ZIQ), I tried checking with both micro USB ports in the board but i'm still getting nothing. In the videos I watched it was achieved by editing the descriptors inside USBDEVICE. This is one of the video that i followed https://www.youtube.com/watch?v=C6jAYpNR1-E&t=990s

What i did so far is

>>Configure USB_OTG_FS as Device only with
>>Activate VBUS = VBUS_Sensing and activate SOF checked (This was already there by default.)
>> Used the default clock setting for the Nucleo board with 64MHz.
>>In middleware settings, I selected USB_DEVICE_M7 and class was set to HID.
>>I replaced the values in “ALIGN_BEGIN static uint8_t USBD_HID_CfgDesc[USB_HID_CONFIG_DESC_SIZALIGN_END “ With the descriptors for MIDI as per the MIDI specifications

>>Then I used the following code in my while(1) loop.
while 
(USBD_HID, HandleTypeDef) hUsbDeviceFS.pClassData)->state == HID_BUSY)( USBD_HID_SendReport(&hUsbDeviceFS&midiNoteOn, 4);
HAL
_Delay(5001;
while 
(USBD_HID, HandieTypeDef) hUsbDeviceFS.pClassData)-state == HID_BUSY)U USBD_HID


I tried blinking an LED to see whether the code is getting stuck somewhere but that is not the case. Is there anything that i'm missing since i'm using a different board.

1 REPLY 1
ABOUA
ST Employee

Hello,

I would first recommend you running the provided HID application (emulating a mouse) of the cube firmware, to ensure that your hw setup is working fine

Regards