cancel
Showing results for 
Search instead for 
Did you mean: 

STLink-V3PWR: How to identify COM Port

lmessing
Associate II

I am struggling to find a good way to identify the two COM ports the STLink-V3PWR provides. One is for direct communication with the power measurement unit and the other is connected to DEBUG for the target device(VCP).

We need a easy way to identify the DEBUG UART port of the STLink-V3PWR. When performing the "-l uart" command with the STM32_Programmer_CLI.exe we receive two identical outputs for both ports. This is not the case with the STLINK-V3SET, because we get an easy identifyable description "STMicroelectronics STLink Virtual COM Port". 

In the example below, how do I distinguish between COM20 and COM21? There must be a better way than opening both ports and checking which one responds to the "version" command.

Example Outputs:

STLINK-V3SET

"C:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin\\STM32_Programmer_CLI.exe" -l uart
-------------------------------------------------------------------
STM32CubeProgrammer v2.14.0
-------------------------------------------------------------------

===== UART Interface =====

Total number of serial ports available: 1

Board Name : STLINK-V3SET
ST-LINK SN: 0047001D3037510339373532
Port: COM4
Location: \\.\COM4
Description: STMicroelectronics STLink Virtual COM Port
Manufacturer: STMicroelectronics

STLINK-V3PWR

"C:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin\\STM32_Programmer_CLI.exe" -l uart
-------------------------------------------------------------------
STM32CubeProgrammer v2.14.0
-------------------------------------------------------------------

===== UART Interface =====

Total number of serial ports available: 2

Board Name : STLINK-V3PWR
ST-LINK SN: 002300433432511839383236
Port: COM20
Location: \\.\COM20
Description: Serielles USB-Gerõt
Manufacturer: Microsoft

Board Name : STLINK-V3PWR
ST-LINK SN: 002300433432511839383236
Port: COM21
Location: \\.\COM21
Description: Serielles USB-Gerõt
Manufacturer: Microsoft

 

1 ACCEPTED SOLUTION

Accepted Solutions
AM
ST Employee

Hello,

On windows you may install last STSW-LINK009 driver (v2.0.2)  to differentiate the 2 COM ports.

A driver must be installed before connecting an ST-LINK/V2 or an ST-LINK/V2-1 board with a Windows® 10 or
Windows® 11 PC via the USB. This installation is not mandatory for the STLINK-V3 or STLINK-V3PWR boards, but allocates an ST-specific name to the ST-LINK COM ports in the system device manager. The driver is
automatically installed by the toolsets supporting ST-LINK. It is also available from the STSW-LINK009 dedicated
page at the STMicroelectronics website.https://www.st.com/en/development-tools/stsw-link009.html.

Attached the screen shot of device manager before and after STSW-LINK009 installation.

Best regards

 

 

View solution in original post

10 REPLIES 10
jiangfan
ST Employee

I suppose the order is fixed. for example, if you see the COM port with the power measurement unit with lower number on your PC, then you should see the same case on other PCs.

I mean, if on your PC, COM20 for power measurement unit and COM21 for target device VCP, then on 2nd PC you may see COM5 for power measurement unit and COM6 for target device VCP, and so on...

This is not the case. Which COM port is assigned is handled by Windows. I tried on a different PC and here is what I get:

PC 1:
COM20 (PMU) and COM21 (VCP)

PC 2:
COM12 (VCP) and COM13 (PMU)

OK, it is not OK this way (fixed COM port order). perhaps there will be another way.

Do you see any difference in Windows registry regarding 2 COM ports?

Which keys should I take a look at in the registry? Can you give me a path?

My preferred solution would be that ST adapts the drivers of their STLINK-V3PWR to output the description just like the STLINK-V3SET does. Since this is already done with the SET, why is this not the case with the PWR?

Pavel A.
Evangelist III

Please check also the device manager, View devices by container. Find the STLINK-V3PWR. Is there any difference in its COM ports description?

In the properties of COM ports, please find Details tab. What are "Device Instance Path" of the COM ports?

The difference of the "Device Instance Path" is very minimal. The "Description" value is the same.

lmessing_0-1695625756140.png

 

Pavel A.
Evangelist III

@lmessing The difference is small but precious. The composite function indexes are all we need to know. One is MI_01 and the other MI_04. This can be used to distinguish the COM ports. 

Unfortunately this ST-LINK does not have a "serial number" (strange). This makes parsing the string harder (TL;DR Microsoft warned more than once against attempts to parse these strings - but they don't offer anything much better...)

AM
ST Employee

Hello,

On windows you may install last STSW-LINK009 driver (v2.0.2)  to differentiate the 2 COM ports.

A driver must be installed before connecting an ST-LINK/V2 or an ST-LINK/V2-1 board with a Windows® 10 or
Windows® 11 PC via the USB. This installation is not mandatory for the STLINK-V3 or STLINK-V3PWR boards, but allocates an ST-specific name to the ST-LINK COM ports in the system device manager. The driver is
automatically installed by the toolsets supporting ST-LINK. It is also available from the STSW-LINK009 dedicated
page at the STMicroelectronics website.https://www.st.com/en/development-tools/stsw-link009.html.

Attached the screen shot of device manager before and after STSW-LINK009 installation.

Best regards