[BUG] STM32CubeMX USB Audio Class example not handling USB SET_REQUESTS properly
1) STM32CubeMX Version 4.26.1, STM32Cube V1.0, using firmware package STM32Cube MCU Package for STM32L4 Series 1.12.0 (22 May 2018)
2) New Project, STM32L476RE, USB Device, class for FS IP Audio Device class, configure RCC + 3 GPIO's because of how my development board is setup and thats it.
3) Generate TrueStudio project and open with Atollic TrueSTUDIO for STM32 v9.1
4) Run / Debug
5) Windows enumerates the USB Audio Device
6) Click the Mute button on the Windows volume on the taskbar to send a SET_CURRENT request to mute the device, packet can be verified on the Device Monitoring Studio
7) The first SET_CURRENT request arrives at USBD_AUDIO_Setup. However, if you put a breakpoint there, USBD_AUDIO_Setup never gets called again, even when clicking the mute again. You can see on Device Monitoring Studio that down packets are still sent.
It looks like calling USBD_CtlPrepareRx (because of needing to receive the SET_REQUEST data stage via USBD_AUDIO_EP0_RxReady) messes up the default control pipe / endpoint 0 so that future setup packets don't arrive at the USBD_AUDIO_Setup function.
Surely there must be a way to restore the endpoint 0 after USBD_CtlPrepareRx and USBD_AUDIO_EP0_RxReady?
Note: If you comment out USBD_CtlPrepareRx in USBD_AUDIO_EP0_RxReady then multiple SET_CURRENT requests can be sent by clicking the mute button. Otherwise, the setup stage freezes up / no longer gets called after the first SET_CURRENT request completes.