gpt4 book ai didi

debugging - OpenOCD + STLINK-V3SET 是否支持在菊花链配置中调试多个 Controller ?

转载 作者:行者123 更新时间:2023-12-04 04:13:06 25 4
gpt4 key购买 nike

我想使用我的 STLINK 适配器进行多核调试。
我有使用其他工具调试的经验(例如,来自 Lauterbach 的 uTrace/Trace32)。
现在,我想在家里设置一个多核安排作为一个爱好项目 - 我没有 uTrace,但只有不同版本的 STLink(便宜得多)。可悲的是,我完全没有使用 OpenOCD 的经验。
非常感谢任何帮助!

到目前为止我做了什么

  • RTFM.1 我在手册中看到了许多典型的用例,但没有系统地描述哪些命令包含/需要(哪些)子命令。这阻碍了识别我的(异国情调?)用例的解决方案。
  • 设置一个有效的单核 OpenOCD 配置:
  • 生成的配置文件使用安装中的示例 OpenOCD 脚本文件:stlink.cfg (接口(interface):hla),stm32f1x.cfg ( swj-dp.tcl , mem_helper.tcl )
  • 该设置运行良好 - 但仅适用于单个板/核心......!
    尽管如此,它仍然表明我的 STLINK 和目标板没问题,并且工具版本(原则上)可以相互通信。
  • 在我的 STM32CubeIDE 安装中检查了其他 OpenOCD 示例文件。
    stm32h7x_dual_core.cfg是为错误的 µ Controller 制造的,但它包含一个双核选项。在里面,我发现了这个警告:
    # Issue a warning when hla is used, and fallback to single core configuration
    if { [set $_CHIPNAME.DUAL_CORE] && [using_hla] } {
    echo "Warning : hla does not support multicore debugging"
    set $_CHIPNAME.DUAL_CORE 0
    }

    因此,interface hla不能用于多核调试 (就这个评论是正确的,我理解)。

  • [编辑]

    描述了 STM32H7 系列中双核变体的集成
    here .
    尽管如此,这些 Controller 在 JTAG 链中仅包含一个 TAP,它允许访问位于其后面的内部总线上的多个访问端口 (AP)。

    [/编辑]

    以下步骤描述了我如何尝试让 STLINK/JTAG 配置为单个板运行,其接口(interface)设置与 hla 不同。 .
  • 寻找其他interface OpenOCD 中的选项

    OpenOCD 支持许多不同的接口(interface),
         **C:\Temp>** C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050\tools\bin\openocd.exe -c "interface st-link" -c "transport list"
    Open On-Chip Debugger 0.10.0+dev-01193-g5ce997d (2020-02-20-10:57)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    The following transports are available:
    jtag
    aice_jtag
    stlink_swd
    stlink_jtag
    swd
    stlink_swim
    hla_jtag
    hla_swd
    [...]

    但与我的 STLINK 一起,我得到了 interface - 相关的错误消息,除非我选择 hla选项或以下两种之一:
  • stlink_swd - SWD 不支持菊花链,所以这不是我的选择!
  • stlink_jtag - JTAG 是我正在寻找的,但这似乎不起作用:

    使用以下最小 (?) 脚本
        interface st-link
    transport select stlink_jtag

    我没有连接,但以下日志(激活大量调试):
        Debug: 17 15 options.c:184 add_default_dirs(): bindir=/src/work/openocd/win32/build/bin
    Debug: 18 15 options.c:185 add_default_dirs(): pkgdatadir=/src/work/openocd/win32/build/share/openocd
    Debug: 19 15 options.c:186 add_default_dirs(): exepath=C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050/tools/bin
    Debug: 20 15 options.c:187 add_default_dirs(): bin2data=../share/openocd
    Debug: 21 15 configuration.c:42 add_script_search_dir(): adding C:\Users\x\AppData\Roaming/OpenOCD
    Debug: 22 15 configuration.c:42 add_script_search_dir(): adding C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050/tools/bin/../share/openocd/site
    Debug: 23 15 configuration.c:42 add_script_search_dir(): adding C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050/tools/bin/../share/openocd/scripts
    Debug: 24 15 configuration.c:97 find_file(): found openocd.cfg
    Debug: 25 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface st-link
    Debug: 26 15 command.c:143 script_debug(): command - interface ocd_interface st-link
    Debug: 28 15 command.c:364 register_command_handler(): registering 'ocd_st-link'...
    Debug: 29 15 command.c:364 register_command_handler(): registering 'ocd_st-link'...
    Debug: 30 15 command.c:364 register_command_handler(): registering 'ocd_st-link'...
    Debug: 31 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select stlink_jtag
    Debug: 32 15 command.c:143 script_debug(): command - ocd_transport ocd_transport select stlink_jtag
    Debug: 33 15 adi_v5_stlink.c:223 stlink_jtag_select(): stlink_jtag_select()
    Debug: 34 15 command.c:364 register_command_handler(): registering 'ocd_stlink_dap'...
    User : 35 15 command.c:693 command_run_line(): stlink_jtag
    User : 36 15 command.c:695 command_run_line():
    Info : 37 15 server.c:311 add_service(): Listening on port 6666 for tcl connections
    Info : 38 15 server.c:311 add_service(): Listening on port 4444 for telnet connections
    Debug: 39 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
    Debug: 40 15 command.c:143 script_debug(): command - init ocd_init
    Debug: 42 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
    Debug: 43 15 command.c:143 script_debug(): command - ocd_target ocd_target init
    Debug: 45 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
    Debug: 46 15 command.c:143 script_debug(): command - ocd_target ocd_target names
    Debug: 47 15 target.c:1438 handle_target_init_command(): Initializing targets...
    Debug: 48 15 stlink_usb.c:3755 stlink_dap_init(): stlink_dap_init()
    Debug: 49 15 stlink_usb.c:2674 stlink_usb_open(): stlink_usb_open
    Debug: 50 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3744 serial:
    Debug: 51 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3748 serial:
    Debug: 52 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374b serial:
    Debug: 53 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3752 serial:
    Debug: 54 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374d serial:
    Debug: 55 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374e serial:
    Debug: 56 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374f serial:
    Debug: 57 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3753 serial:
    Info : 58 46 stlink_usb.c:1000 stlink_usb_version(): STLINK V3J6M2B4S1 (API v3) VID:PID 0483:374F
    Info : 59 46 stlink_usb.c:2810 stlink_usb_open(): using stlink api v3
    Debug: 60 46 stlink_usb.c:1230 stlink_exit_mode(): MODE: 0x01
    Debug: 61 46 stlink_usb.c:1278 stlink_usb_init_mode(): MODE: 0x01
    Info : 62 46 stlink_usb.c:1032 stlink_usb_check_voltage(): Target voltage: 3.278671
    Debug: 63 46 stlink_usb.c:1303 stlink_usb_init_mode(): MODE: 0x01
    Debug: 64 46 stlink_usb.c:1130 stlink_usb_mode_enter(): stlink_usb_mode_enter(JTAG)
    Debug: 65 46 stlink_usb.c:740 stlink_usb_error_check(): UNKNOWN_JTAG_CHAIN
    Error: 66 46 stlink_usb.c:2819 stlink_usb_open(): init mode failed (unable to connect to the target)
    Debug: 67 46 stlink_usb.c:1230 stlink_exit_mode(): MODE: 0x01
    Debug: 68 46 command.c:642 run_command(): Command failed with error code -4
    User : 69 46 command.c:705 command_run_line():
  • 检查 OpenOCD 邮件列表文件。

    有一些迹象表明,早期的 OpenOCD 版本不支持多核 JTAG+STLINK,但是我不明白 OpenOCD 中关于 STLINK 驱动程序代码的一些(初步?)更改。
    因此,我仍然想知道当前的状态是什么。

  • 问题

    有谁知道 OpenOCD 是否完全通过 STLINK 支持 JTAG,或者我是否在徒劳地尝试?
    我是否必须添加正确的 JTAG 链/TAP/目标定义来消除基本错误消息,或者进一步尝试没有意义?

    详情 - 我正在使用以下工具版本:
  • 适用于 Windows 的 STM32CubeIDE,版本:1.3.1(内部版本:6291_20200406_0752 (UTC)),
    包括
  • OpenOCD,版本 0.10.0+dev-01193-g5ce997d (2020-02-20-10:57)
  • STLINK-V3SET ( Info : STLINK V3J6M2B4S1 (API v3) VID:PID 0483:374F )
  • 目标板:2x MCBSTM32 , 包含
    STM32F103RB
    (使用核板(STM32F4/STM32L4)我可以尝试同样的方法——但我认为这不是重点)。


  • 1
    《OpenOCD 用户指南》,0.10.0+dev,STM,2020 年 2 月 20 日(st-openocd.pdf,STM32CubeIDE 安装的一部分)

    最佳答案

    可能有点晚了,但是:
    从 UM2448
    “STLINK-V3SET 不支持在 JTAG(菊花链)中链接设备。

    关于debugging - OpenOCD + STLINK-V3SET 是否支持在菊花链配置中调试多个 Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61371878/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com