AnsweredAssumed Answered

STM32L USB CDC VirtualCom example : device not recognized

Question asked by stevens.nigel on Jan 21, 2015
Latest reply on Jan 28, 2015 by stevens.nigel
Hi

I'm a relative newbie in using ST or ARM devices, and I'm attempting to get a USB CDC device working using the VirtualCom example code, using an STM32L152 in a custom pcb.

I'm using the Kickstart edition of IAR embedded workbench (is there a problem using this?)

The main problem I'm having at the moment is that when I build my code and download it to the mcu, then plug the USB into my PC (64 bit Windows 7 Pro), I get a message on the PC "USB device not recognized", and the device appears in Device Manager  with a yellow triangle named "Unknown Device".

If I look in Device Manager at the "Unknown Device"'s properties : they start as follows:
Device Description     : Unknown Device
Hardware IDs          : USB\UNKNOWN

On our pcb, we've got an 8 MHz crystal clock on the HSE
What I'm intending to do is to get the PLL producing 48MHz for the USB... and the fastest possible SYSCLK.
HSE = 8 MHz
PLLMUL = 6
so 
PLLVCO = 6*8 = 48 MHz
PLLDIV = 2
so
SYSCLK = 24 MHz

AHB, APB1, & APB2 prescalers are all set to 1

I've used RCC_GetClocksFreq() to get the configured clocks' frequencies and that tells me that the code thinks SYSCLK, HCLK, PCLK1 & PCLK2 are all 24 MHz. I therefore assume that USBCLK is correctly set to 48 MHz.

I've tried setting MCOPRE to 1 and MCOSEL to output SYSCLK, and can measure 24.000 MHz on the MCO pin. so I know that seems to be working.

Does anyone have any ideas what could be wrong please ?

Outcomes