Where is the STM32 Debug.cfg file?

I’m usually using the CubeIDE and I upload with St-link v2. Somehow I get the error:

Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477

I know how to solve this, I just add

set CPUTAPID 0x2ba01477

to the .cfg file. But where can I find this configuration file on the PlatformIO system? I can’t find it anywhere.

Have a look in C:\Users\username\.platformio\packages\tool-openocd\scripts\target (for Windows).


You are the owner of the chinese fake / clone STM32 chips called CS32F103C8T6 instead of a real STM32F103C8T6 .

This topic and the solution is discussed here: Cannot upload to STM32 Bluepill board over STLink-V2 - #13 by manuelbl