cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual Com Port for STM32F103XC

1605mystery
Associate II
Posted on April 07, 2014 at 12:44

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 below

void 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
11 REPLIES 11
1605mystery
Associate II
Posted on April 14, 2014 at 08:31

Hi anyone has any clue regarding same.

kevin239955
Associate
Posted on April 24, 2014 at 23:27

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.5

PLL Enable = True

USB Pre-selector = Divide by 1

--Kevin