1

我需要同时通过 2 个 ST-Link 连接到 2 个 STM32。我发现这里描述的这个问题

但是,解决方案对我不起作用。

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

OpenOCD 配置文件:

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'
4

2 回答 2

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文件中描述的那样工作

于 2018-02-26T14:54:53.273 回答
0

配置文件的格式最近好像变了。以下适用于Open On-Chip Debugger 0.10.0+dev-00634-gdb070eb8 (2018-12-30-23:05)

lsusb用、st-link或找出序列号ls -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-file上的规范现在是普通的 hex不再使用 C 字符串语法。要选择后一种设备,只需编写:

#hla_serial "066CFF323535474B43125623"
hla_serial "0672FF485457725187052924"
于 2018-12-30T23:51:13.797 回答