I'm using a STM Nucleo as a bridge to flash a BLE EM9304 module and another ST-LINK from another STM Nucleo to flash a STM32. Both MCU are in a third board. So, I'm integrating the sequence of programming in one "software". The question is: When I read the active COM ports, both ST-LINK ports appear with the same title. Is there any way to know which COM port is being used in the process by Python?
OBS.: The nucleo boards are differents (One is with STM32L037Z and the other is STM32F411).
-
\$\begingroup\$ Most likely not possible. Are you using pyserial or something else? \$\endgroup\$Justme– Justme2021年02月16日 20:14:17 +00:00Commented Feb 16, 2021 at 20:14
-
\$\begingroup\$ Are you really flashing via a serial connection? Usually, the SWD protocol is used for flashing. If so, it's not related to the virtual COM ports. \$\endgroup\$Codo– Codo2021年02月16日 21:06:44 +00:00Commented Feb 16, 2021 at 21:06
-
1\$\begingroup\$ If the devices being programmed are different, maybe you can just guess which com port to use. Then connect to the target device and check if it is the right one. If not, try the other one. If identical target devices are found on both com ports then I guess it is more tricky. \$\endgroup\$user57037– user570372021年02月16日 22:26:24 +00:00Commented Feb 16, 2021 at 22:26
1 Answer 1
If it's a PC maybe you can set a fixed COM number for each in device manager->Ports->Properties->Port Settings->Advanced->Com port number. There are hardware IDs and more for the computer to keep them straight.
Explore related questions
See similar questions with these tags.