Oh right, because the init cmds still go to GDB and not openOCD before it. There still multiple ways to do it.
- By using a custom board JSON file with an expanded
openocd_extra_args
. Copy-paste the bluepill JSON file into theboards/
folder of the project as a new name (e.g.cs32_bluepill.json
), extend theopenocd_extra_args
by two entries for the CPUTAPID and useboard = cs32_bluepill
. - Directly modify the openOCD debug server invocation in the
platformio.ini
to have the right flags. E.g.
debug_server =
C:\Users\Maxi\.platformio\packages\tool-openocd\bin\openocd.exe
-s C:\Users\Maxi\.platformio\packages\tool-openocd\scripts
-f interface\stlink.cfg
-c "transport select hla_swd"
-c "set CPUTAPID 0x2ba01477"
-f target\stm32f1x.cfg
-c "reset_config none"
(use adapted path information)
3. Permanently modify C:\Users\Maxi\.platformio\packages\tool-openocd\scripts\target\stm32f1x.cfg
line 42 to have the “corrected” ID for the chinese clone.