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.

[参考译文] TMS570LC4357:使用 HDK 进行 OpenOCD 调试

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1501096/tms570lc4357-openocd-debug-with-hdk

器件型号:TMS570LC4357

工具/软件:

大家好、我尝试使用 OpenOCD 和 VSCode 调试 Hercules 电路板、但遇到了几个问题。 当前阻止我的一个命令是尝试将二进制文件加载到电路板中。 从 openOCSD 我会收到以下调试消息:

debug:262 239 command.c:153 script_debug ():command - TMS570.cpu invoke-event reset-end
调试:263 240 gdb_server.c:400 gdb_log_output_packet():[tms570.cpu]{1}发送数据包:$OK#9a
调试:264 245 gdb_server.c:383 gdb_log_incoming_packet ():[TMS570.cpu]{1}接收到的数据包:X0、0:
调试:265 245 gdb_server.c:400 gdb_log_output_packet ():[TMS570.cpu]{1}正在发送数据包:$OK#9a
调试:266 245 gdb_server.c:375 gdb_log_incoming_packet():[TMS570.cpu]{1}接收到的数据包:X0、20:
调试:267 245 gdb_server.c:400 gdb_log_output_packet():[TMS570.cpu]{1}发送数据包:$OK#9a
debug:268 245 gdb_server.c:1679 gdb_write_memory_binary_packet():地址:0x0、长度:0x00000020
debug:269 245 target.c:2344 target_write_buffer ():在0x00000000写入32字节的缓冲区
debug:270 245 cortex_a.c:2753 cortex_a_write_phys_memory():将内存写入实际地址0x00000000;大小4;计数8
调试:271 245 cortex_a.c:2251 cortex_a_write_cpu_memory():正在写入 CPU 内存地址0x0大小4计数8.
调试:272 247 cortex_a.c:292 cortex_a_exec_opode():可执行操作码0xee160f10
调试:273 248 cortex_a.c:292 cortex_a_exec_opode():可执行操作码0xee000e15
调试:274 250 cortex_a.c:292 cortex_a_exec_opode():可执行操作码0xee150f10
调试:275 251 cortex_a.c:292 cortex_a_exec_opode():可执行操作码0xee000e15
调试:276 253 cortex_a.c:292 cortex_a_exec_opode():可执行操作码0xee100e15
调试:277 256 gdb_server.c:375 gdb_log_incoming_packet():[TMS570.cpu]{1}接收到的数据包:x20、3fa0:
debug:278 256 gdb_server.c:1493 gdb_error():将-4作为一般错误报告给 GDB
调试:279 256 gdb_server.c:400 gdb_log_output_packet ():[tms570.cpu]{1}正在发送数据包:$E0E#ba
debug:280 256 gdb_server.c:1679 gdb_write_memory_binary_packet():Addr:0x20、len:0x00003fa0
debug:281 256 target.c:2344 target_write_buffer ():在0x00000020写入16288字节的缓冲区
debug:282 256 cortex_a.c:2753 cortex_a_write_phys_memory():将内存写入实际地址0x00000020;大小4;计数4072
调试:283 256 cortex_a.c:2251 cortex_a_write_cpu_memory():正在写入 CPU 内存地址0x20大小4计数4072
调试:284 259 cortex_a.c:292 cortex_a_exec_opode():可执行操作码0xee160f10
调试:285 259 server.c:608 SIG_HANDLER ():在信号15上终止

这表示我能够编写矢量表、但在尝试编写下一个矢量表时失败。 根据我所研究的内容、也许我需要在 openOCD 中为我的确切闪存配置配置特定的目标、或者我需要 SoM 类型的特定驱动程序才能成功地写入闪存。 有人能帮忙吗?

我的 launch.json 命令:

      "name""Debug ASW_HDK Linux"
      "CWD""${workspaceFolder}/"
      "可执行文件""/ASW_HDK.elf"
      "请求""启动"
      "type""Cortex-debug"
      "serverType""openocd"
      "configFiles":[
        "board/ti_tmdx570lc4357.cfg"
      ]、
      "searchDir":[
        "${workspaceFolder}/tools/Debug_cfg
      ]、
      "runToEntryPoint""main"
      "showDevDebugOutput":"raw"
      "设备""TMS570"
      "armToolchainPath"/tools/gcc-arm-none-eabi-7-2018-q2-update/bin
      "toolchainPrefix""arm-none-eabi"
      "serverpath"/tools/xpack-openocd-0.12.0-6/bin/openocd
      "preRestartCommands":[
        "显示器复位"
      ]、
      "openOCDLaunchCommands":[
        "DEBUG_LEVEL 3"
      ]
      //"preLaunchTask":"ASW_PB:build"
    }、
对于 OpenOCD 配置、我创建了一个 cfg 文件、其中包含以下内容:
ti_tmdx570lc4357.cfg 上找到
源[查找接口/FTDI/xds100v2.cfg]
传输选择 JTAG

源[查找 target/ti_tms570lc4357.cfg]

RESET_CONFIG trst_only

Init
FTDI SET_SIGNAL PWR_RST 1
JTAG arp_init
TARGET/ti_tms570lc4357.cfg
设置 DAP_TAPID 0x1B95A09F
设置 JRC_TAPID 0x1B95A09F
源[查找 target/ti_TMS570.cfg]
xds100v2和 TMS570是 openOCD 安装附带的故障部件