AnsweredAssumed Answered

Can not use MCO output in VirtualComport_Loopback project

Question asked by chen.alex.006 on Apr 25, 2014
Latest reply on Apr 26, 2014 by chen.alex.006
Hi, all,
    I use STM32F103VCT6 and VirtualComport_Loopback project for usb communication, the usb part works fine. 
    Now, I try to output the MCO at PA8, failed.


void MCO_Config(void)
{
     GPIO_InitTypeDef is;


      RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
     
     is.GPIO_Pin = GPIO_Pin_8;
     is.GPIO_Speed = GPIO_Speed_50MHz;
     is.GPIO_Mode = GPIO_Mode_AF_PP;
     GPIO_Init(GPIOA,&is);


     RCC_MCOConfig(RCC_MCO_SYSCLK);
     return;
}

int main(void)
{
  Set_System();
  Set_USBClock();
  USB_Interrupts_Config();
  USB_Init();
     
  MCO_Config();
  
  while (1)
  {
    if (bDeviceState == CONFIGURED)
    {
      CDC_Receive_DATA();
      /*Check to see if we have data yet */
      if (Receive_length  != 0)
      {
        if (packet_sent == 1)
          CDC_Send_DATA ((unsigned char*)Receive_Buffer,Receive_length);
        Receive_length = 0;
      }
    }
  }


   If I add a breakpoint before while loop, i got MCO at PA8, but ,when I continue, the MCO will disappear.  I do find that the RCC->CFGR had been changed somewhere, but I can not find it.
   
   Anyone can give me help ?  Thanks a lot.

   BTW, the Virtualcomport_lookback project comes from STM32_USB-FS-Device_Lib_v4.0.0.
 






Outcomes