Recognizing the COM port used with STLINK
If it's a PC maybe you can set a fixed COM number for each in device manager-&gt;Ports-&gt;Properties-&gt;Port Settings-&gt;Advanced-&gt;Com port number. There are hardware IDs and more for the computer to keep them straight.