2

I am trying to use openocd to debug my stm32 bluepill (stm32f103c8t6). I have it connected with an ST-Link V2 which works fine through the ST-Link Utility (connecting, flashing, ...). When I try to use it via openocd I get the following error:

F:\Tools\openocd\openocd.exe -f "F:\bluepill.cfg"
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'

Running it with configurations provided by Clion yielded the same result.

bluepill.cfg

source [find interface/stlink-v2-1.cfg]

transport select hla_swd

source [find target/stm32f1x.cfg]

reset_config none separate

I tried the answers suggested in this thread without success.

What exactly does the error message mean and what am I missing here?

Florg
  • 21
  • 2
  • Change the reset control to `reset_config connect_assert_srst` perhaps? – Clifford Feb 15 '20 at 04:26
  • @Clifford This yields the same result unfortunately – Florg Feb 15 '20 at 09:43
  • Ok. I see your linked thread includ s a similar suggestion. There are other reset options and modifiers the documentation described it as finicky. So possibly worth further investigation. One thread I found even suggested applying the reset manually during connection. – Clifford Feb 15 '20 at 09:55

1 Answers1

1

I had the exact same error as you have. I did a full chip erase using st link utility and it works perfectly for me now. I used this:

openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg

modify it for your use on windows and let me know if it works!

jugal
  • 11
  • 1