Debugging of STM32F103 clone "BluePill" board, wrong idcode

I had the same issue I fixed it by doing the following,
open the file specified below and make the changes
specified, do remember to keep a backup of the file if
things get messed up.
File: [openocd dir]/scripts/target/stm32f1x.cfg
Change: ‘set _CPUTAPID 0x1ba01477’ to ‘set _CPUTAPID 0x2ba01477’

note: in GNU/Llinux the openocd used by platformio is located at ‘/home/user/.platformio/packages/tool-openocd’