Skip to main content
Visitor II
October 26, 2022
Solved

stm32 usb virtual com port customized information

  • October 26, 2022
  • 3 replies
  • 1358 views

is it possible to add a specific name for usb port identification? when I use my PC HMI to connect this device, I can easily detect device is connected?

    This topic has been closed for replies.
    Best answer by Javier1

    >>when I use my PC HMI to connect this device, I can easily detect device is connected?

    Which operative system?

    As far as i know:

    • In windows-->no, the system will access the COM port trough the windows generic virtual port driver, and thats all the info your programm will see from the PC side. (even if you set your descriptors rigth, even if you get the nice popup window with the descriptors)

    Three ways to solve this:

    1. :( Create your own PC driver
    2. :| implement something like a "hello im here" inside your protocol, try to connet to all available com ports and keep the one that answers "helllo im here" right away.
    3. :) make the user choose the COM port

    • In linux, the same but with a penguin.

    3 replies

    Super User
    October 26, 2022

    Yes, you can customize strings in the USB descriptors.

    Visitor II
    October 27, 2022

    You can modify this string

    0693W00000VOE0lQAH.png

    Super User
    October 27, 2022

    Windows "classic" apps can use setupapi to detect connected USB devices and how they relate to COM ports. However, ability to read the descriptor strings is limited.

    More complicated for "modern" apps, there you need to associate the app with certain devices.

    For more info please see Windows documentation or visit the MS "docs" forums.

    Javier1Answer
    Graduate II
    October 27, 2022

    >>when I use my PC HMI to connect this device, I can easily detect device is connected?

    Which operative system?

    As far as i know:

    • In windows-->no, the system will access the COM port trough the windows generic virtual port driver, and thats all the info your programm will see from the PC side. (even if you set your descriptors rigth, even if you get the nice popup window with the descriptors)

    Three ways to solve this:

    1. :( Create your own PC driver
    2. :| implement something like a "hello im here" inside your protocol, try to connet to all available com ports and keep the one that answers "helllo im here" right away.
    3. :) make the user choose the COM port

    • In linux, the same but with a penguin.
    yang hongAuthor
    Visitor II
    October 27, 2022

    Actually, you are right, only change descriptor in controller side won't change PC general driver information. I think we need new customized driver.