【问题标题】:OpenOCD multiple STLinksOpenOCD 多个 STLink
【发布时间】:2017-11-27 12:12:39
【问题描述】:

我需要同时通过 2 个 ST-Link 连接到 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'

【问题讨论】:

    标签: stm32 openocd


    【解决方案1】:

    我不知道是否解决了,但是:

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

    【讨论】:

      【解决方案2】:

      配置文件的格式最近好像变了。以下适用于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"
      

      【讨论】:

        猜你喜欢
        • 2018-07-28
        • 1970-01-01
        • 2021-06-06
        • 2015-05-21
        • 1970-01-01
        • 2020-11-10
        • 2021-05-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多