I was having a problem recording my bluepill, below is the error message.
Open On-Chip Debugger 0.10.0+dev-01438-gc1f4d9e6e (2020-10-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 1000 kHz
Info : STLINK V2J39S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.281338
Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477
in procedure ‘program’
** OpenOCD init failed **
shutdown command invoked
make.exe: *** […/config/dashboard.mk:139: flash] Error 1
make.exe: Leaving directory ‘C:/Users/projetos5/blue-pill1/build’
After some research, I got feedback that the bluepill I’m using was a pirated version of the STM32f103…
To resolve the error, I edited the stm32f1x.cfg file in the Embeetle folder (embeetle\beetle_tools\windows\openocd_0.10.0_dev01438_64b\scripts\target)
follow the modified line
#jtag scan chain
if { [info exists CPUTAPID] } {
set _CPUTAPID $CPUTAPID
} else {
if { [using_jtag] } {
# See STM Document RM0008 Section 26.6.3
set _CPUTAPID 0x3ba00477
} {
# this is the SW-DP tap id not the jtag tap id
#set _CPUTAPID 0x1ba01477
set _CPUTAPID 0x2ba01477
}
}