Choosing STLink V2 programmer

I’m running into this as well. Trying to set up a Raspberry Pi 3B+ as build farm, with eight STM Nucleo boards, for testing across the different ARM Cortex families.

I can identify unique serial IDs and disk labels for each ST-Link (most are v2.1, one is v3). I have a simple blink+uart test which compiles for each board, but this won’t work until OpenOCD can address the matching board when uploading to each of them.

As I understand it, this will require a custom .cfg file for each board, passed to openocd as a custom upload?

Update - The following command (with the added hla_serial option) works:
~/.platformio/packages/tool-openocd/bin/openocd -d2 -s /home/jcw/.platformio/packages/tool-openocd/scripts -f interface/stlink.cfg -c "transport select hla_swd" -c "hla_serial 0669FF555052836687022922" -f target/stm32l4x.cfg -c "program {.pio/build/l432/firmware.elf} verify reset; shutdown;"

Update # 2 - see Add support for multiple ST-Link adapters · Issue #564 · platformio/platform-ststm32 · GitHub on GitHub