This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSPM0G3507:MSPM0G3507

Guru**** 2390755 points
Other Parts Discussed in Thread: MSPM0G3507

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1497868/mspm0g3507-mspm0g3507

器件型号:MSPM0G3507

工具/软件:

大家好!

我们正在尝试使用以下存储库(https://github.com/nmenon/openocd/tree/mspm0-dev)构建 openOCD。

我们已经使用 MSYS2来构建 openocd。

——在建造 openocd 之前,我们已经安装了以下系统

Jimtcl (链接)

libusb-1.0.28

自动

autoconf

pkg-config

libtool

制造

GCC (13.3.0)

Arm GCC (arm-gnu-toolch-14.2.rel1-x86_64-arm-none-eabi (链接))

--为了构建 OpenOCD、我们使用了以下命令序列

./bootstrap

./configure --host=i686-w64-mingw32 --enable-Ftdi --enable-swd --disable-werror  

 make -j$(nproc)

 进行安装

-->启动 json 文件

  "version":"0.2.0"、

  "配置":[

    {

      "name":"MSYS OpenOCD 调试"、

      "CWD":"${workspaceRoot}"、

      "可执行文件": "c:/Users/UserName/Downloads/Repos/_Repo/vs_code_integration/thb/build/gcc/debug/temp.out、

      "请求":"附加"、

      "type":"Cortex-debug"、

      "serverType":"openocd"、

      "configFiles":[

        "C:/openocd_MSYS/tcl/interface/xds110.cfg"、

        "C:/openocd_MSYS/tcl/target/ti_mspm0.cfg"

      ]、

      "runToEntryPoint":"main"、

      "showDevDebugOutput":"raw"、

      "searchDir":[]、

      "svdPath":"c:/Users/UserNameDownloads/Repos/Repo/vs_code_integration/utils/MSPM0G350X.svd、

      "svdFile":"c:/Users/UserName/Downloads/Repos/Repo/vs_code_integration/utils/MSPM0G350X.svd

    }、

遇到上述错误。 你有什么建议吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Unknown 说:
    我们正在尝试使用以下存储库(https://github.com/nmenon/openocd/tree/mspm0-dev).
    )来构建 openOCD

    你好,你可以使用存储库的 master 分支,然后再试一次。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好,是的,我已经尝试了 master 分支。但我得到了相同的错误

    调试启动文件设置。

    错误:

    闪存启动文件设置。

    错误:

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    此错误 通常表示所提供的路径中存在错误。  我建议 再次检查设置的路径、以确认它们是否正确。

    尝试添加以下启动配置属性:

    ...
    "overrideLaunchCommands": [
        "file /full/path/to/my_executable.out"
    ],
    ...
    

    请注意、 my_executable.out 是在 executable 属性下指定的同一文件。

    下面是一个您也可以参考的示例。

    {
        ...
        "launch": {
            ...
            "configurations": [
                ...
                {
                    "cwd": "C:/Users/username/workspace/my_project/Debug",
                    "executable": "my_executable.out",
                    "name": "Debug with TI Embedded Debug for VS Code",
                    "request": "launch",
                    "type": "cortex-debug",
                    "servertype": "openocd",
                    "configFiles": [
                        "./interface/xds110.cfg",
                        "./board/ti_mspm0_launchpad.cfg"
                    ],
                    "searchDir": [
                        "C:/Users/username/openocd_win/openocd/scripts"
                    ],
                    "runToEntryPoint": "main",
                    "showDevDebugOutput": "none"
                }
                ...
            ]
            ...
        },
        ...
    }
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我以前使用过  Arm-GNU-toolchl-13.3.rel1-MinGW-w64-i686-arm-none-eab 我用于构建 .out Cortex 调试 gdb 路径 和使用 openocd 构建 GCC (13.3. )

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    不是使用 XDS 进行构建。 添加此行  --enable-xds110

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    添加了 --enable-xds110  

    --host=x86_64-w64-mingw32 --enable-Ftdi --enable-swd --disable-werror --enable-xds110  

    调试:124973 44966 target.c:2651 target_write_u32 ():地址:0x400ce210、值:0xfffffffe
    调试:124974 44966 target.c:2345 target_write_buffer ():在0x400ce130写入8字节的缓冲区
    调试:124975 44967 target.c:2651 target_write_u32 ():地址:0x400ce100、值:0x00000001
    调试:124976 44967 target.c:2563 target_read_u32 ():地址:0x400ce3d0、值:0x00000004
    调试:124977 44968 target.c:2563 target_read_u32 ():地址:0x400ce3d0、值:0x00000003
    调试:124978 44968 target.c:2651 target_write_u32 ():地址:0x400ce210、值:0x00000001
    调试:124979 44968 command.c:153 script_debug():命令- echo **编程已完成**
    调试:124980 44968 log.c:419 gdb_timeout_warning():keep_alive ()在1000毫秒的时间限制(44968毫秒)内未被调用。 这可能会导致 GDB 连接出现问题。
    用户:124981 44969 command.c:678 handle_echo():**编程完成**
    debug:124982 44969 command.c:153 script_debug ():command - reset init
    debug:124983 44969 target.c:1794 target_call_reset_callbacks():target reset 3 (init)
    调试: 124984 44969 command.c:153 script_debug (): command - target names
    debug:124985 44969 command.c:153 script_debug():command - mspm0x.cpu invoke-event reset-start
    调试: 124986 44969 command.c:153 script_debug (): command - transport select
    调试:124987 44969 command.c:153 script_debug ():command - transport select
    debug:124988 44969 command.c:153 script_debug():command - mspm0x.cpu invoke-event exame-start
    debug:124989 44969 target.c:4681 target_handle_event ():target:mspm0x.cpu (cortex_m) event:19 (exame-start) action:_mspm0_enable_low_pow_mode
    debug:124990 44969 command.c:153 script_debug ():command - mspm0x.DAP apreg 4 0x00 0x104008
    调试:124991 44969 arm_adi_v5.c:1193 dap_get_ap ():refcount ap#0x4 get 1
    调试:124992 44970 arm_adi_v5.c:1218 dap_put_ap ():refcount AP#0x4 Put 0
    调试:124993 44970 command.c:153 script_debug ():命令- mspm0x.DAP apreg 4 0xF0 0x01
    调试:124994 44970 arm_adi_v5.c:1193 dap_get_ap ():refcount AP#0x4 get 1
    调试:124995 44970 arm_adi_v5.c:1218 dap_put_ap ():refcount AP#0x4 Put 0
    debug:124996 44970 command.c:153 script_debug ():命令- mspm0x.DAP apreg 4 0x00 0x100008
    调试:124997 44970 arm_adi_v5.c:1193 dap_get_ap ():refcount AP#0x4 get 1
    调试:124998 44971 arm_adi_v5.c:1218 dap_put_ap ():refcount AP#0x4 Put 0
    debug:124999 44971 command.c:153 script_debug():command - mspm0x.cpu arp_examine allow-delay
    调试:125000 44971 arm_adi_v5.c:934 mem_ap_init ():MEM_AP CFG:大数据0、长地址0、大端字节序0
    debug:125001 44972 command.c:153 script_debug():command - mspm0x.cpu invoke-event exame-end
    debug:125002 44972 command.c:153 script_debug ():command - mspm0x.cpu invoke-event reset-assert-pre
    调试:125003 44972 command.c:153 script_debug ():command - transport select
    debug:125004 44972 command.c:153 script_debug ():command - mspm0x.cpu arp_reset 置位1
    调试: 125005 44972 target.c:2131 target_free_all_working_arease_restore ():释放所有工作区域
    调试:125006 44972 cortex_m.c:1691 cortex_m_assert_reset():[mspm0x.cpu] target->state:已停止、已检查
    调试:125007 44973 cortex_m.c:1806 cortex_m_assert_reset ():[mspm0x.cpu]使用 Cortex-M SYSRESETREQ
    调试:125008 44973 arm_adi_v5.c:859 dap_dp_init_or_reconnect ():mspm0x.dap
    调试:125009 44974 arm_adi_v5.c:783 dap_dp_init ():mspm0x.dap
    调试:125010 44974 arm_adi_v5.c:816 dap_DP_init ():DAP:等待 CDBGPWRUPACK
    调试:125011 44974 ARM_Adi_v5.h:682 DAP_DP_POLL_REGISTER ():DAP:轮询4、掩码0x20000000、值0x20000000
    调试:125012 44974 arm_adi_v5.c:824 dap_DP_init ():DAP:等待 CSYSPWRUPACK
    调试:125013 44974 arm_adi_v5.h:682 DAP_DP_POLL_REGISTER ():DAP:轮询4、掩码0x80000000、值0x80000000
    调试:125014 44974 xds110.c:1333 xds110_SWD_queue_cmd ():XDS110:拒绝启用粘滞溢出检测
    debug:125015 45027 command.c:153 script_debug ():command - mspm0x.cpu invoke-event reset-assert-post
    debug:125016 45027 command.c:153 script_debug ():command - mspm0x.cpu invoke-event reset-deassert-pre
    调试: 125017 45027 command.c:153 script_debug (): command - transport select
    debug:125018 45027 command.c:153 script_debug ():command - mspm0x.cpu arp_reset deassert 1.
    调试: 125019 45027 target.c:2131 target_free_all_working_arease_restore ():释放所有工作区域
    调试:125020 45027 cortex_m.c:1849 cortex_m_deassert_reset():[mspm0x.cpu] target->state:reset、executed
    debug:125021 45027 command.c:153 script_debug ():command - mspm0x.cpu invoke-event reset-deassert-post
    调试: 125022 45027 command.c:153 script_debug (): command - transport select
    debug:125023 45027 command.c:153 script_debug():command - mspm0x.cpu was_executed
    debug:125024 45027 command.c:153 script_debug ():command - mspm0x.cpu arp_waitstate halted 1000
    调试:125025 45028 cortex_m.c:1012 cortex_m_poll_pone ():[mspm0x.cpu]使用 DCB_dhcsr 0x30003退出复位状态
    调试:125026 45028 cortex_m.c:619 cortex_m_endreset_event ():[mspm0x.cpu] DCB_DEMCR = 0x01000401
    调试:125027 45028 target.c:2651 target_write_u32 ():地址:0xe0002000、值:0x00000003
    调试:125028 45029 target.c:2563 target_read_u32 ():地址:0xe0002000、值:0x00000041
    调试:125029 45029 target.c:2651 target_write_u32 ():地址:0xe0002008、值:0x00000000
    调试:125030 45029 target.c:2651 target_write_u32 ():地址:0xe000200c、值:0x00000000
    调试:125031 45030 target.c:2651 target_write_u32 ():地址:0xe0002010、值:0x00000000
    调试:125032 45030 target.c:2651 target_write_u32 ():地址:0xe0002014、值:0x00000000
    调试:125033 45031 target.c:2651 target_write_u32 ():地址:0xe0001020、值:0x00000000
    调试:125034 45031 target.c:2651 target_write_u32 ():地址:0xe0001024、值:0x00000000
    调试:125035 45031 target.c:2651 target_write_u32 ():地址:0xe0001028、值:0x00000000
    调试:125036 45032 target.c:2651 target_write_u32 ():地址:0xe0001030、值:0x00000000
    调试:125037 45032 target.c:2651 target_write_u32 ():地址:0xe0001034、值:0x00000000
    调试:125038 45032 target.c:2651 target_write_u32 ():地址:0xe0001038、值:0x00000000
    调试:125039 45033 cortex_m.c:852 cortex_m_debug_entry ():[mspm0x.cpu]
    调试:125040 45034 cortex_m.c:557 cortex_m_clear_halt ():[mspm0x.cpu] NVIC_DFSR 0x9
    调试:125041 45036 cortex_m.c:359 cortex_m_fast_read_all_regs ():[mspm0x.cpu]读取20个32位寄存器
    调试:125042 45036 cortex_m.c:922 cortex_m_debug_entry():[mspm0x.cpu]在核心模式下进入调试状态:线程在 PC 0x3f98、CPU 处于非安全状态、目标->状态:已停止
    debug : 125043 45036 target.c:1775 target_call_event_callbacks():核心 mspm0x.cpu 的目标事件0 (gdb-halt)
    debug:125044 45036 target.c:1775 target_call_event_callbacks():核心 mspm0x.cpu 的目标事件1 (暂停)
    用户: 125045 45036 armv7m.c:771 armv7m_arch_state():[mspm0x.cpu]由于断点而停止,当前模式:线程
    xPSR:0xf1000000 PC:0x00003f98 MSP:0x20208000
    debug:125046 45036 command.c:153 script_debug():command - mspm0x.cpu curstate
    调试: 125047 45037 command.c:153 script_debug (): command - transport select
    debug:125048 45037 command.c:153 script_debug():command - mspm0x.cpu was_executed
    debug:125049 45037 command.c:153 script_debug ():command - mspm0x.cpu arp_waitstate 已暂停5000
    debug:125050 45037 command.c:153 script_debug ():command - mspm0x.cpu invoke-event reset-init
    调试:125051 45037 command.c:153 script_debug ():command - mspm0x.cpu invoke-event reset-end
    INFO:125052 45038 server.c:298 add_service():侦听端口50001的 TCL 连接
    INFO:125053 45038 server.c:298 add_service():侦听端口50002的 telnet 连接
    debug : 125054 45038 command.c:153 script_debug (): command - init
    错误:125055 45039 server.c:504 server_loop():选择时出错:文件描述符错误
    debug:125056 45039 breakpoints.c:328 breakpoint_remove_all_internal ():[mspm0x.cpu]删除所有断点
    调试:125057 45039 arm_adi_v5.c:1218 dap_put_ap ():refcount ap#0x0 put 0
    调试: 125058 45039 target.c:2131 target_free_all_working_arease_restore ():释放所有工作区域
    调试:125059 45039 xds110.c:1118 xds110_SWD_SWITCH_Seq ():SWD-to-JTAG
    INFO:125060 45142 xds110.c:451 usb_disconnect(): XDS110: disconnected
    [2025-04-09T15:32:47.046Z]服务器控制台调试:onBackendConnect:gdb-server 会话已关闭
    gdb 服务器会话已结束。 此终端将被重复使用、等待下一个会话开始...

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    能否从参数列表中删除 TCL 和 telnet 、看看它是否改变了行为。 您正在使用 GDB 进行调试、因此其他两个版本没有任何用途、我想知道这是否会导致您看到的文件描述符错误。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我已从参数中删除了 TCL 和 telnet。

    下面是我的启动 json 文件。

      "配置":[
        {
          "name":"使用针对 VS Code 的 TI 嵌入式调试进行调试"、
          "CWD":"c:/openOCD_09_04_2025/thb/thb/build/gcc/debug"、
          "可执行文件":"thb.out"、
          "请求":"启动"、
          "type":"Cortex-debug"、
          "serverType":"openocd"、
          "gdbTarget":"localhost:50000"、
          "runToEntryPoint":"main"、
          "showDevDebugOutput":"none"、

          "configFiles":[
            "interface/xds110.cfg"、
            "target/ti_mspm0.cfg"
          ]、
          "searchDir":[
            "C:/openOCD_09_04_2025/openocd/openocd/tcl"
          ]、

          "overrideLaunchCommands":[
            "file thb.out"、
            "目标远程 localhost:50000"
          ]、

          "serverArgs":[
            "-c"、"适配器速度5000"、
            "-d"、
            "-c"、"gdb 端口50000"、
            "-c"、"Program C:/openOCD_09_04_2025/thb/thb/build/gcc/debug/thb.out"、
            "-c"、"reset init"
          ]
        }
      ]
    }
    错误:
    目标仍然断开连接、

      

    下面是 openocd 配置摘要。 是否缺少任何内容或需要禁用?

    目前、我正在使用 Mspm0g3507 LaunchPad 调试器部分与目标进行通信(即、目标是我的项目板。 安装 MSPM0G3507控制器)

    如果可能,您能否与我分享 openocd 编译步骤并启动 json 和设置文件,使用哪个编程和调试工作从您的终端?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    您说过您在 LaunchPad 中使用调试器来调试自应用板。 您使用哪些引脚进行连接?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、谢

    我使用的是 xdx110 OUT 连接器  

     

    连接器引脚

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    下面是 OpenOCD 设置的一般指南、您能检查它是否适合您吗?

    e2e.ti.com/.../OpenOCD-Setup-Guidance.pdf

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你(们)好  

    我遵循 OpenOCD 设置指南我得到了以下结果.

    "是啊,我想用 VSCode 来调试代码  

    -> launch.json 文件  

    -> settings.json 文件

    -->  

    调试会话不是从 main.c 开始、它显示文件未找到。 对此有何建议?

    以及调试标志的禁用

    [2025-04-21T06:56:36.452Z]服务器控制台调试:onBackendConnect:gdb-server 会话已连接。 您可以切换到"调试控制台"以查看 GDB 交互。
    "c:/cygwin64/home/Prajesh.Karmalkar/openocd-0.12.0/clanocd/openocd.exe"-c "gdb_port 50000"-c "tcl_port 50001"-c "telnet_port 50002"-s "C:\openocd_tisag_18_04_25\thb"-"-cylink.cfg/openc/cyhome/geshome.cc/openc/cycl/openc.cfg.b"-link.cc/cycl/openc/cyb/ src:/openc/cys.home.html /Users/prajesh.karmalkar/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl
    打开片上调试器0.12.0
    在 GNU GPL v2下获得许可
    有关错误报告、请阅读
    openocd.org/.../bugs.html
    CDLiveWatchSetup
    INFO:自动选择第一个可用会话传输"SWD"。 要覆盖、请使用"传输选择" "。
    Cortex_m reset_config sysresetreq

    适配器速度:5000 kHz

    INFO:正在侦听端口50001中的 TCL 连接
    INFO:侦听端口50002的 telnet 连接
    信息:XDS110:已连接
    INFO:XDS110:VID/pid = 0451/bef3
    信息:XDS110:固件版本= 3.0.0.32
    信息:XDS110:硬件版本= 0x0028
    信息:XDS110:通过 SWD 连接到目标
    信息:XDS110:SWCLK 设置为2500kHz
    信息:时钟速度5000 kHz
    信息:SWD DPIDR 0x6ba02477
    信息:检测到[msp432.cpu] Cortex-M0+ r0p1处理器
    INFO:[msp432.cpu] target 有4个断点、2个观察点
    info:在50000上为 msp432.cpu 启动 gdb 服务器
    INFO:正在侦听 gdb 连接的端口50000
    INFO:在 TCP/50000上接受'gdb'连接
    未定义的调试原因8 -目标需要复位
    [msp43.cpu]由于 debug-request、Current mode:thread 而停止
    xPSR:0xf1000000 PC:0x00003f98 MSP:0x20208000

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    上面的 Pengfei 提供的示例展示了如何对 MSP432执行该操作、同样的方法也可应用于 MSPM0。 请将配置切换为使用 MSPM0而不是 MSP432、因为您将其用于 MSPM0器件。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你(们)好  

    是、但 openocd 目标文件夹中没有与 mspm0相关的配置文件、如下所示。 在这种情况下该怎么做?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    请克隆项目的主分支。 您不在主分支上。

    Pengfei 提供的示例展示了如何编译它的步骤、但它指向不同版本的 OpenOCD 项目。

    这些是您需要遵循的步骤。

    1)克隆 OpenOCD 项目的主分支

    2)使用提供的步骤进行构建

    谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Henry、根据您的建议、我已完成上述步骤。 但是  

    调试会话无法找到如上图所示的 main.c 文件。

    启动.json

        {
          "CWD""${workspaceRoot}"
          "可执行文件""c:/openOCD_tisag_18_04_25/thb/build/gcc/debug/thb.out"
          "name""debug"
          "请求""附加"
          //"请求":"启动"、
          "type""Cortex-debug"
          "serverType""openocd"
          "configFiles":[
            "C:/cygwin64/home/user_name/openocd/tcl/interface/xds110.cfg"
            "C:/cygwin64/home/user_name/openocd/tcl/target/ti_mspm0.cfg"
          ]、
          "searchDir":[]、
          "runToEntryPoint""main"
          "showDevDebugOutput":"raw"
          "serverArgs":[
            "-c""适配器速度1000"
            //"-d"、
            //"-c"、"gdb 端口50000"、
            //"-c"、"Program C:/openOCD_tisag_18_04_25/thb/build/gcc/debug/thb.out"、
            //"-c"、"reset init"

          ]
        }、
    settings.json 中找到
      "Cortex-debug.gdbPath""c:/cygwin64/bin/gdb-multisarch.exe"
      "Cortex-debug.openocdPath""c:/cygwin64/home/user_name/openocd/openocd/openocd.exe" src