cbr
cbr

Reputation: 457

Stm32 Virtual COM Port - Can not connect

This is a code, part of my project;

  //----------------------------------------------------------------------------
  // USB: Virtual COM ----------------------------------------------------------
  //----------------------------------------------------------------------------
  USB_Interrupts_Config();
  Set_USBClock();
  USB_Init();

  while (bDeviceState != CONFIGURED)
      ;

  //----------------------------------------------------------------------------
  // Main Loop -----------------------------------------------------------------
  //----------------------------------------------------------------------------
  while(1)
  {
    USB_printf("Main Function");

    GPIO_SetBits(GPIOC, GPIO_Pin_10);
    Wait(200);
    GPIO_ResetBits(GPIOC, GPIO_Pin_10);
    Wait(200);
  }

After plugging my usb to the Circuit, Virtual COM Port Driver installation finishes correctly and LED blinking is also OK.

But when I try to connect COM port via Hyper Terminal or 3th party tools, I can not achieve it.

Is there any opinion?

Thanks..

Upvotes: 4

Views: 11788

Answers (2)

stiebrs
stiebrs

Reputation: 399

I had similar issue with a slightly different wording - it is possible to connect to the device until it's reset. My custom board would enumerate VCP correctly but would not connect after device reset. Turns out, that USB host keeps the enumerated address for the device, while device looses its address after reset/reprogramming. To avoid such issues, software reset should also perform USB physical layer reset (disconnecting pullup on D+/D- pin, depending on the speed used). In such a case it should be possible to connect to the device after disabling and then re-enabling it in the device manager or re-plugging

Upvotes: 1

Dampsquid
Dampsquid

Reputation: 2474

Not Necessarilly the answer but may be worth checking.

If your periodically send information out of the COM port and it appears your program does ( never used STM32 ), Windows (hyperterm so I assume windows XP) can detect that as a serial mouse and enumerates it as a mouse thus opening the port and preventing any other application from using it.

We have had many issues with this with our devices (CP2103's from SiLabs), and also is a common problem with GPS recievers.

This answer GPS Detected as serial mouse as a good description of the issue and possible workarrounds.

Upvotes: -2

Related Questions