2015-04-24 07:43 AM
hi
trying to enable USB VCP on the stm32f103c8 device, used the cubemx generator, selected USB device and CDC class, updated the clock generation page so that it generated the 48MHz clock for USB (HSE Prediv=1, PLLsourceMux=HSE, PLLMul=6, USB Prescaler = 1). however, the generated code in SystemClock_Config() still did not set up the USB clock correctly. in particular, the following lines are needed but missing:RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
i added them in and was then able to get my PC to recognize the USB (COM) device after that.
incidentally, the code is generated for the stm32f
303 device, which was how i found the discrepancy.
thanks
2015-07-01 02:59 AM