Florg
Florg

Reputation: 21

Why does OpenOCD fail, when the ST-Link Utility works?

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?

Upvotes: 2

Views: 2154

Answers (1)

jugal
jugal

Reputation: 11

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!

Upvotes: 1

Related Questions