Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STM32F0, ST-link v2, OpenOCD 0.9.0: open failed

Tags:

openocd

stm32

I'm using Launchpad's gcc-arm-none-eabi 4.9-2015q2 to compile for an STM32F0, and now I'd like to debug using arm-none-eabi-gdb from that collection. My ST-Link v2 is part of a Nucleo F411RE board, with external hardware (the STM32F0 target) attached. Flashing the F0 works fine, so I conclude that my SWD connections are good.

Now I want to start OpenOCD, but it fails:

$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg
Open On-Chip Debugger 0.9.0 (2015-07-26-16:02)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
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
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'

What might be wrong here?

I also couldn't establish a connection using st-util, which reported timeouts and in the end always crashed with a segmentation fault.

like image 694
Christoph Avatar asked Jul 26 '15 14:07

Christoph


1 Answers

Nucleo F411RE embedded a stlink v2-1 not stlink v2

so change the script file like this:

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

transport select hla_swd

source [find target/stm32f4x.cfg]

reset_config srst_only
like image 172
sprhawk Avatar answered Sep 24 '22 11:09

sprhawk