Setting a custom debug server command per Debugging of STM32F103 clone "BluePill" board, wrong idcode - #6 by maxgerhardt should work. A more generalized notation of this would be
debug_server =
${platformio.packages_dir}/tool-openocd/bin/openocd
-s ${platformio.packages_dir}/tool-openocd/scripts
-f interface\stlink.cfg
-c "transport select hla_swd"
-c "set CPUTAPID 0x2ba01477"
-f target\stm32f1x.cfg
-c "reset_config none"