I have attached two STM nucleo boards on the same machine and need to flash each device individually over COM port .I try to flash each individual device by defining the COM port on the upload_port on .ini but its flashing to the same device .
I.E : Two nucleo boards which in COM3, COM 5 attach to same pc .
once i define
upload_port = COM3 it should flash to the device in COM3 and once i define
upload_port = COM5 it should flash to the device in COM 5 instead it is flashing to COM3 device .
Is this a bug or am i do something wrong ?
No, upload is not done via the COM interface of the Nucleo board, but via the USB STLink device on the board. Only pure UART communication goes through the COM port normally. You cannot control the target upload device by specifying a COM port when right now the default upload protocol of upload_protocol = stlink is being used. (That would only be the case when upload_protocol = serial is used and the chip is in UART bootloader mode by resetting while BOOT0 pin high… special case, not important here)
However, if you use only Nucleo boards which have an STLink that also exposes a virtual USB disk, there is another possibility. Change to upload_protocol = mbed for all environments and then point upload_port = .. to the drive that the virtual USB disk is mounted, e.g. H:. That is documented here and here. That should work.