2017-04-14 01:44 PM
Tried to get this working, no success.
HID is OK, virtual COM, MSD, everything works fine.
Audio class is recognized as composite device only.
I've connected USB DP, DM and GND only. VBUS sensing is OFF. 12 MHz external HSE clock implemented, PLL for usb is generating 48 MHz correctly.
I'm on the latest cubeF4 version (1.15.0) and IAR IDE.
Any ideas, why it's not working?
#stm32 #cubemx-f4 #usb-audio #cubemxSolved! Go to Solution.
2017-04-21 06:06 AM
I've found the root cause of the Problem
During USBD_AUDIO_Init the memory allocation went wrong.
/* Allocate Audio structure */
pdev->pClassData = USBD_malloc(sizeof (USBD_AUDIO_HandleTypeDef)); if(pdev->pClassData == NULL) {return USBD_FAIL; } else {.....It returns USBD_FAIL here and doesn't goes to the ELSE-state. We need size for 80 Packets of data (default buffer value)
After increasing __ICFEDIT_size_heap__ in the Linker File everything is fine!!!
2017-04-19 09:16 AM
Hi
Becker.Tom
,Are you using a working example from firmware package?
Try to share your main code to see if you have missed in the software ?
Imen
2017-04-19 09:24 PM
Hi Imen
unfortunately, there are no USB examples for the Nucleo-64 Boards, this board has no USB-jack ;)
I'm using CubeMX generated code as it is, no changes.
In order to get the USB working, i've set the RCC to external HSE (12MHz), set 168MHz Main CLK to get 48MHz for USB, enabled the FS-USB as device only and choose the audio-class in USB-Middle_ware. That's it.
All other Classes are recognized by Win7 , audio-class does not.
For me, it looks like the UAC-2 is implemented, right? If yes, Win will need a driver to recognized it, as it has no UAC-2 (USB audio class-2) support onboard.
2017-04-20 04:50 AM
Hi
Becker.Tom
,There is
Audio Standalone Example Code from the Cube Package for the Eval board and you can getinspired from it.
STM32Cube_FW_F4_V1.0\Projects\STM324x9I_EVAL\Applications\USB_Device\AUDIO_Standalone
Effectively,
USB Audio class 2.0 is not supported yet by our product and
USB Audio class 1 supports only low and full speed as mentioned in the section '6.4 Audio class'of
/external-link.jspa?url=http://www.st.com/content/ccc/resource/technical/document/user_manual/cf/38/e5/b5/dd/1d/4c/09/DM00108pdf/files/DM00108pdf/jcr:content/translations/en.DM00108pdf
.Imen
2017-04-20 10:43 AM
I'm not trying to do anything, just init the audio class.
All descriptors are same, as in the example. All init functions also.
I have no idea, what is wrong.
Anybody managed usb audio to work on Nucleo64 boards?
2017-04-21 06:06 AM
I've found the root cause of the Problem
During USBD_AUDIO_Init the memory allocation went wrong.
/* Allocate Audio structure */
pdev->pClassData = USBD_malloc(sizeof (USBD_AUDIO_HandleTypeDef)); if(pdev->pClassData == NULL) {return USBD_FAIL; } else {.....It returns USBD_FAIL here and doesn't goes to the ELSE-state. We need size for 80 Packets of data (default buffer value)
After increasing __ICFEDIT_size_heap__ in the Linker File everything is fine!!!
2021-02-13 10:15 PM
Hi, would you share the project files w ioc file on how it was setup?