STM32H7 USB audio difficulties
Hi there,
I'm trying to make a basic USB audio speaker from an STM32H7 Nucleo board. I am fairly familiar with the USB audio middleware having studied it for a few days, but am not having much luck receiving audio data. I intend to use the built-in DAC as an output, but have gone back to basics to try and find the root of this problem.
I start a new CubeMX project for the STM32H7 Nucleo144 board, add in the USB_FS and audio drivers on default settings. I then change the sample rate to 48KHz and generate the project.
In order to get the device to enumerate I have to add HAL_PWREx_EnableUSBVoltageDetector(); to the MX_USB_DEVICE_Init();. Once I do this, the WIndows 10 machine will see the device and allow you to select it as an audio output.
I can see the AUDIO_Init_FS, AUDIO_DeInit_FS, and AUDIO_MuteCtl_FS, functions in the device struct are being called correctly, (when plugging in / unplugging and muting / unmuting) however AUDIO_AudioCmd_FS, which should be called when audio data is received from the host, is not being called at any time.
I have dug deeper into the USB audio middleware 'core' and the data in function that should call AUDIO_AudioCmd_FS is not being called at all.
I have used wireshark to look at the packets going back and forth and after enumeration, there is no more communication. Almost as if the PC doesn't know to send audio to EP1. I have tried sendig audio to the device from several different applications.
If anyone can help shed any light on what I might be missing, that would be a great help. I have already gone through usb examples for other boards, but can't see any differences that help.
Many thanks,
Matt
