Skip to main content
Associate II
May 14, 2024
Question

Is there any CLI Command to get the COM Port number of my ST-Link device from it's SN ?

  • May 14, 2024
  • 1 reply
  • 1945 views

I executed this command : STM32_Programmer_CLI.exe -c port=SWD sn=xxxxxxxxx232xxxxxxxxxxxx and got the response that gave me details about the device, but not COM Port. Is there any command that gives me the COM Port number to which my device is connected ? I know about the "-l uart" command. any other command than that ? Thanks in advance.

 

1 reply

Aziz BRIGUI
Technical Moderator
May 16, 2024

Hello @shiwasreet

Could you clarify your request please ? I could get the port associated with the ST-LINK SN using -l command, here's an example output below.

C:\Users\briguiah>STM32_Programmer_CLI -l
 -------------------------------------------------------------------
 STM32CubeProgrammer v2.16.0
 -------------------------------------------------------------------

===== DFU Interface =====

No STM32 device in DFU mode connected

===== J-Link Interface =====
Error: No J-link probe detected.
===== STLink Interface =====

-------- Connected ST-LINK Probes List --------

ST-Link Probe 0 :
 ST-LINK SN : 002B00213037510B35333131
 ST-LINK FW : V3J13M4B5S1
 Access Port Number : 0
 Board Name : STLINK-V3SET
-----------------------------------------------

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

Total number of serial ports available: 1

Board Name : STLINK-V3SET
ST-LINK SN: 002B00213037510B35333131
Port: COM129
Location: \\.\COM129
Description: STMicroelectronics STLink Virtual COM Port
Manufacturer: STMicroelectronics

Aziz

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Associate II
May 22, 2024

Hey Aziz, thanks for your reply. As I've already mentioned in my question, i've already tried the "-l uart" command, it gives information about all the connected probes. I have more than 50 devices connected to my computer, so that command isn't really reliable for me, however i can parse that command line output and get the COM Port. Hence, i was looking for some specific command which gives me the specific COM Port Name based on my ST-Link Device Serial Number. Anyways, thanks.