2016-01-19 05:16 AM
I have a STM32F411 Discovery board, when I use the latest CubeMX to generate templates that configure the board as a USB device audio class, the board doesn't get recognized by the host computer (as in, the computer doesn't think there is a USB device plugged in at all, not even USBlyzer captures any communication on the USB bus.)
The USB descriptor in the code should make the board show up as a loudspeaker in the computer, which is the case when I tried the same thing on a STM32F407 Discovery board. Could anyone confirm this? Or help me with a workaround? Thanks #usb #stm32f4112016-01-19 08:37 AM
Verify the PLL settings and clocks are set up appropriately. The Q tap of the PLL needs to generate 48 MHz. Perhaps the F411 has other sources of 48 MHz to permit 100 MHz CPU operation, not a part I'm actively using.
2016-01-20 02:50 AM
Thanks for your input. I checked the PLL settings in CubeMX, the default setting generates the correct 48MHz clock at the output of PLLQ.
My new discovery is, when I program a F407 board with the USB project generated for F411 Discovery, it actually works (at least the board is recognized as loudspeaker). More interestingly, when I program the F411 board with a USB project generated for F407, but with PLLs underclocked so that the processor runs at 96MHz, it also works! I suppose there might be some mistake with the low layer configuration files......2016-01-21 04:09 AM
I think I've found a solution. By changing the value of RCC_OscInitStruct.HSEState from RCC_HSE_BYPASS to RCC_HSE_ON in main.c, the USB device is successfully recognized.
So this is a bug of CubeMX, then?