2022-10-06 2:08 AM
Hello everyone
I am trying to implement a simple soundcard from using STM32F407G-DISC1 board.
It utilizes STM32F407. I am using CubeIDE version 1.10.1
I configured the USB to be Full-speed Device Only. And I configured the middleware as Audio class.
I set the the heap size at 0x4000, and stack size at 0x2000.
When I connect it via the USB, Windows surely recognizes it as "Speakers".
I know that when the microcontroller receives Audio data, I should have access to the samples in the "AUDIO_AudioCmd_FS" function.
The problem is that, when I send Audio data to the microcontroller, the AUDIO_AudioCmd_FS function gets called only once, and it does not get called again.
No matter how many times I resend Audio data from the PC to the microcontroller, the AUDIO_AudioCmd_FS function does not get called again.
Can anyone please help me with this issue?
Solved! Go to Solution.
2022-10-07 2:44 AM
My problem is solved!
I want to point out 2 things:
I copied the following files into my project:
/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c
/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c
/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c
/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src/usbd_audio.c
/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c
/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c
/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c
/USB_DEVICE/App/usb_device.c
/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h
/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h
/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h
/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc/usbd_audio.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h
Now it works.. I think :)
2022-10-07 2:44 AM
My problem is solved!
I want to point out 2 things:
I copied the following files into my project:
/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c
/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c
/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c
/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src/usbd_audio.c
/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c
/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c
/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c
/USB_DEVICE/App/usb_device.c
/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h
/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h
/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h
/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc/usbd_audio.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h
/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h
Now it works.. I think :)
2022-10-20 2:43 AM
Hi @Sami
Really glad to know you overcame this problem.
Please allow me to close this thread.
Thank you for your contribution and all the details you provided.
Imen
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.