Skip to main content
BBori.1
Associate II
Jan 18, 2021 11:32 AM UTC
Solved

Program multiple STM32 MCUs at the same time

Hello!

I'm trying to program multiple STM32F432VIT6 MCUs at the same time, from the same computer using many ST-LINKV2 connected via USB.

I want it to be automatic so I'm using the ST-LINK Utility CLI to program them via C#.

So far I've been able to list all the ST-LINK devices connected to the computer and to program the board when only one device is connected, but when I connect two devices I can not give the program instruction -P the serial number of the device I want to target.

I think it should be possible since the ST-LINK Utility Tool has a list in which one can select the target device.

I'm following the ST-LINK Utility Manual

Does someone has an idea of how can I achieve this?

Thank you!

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Jan 18, 2021 8:59 PM UTC

-c is not one command, it's a switch. You can and shall use several switches simultaneously. The -c switch tells the program, which STLink are you going to use, the -P switch tells, which file is to be programmed.

JW

4 replies

waclawek.jan
Super User
Jan 18, 2021 12:57 PM UTC

> -P the serial number of the device I want to target.

Where do you get this from?

-P is used to determine the file to be programmed.

You want to use -c ID=*** or -c SN=xxxx

Syntax: -c [ID=/SN=] [JTAG/SWD] [FREQ=] [UR/HOTPLUG] [LPM]

[ID=]: ID of ST-LINK[0..9] to be used when multiple probes are connected to the host

[SN=]: Serial Number of the chosen ST-LINK probe.

JW

Tesla DeLorean
Guru
Jan 18, 2021 1:12 PM UTC

The Cube Programmer app might have​ additional options, but I'm sure it could accept and index.

​

To scale you might want to use the DLL interface.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
BBori.1
BBori.1Author
Associate II
Jan 18, 2021 1:14 PM UTC

Hello, thank you for you answer

Maybe I'm not fully understanding the use of the command -c, but how do I load a hex file into a micro using this command? I can specify the SN, but can I flash the device?

waclawek.jan
waclawek.janBest answer
Super User
Jan 18, 2021 8:59 PM UTC

-c is not one command, it's a switch. You can and shall use several switches simultaneously. The -c switch tells the program, which STLink are you going to use, the -P switch tells, which file is to be programmed.

JW