Skip to main content
Visitor II
January 18, 2021
Solved

Program multiple STM32 MCUs at the same time

  • January 18, 2021
  • 4 replies
  • 2800 views

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.
    Best answer by waclawek.jan

    -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

    Super User
    January 18, 2021

    > -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

    Graduate II
    January 18, 2021

    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.​

    BBori.1Author
    Visitor II
    January 18, 2021

    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?

    Super User
    January 18, 2021

    -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