From Project Configuration File platformio.ini — PlatformIO 3.5.0a4 documentation, it provides an example of how to configure Jlink GDB server:
[env:bluepill_f103c8]
...
; Debug options
debug_tool = custom
debug_server =
JLinkGDBServer
-singlerun
-if
SWD
-select
USB
-port
2331
-device
STM32F103C8
If JLinkGDBServer.exe is not included in PATH, then you need to specify the full file name of JLinkGDBServer.exe.
Alternatively just: