Solved
Openocd not able to flash a discovery board
UNEXPECTED ID code?, the discovery board is original.
the onboard stlink is updated to latest version.
If i google this Error, i get people trying to flash ST clone mcus, but mine is original.
This is my openocd.cfg file:
source [find interface/stlink.cfg]
transport select hla_swd
set WORKAREASIZE 0x2000
source [find target/stm32f1x.cfg]
#reset_config srst_only srst_push_pull srst_nogate
#connect_assert_srst
adapter srst delay 100
adapter srst pulse_width 100
bindto 0.0.0.0
init
targets
reset halt
#program bootloader.bin verify
program /stm32f0-discovery_ledblink/build/stm32f0-discovery_ledblink.bin 0x08000000 verify reset exit
reset
shutdown