Skip to main content
Konmax
Associate
August 8, 2017
Question

USB VCP Windows 10

  • August 8, 2017
  • 11 replies
  • 8395 views
Posted on August 08, 2017 at 14:36

Hi,

The problem is when using USB VCP under Windows 10 on the Nucleo f746 board. The COM port is not open. When connecting to Windows 7 COM port opens.

I tried to board Nucleo l432. Works under Windows 7 and Windows 10.

    This topic has been closed for replies.

    11 replies

    STOne-32
    Technical Moderator
    August 8, 2017
    Posted on August 08, 2017 at 22:08

    Dear

    Kondratev.Max

    ‌,

    Can you elaborate which example is used ? Is it the ST-link one or the F7 target mcu example : CubeMX ? Etc..

    Windows 10 supports inbox VCP like a mass storage pen and there us nothing to install on pc side. It may be a usb descriptor issue - if it the example you can compare both descriptors. If it is ST-link on board you need to upgrade it.

    Cheers

    STOne -32

    Konmax
    KonmaxAuthor
    Associate
    August 9, 2017
    Posted on August 09, 2017 at 08:18

    I used the generated CUBEMX project without FREERTOS, only configured clocks and USB in VCP mode. USB for the target controller used. USB VCP from st link opens the port.

    CUBEMX 4.22.0.

    STM32F7 1.7.0.

    The USB port in windows 10 is fine, but my application can not open it.

    Creating a similar project for NUKLEO - L432 (STM32L4 1.8.1) Com port opens.
    Brendan Simon
    Associate
    June 7, 2018
    Posted on June 07, 2018 at 07:12

    I have this problem too.  A proprietary STM32F4 board using onbard USB.  I connects and enumerates on Win7, Win 10 and Mac, but only Win7 and Mac can open the device as a serial port (COM port).

    Debugging this I found that the low level windows API to `SetCommState()` was returning `false` on Windows 10 (it must return True on Windows 7 as it opens the port ok).  The error code is `87` which is an INVALID PARAMETER.

    I've looked at all the values set in the `DCB` structure and they all look ok.  I'm thinking it must be something to do with the device capabilities (what Windows thinks the capabilities of the com port is, and what Windows thinks I am allowed or not allowed to set).

    If it's not a bug in the Windows driver, then I'm guessing it might be either a setting in the USB device descriptors or configuration, or a bug in the USB stack on the STM32.

    It seems Windows 10 is more fussy or requires more information ???

    Anyone have any further information to share ???

    Ant M
    Associate II
    June 8, 2018
    Posted on June 08, 2018 at 15:15

    I had a similar issue, it turned out that I had to make sure line coding was dealt with on the STM32 side. See link below, worth a try to see if that fixes your problem:

    https://github.com/Ant1882/STM32F429-Tracealyzer-Demo/commit/4cf6591b3bdff098292349874f8c0c8df7802986

     

    Basically whatever the windows driver sends will get echoed back.

    Ant

    Matjaz Tome
    Associate
    July 16, 2018
    Posted on July 16, 2018 at 10:31

    Had the same problem on F4 discovery booard. This post helped!

    Thanks!

    FDami
    Visitor II
    November 22, 2018

    I had the same issue on F4 custom board.

    Fixed with GET and SET line coding.

    Many many thanks

    mmed
    Associate III
    March 26, 2019

    Hi all,

    using windows 10,

    I want to handle STM32F407 Disco via VCP. In the first case, i tried to configure UART but when i connect my USB TTL converter to my PC: it informs me that VCP error ''This device cannot start(code 10)''.

    I thought that the probem is related to my USB converter

    Then i tried to configure CDC USB:

    USB_OTG_FS on mode Device only

    activate USB_Device middelware in CDC mode

    0690X0000088qxcQAA.png

    check the CubeMX file attached for more details

    but the problem still exist!===> VCP error ''This device cannot start(code 10)''.

    0690X0000088qxSQAQ.png

    and here is the define in "usbd_desc.c" file

    #define USBD_VID   1155

    #define USBD_LANGID_STRING   1033

    #define USBD_MANUFACTURER_STRING   "STMicroelectronics"

    #define USBD_PID_FS   22336

    #define USBD_PRODUCT_STRING_FS   "STM32 Virtual ComPort"

    #define USBD_SERIALNUMBER_STRING_FS   "00000000001A"

    #define USBD_CONFIGURATION_STRING_FS   "CDC Config"

    #define USBD_INTERFACE_STRING_FS   "CDC Interface"

    =====> Please how can i handle to fix this issue! if there is a wrong value generated by CubeMX! or a change that should i do in my environement (PID, VID....)

    this is a real problem for me that block my project0

    Please any solution or workaround for this

    many thanks

    David.Cheng
    Associate III
    May 29, 2019

    have same problem

    CanhNguyen
    Visitor II
    March 29, 2019

    I have the same problem like you @med zarat ''This device cannot start(code 10)''.

    Magically that when I change Heap Size from 0x200 to 0x1000 and Stack Size from 0x400 to 0x500, it will work.

    I can see that both your Heap Size and Stack Size are 0x1000, but I do not why it is sill in that problem.

    I think this is the problem related to memory.

    Maybe you can change the buffer size of the USB?

    This is my setting in STCube. Hope that it will be usefull.

    GCovo
    Visitor II
    April 11, 2019

    Hello CanhNguyen,

    Same situation here, but I found another source of variability.

    The VCP only works if I use the Windows API directly (C++ program)

    So the Teraterm terminal works, but the dotnet based YAT terminal dont.

    I hope this can help ST engineers to fix it.

    CanhNguyen
    Visitor II
    March 29, 2019

    0690X0000089DgtQAE.png0690X0000089Dh8QAE.png

    Jacek.Main
    Visitor II
    April 27, 2019

    Hi,

    I also encountered this problem today - couldn't open the port in putty, got the "unable to configure the port" error too.

    In my case, I had to uninstall the device driver (in device manager, uninstall device & remove installed driver).

    Unplugged and plugged again and it installed some generic driver and it works - it had stm32 driver before.

    AArt
    Visitor II
    September 15, 2019

    I had the same problem with my custom board with f405 MCU. The VCP was detected by win10, and drivers was ok. 

    More than that, i was able to open COM port with Termite terminal. But my host app (based on .net) could`t open it. 

    Same thing was with Qt based host app (unsupported operation error was appeared).

    Fix with GET and SET line coding from Ant M helped. 

    Thanks!