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

I am using Launchpad gcc-arm-none-eabi 4.9-2015q2 to compile for STM32F0, and now I would like to debug using arm-none-eabi-gdb from this collection. My ST-Link v2 is part of a Nucleo F411RE board with connected external equipment (target STM32F0). Flashing F0 works great, so I came to the conclusion that my SWD connections are good.

Now I want to run OpenOCD , but it does not work:

$ 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 could be wrong here?

I was also unable to establish a connection using st-util, which reported timeouts and ended up always crashing with a segmentation fault .

+6
source share
3 answers

Nucleo F411RE built in stlink v2-1, not stlink v2

modify the script file as follows:

 source [find interface/stlink-v2-1.cfg] transport select hla_swd source [find target/stm32f4x.cfg] reset_config srst_only 
+7
source

The stlink-v2.cfg may be fine. You should probably use the stlink-v2-1.cfg (inside this file is hla_vid_pid 0x0483 0x3748 ).

0
source

I found a fix. The VID / PID pair in the stlink-v2.cfg file was incorrect. They had this:

hla_vid_pid 0x0483 0x3748

but it should be like this:

hla_vid_pid 0x0483 0x374 B

letter "B", not the number "8".

-1
source

All Articles