2014-04-07 03:44 AM
Hi Guys,
I Am trying to port VCP Example Project found in STM32_USB-FS-Device_Lib_V4.0.0 on STM32F103XE Eval kit. Pin Description : PA12------USBDP-------Pulled up by 1.5K Resistor. PA11------USBDM PA10------USART1_RX PA9--------USART1_TX So depending on same I modified as belowvoid Set_System(void)
{ GPIO_InitTypeDef GPIO_InitStructure; /*Set PA11,12 as IN - USB_DM,DP*/ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; //GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOA, &GPIO_InitStructure); /*SET PA11,12 for USB: USB_DM,DP*/ // GPIO_PinAFConfig(GPIOA, GPIO_PinSource11, GPIO_AF_14); // GPIO_PinAFConfig(GPIOA, GPIO_PinSource12, GPIO_AF_14); } As GPIO_PinAFConfig is obsolete in latest standard peripheral library ( STM32F10x_StdPeriph_Lib_V3.5.0 ) so how can I set Pin11 and Pin12 as DM\DP ? Is there any substitute or how to configure same ?Regards,
Omji Mishra #usb-stm32
2014-04-13 11:31 PM
2014-04-24 02:27 PM
Hello,
I recently resolved an issue almost exactly like yours. My problem was that the PLL clock was not setup properly. I needed to enable the PLL clock and setup as follows:PLL Clock source = HSE (16Mhz external clock)PLL Multiplier = 3 (This creates a 48Mhz clock 3*16 = 48) You can use 4 here instead but you will need ot have the USB pre-selector set to divide by 1.5PLL Enable = TrueUSB Pre-selector = Divide by 1--Kevin