OpenOCD多个STLink

时间:2017-11-27 12:12:40

标签: stm32 openocd

我需要同时通过2个ST-Links连接到2个STM32。我发现此问题描述为here

然而,解决方案对我不起作用。

ST-Link ID1:55FF6B067087534923182367
ST-Link ID2:49FF6C064983574951291787

OpenOCD cfg文件:

source [find interface/stlink-v2.cfg]
hla_serial "55FF6B067087534923182367"

source [find target/stm32f4x.cfg]

# use hardware reset, connect under reset
reset_config srst_only srst_nogate

我明白了:

$ openocd.exe -f stm32f4_fmboard.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 : 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: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'

2 个答案:

答案 0 :(得分:0)

我不知道是否解决但是:

pi@raspberrypi:~/prog/bootloader $ st-info --probe
Found 1 stlink programmers
serial: 363f65064b46323613500643
openocd: "\x36\x3f\x65\x06\x4b\x46\x32\x36\x13\x50\x06\x43"
flash: 0 (pagesize: 0)
sram: 0
chipid: 0x0000
descr: unknown device

此工具显示了一系列st-links,并且有一个名为openocd的选项。当我将hla_serial "\x36\x3f\x65\x06\x4b\x46\x32\x36\x13\x50\x06\x43"放入文件中时,它对我有用。你的方式没有。它也不能在作为参数给出的命令行中工作。它只能按我在cfg文件中描述的那样工作

答案 1 :(得分:0)

配置文件的格式最近似乎已更改。以下内容适用于Open On-Chip Debugger 0.10.0+dev-00634-gdb070eb8 (2018-12-30-23:05)

使用lsusbst-linkls -l /dev/serial/by-id查找序列号。后者产生(连接两个STLink / V2.1):

total 0
lrwxrwxrwx 1 root root 13 Nov 30 14:31 usb-STMicroelectronics_STM32_STLink_066CFF323535474B43125623-if02 -> ../../ttyACM0
lrwxrwxrwx 1 root root 13 Dec 30 23:55 usb-STMicroelectronics_STM32_STLink_0672FF485457725187052924-if02 -> ../../ttyACM1

.cfg文件上的规范现在为普通十六进制不要不再使用C字符串语法。要选择后一种设备,只需编写:

#hla_serial "066CFF323535474B43125623"
hla_serial "0672FF485457725187052924"