当我调用openocd (它是linux可执行文件)时,它给了我如下信息:
./openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /mnt/c/Users/Administrator/Desktop/work/ODrive/Firmware -f interface/stlink.cfg -f target/stm32f7x.cfg -c "reset_config none separate"
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-12-07-17:30)
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
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
none separate
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 2000 kHz
Error: open failed
由于我们不能从WSL调用avalible设备,所以我们在WSL中调用.exe作为替代。
/mnt/c/openocd/bin/openocd.exe -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /mnt/c/Users/Administrator/Desktop/work/ODrive/Firmware -f interface/stlink.cfg -f target/stm32f7x.cfg -c "reset_config none separate"Open On-Chip Debugger 0.11.0+dev-00572-g94e7535be (2022-02-19-14:36)
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
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
none separate
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 2000 kHz
Info : STLINK V2J29M18 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.224258
Info : stm32f7x.cpu: Cortex-M7 r1p1 processor detected
Info : stm32f7x.cpu: target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f7x.cpu on 50000
Info : Listening on port 50000 for gdb connections
然后,我们成功地检测到了WSL中的stm设备。
但当我从VSCode开始。使用
{
// For the Cortex-Debug extension
"type": "cortex-debug",
"servertype": "openocd",
"request": "launch",
"name": "Debug ODrive v4.x - ST-Link",
"executable": "${workspaceRoot}/build/ODriveFirmware.elf",
"configFiles": [
"interface/stlink.cfg",
"target/stm32f7x.cfg",
],
"showDevDebugOutput": "both",
"openOCDLaunchCommands": [
"reset_config none separate"
],
"svdFile": "${workspaceRoot}/Private/v4/STM32F722.svd",
"cwd": "${workspaceRoot}"
},
命令自动添加
-f /home/ubuntu/.vscode-server/extensions/marus25.cortex-debug-1.2.2/support/openocd-helpers.tcl
哪一个原因
pen On-Chip Debugger 0.11.0+dev-00572-g94e7535be (2022-02-19-14:36)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:26: Error: Can't find /home/ubuntu/.vscode-server/extensions/marus25.cortex-debug-1.2.2/support/openocd-helpers.tcl
in procedure 'script'
at file "embedded:startup.tcl", line 26
然后,我进行了一个测试,在WSL中执行openocd.exe时,我在Windows \share\openocd\script中找到了位于Windows \share\openocd\script中的whihc文件,它将搜索Windows上的路径whihc,而不是ubuntu文件。这意味着它找不到/home/ubuntu/.vscode-server/extensions/marus25.cortex-debug-1.2.2/support/openocd-helpers.tcl,它不在窗口上,而是在WSL上。
我的问题是为什么vscode服务器插入该文件,以及如何解决这样的问题?
发布于 2022-02-27 17:40:02
我遇到了类似的事情,我不知道这些改变是否会对你有帮助。Cortex Debugger是在2022年2月更新的,为了让我继续使用它,我将这一行添加到..vscode/unch.json中,用于我的所有启动规范:
"searchDir": ["/mnt/c/openocd/tcl", "//wsl$/Ubuntu-18.04"]
您可以在https://github.com/Marus/cortex-debug/blob/master/debug_attributes.md中找到其他调试属性。添加到(~/.vscode-server/extensions/marus25.cortex-debug-1.2.2).的"//wsl$/Ubuntu-18.04"
允许GDB在我的ubuntu路径searchDir中找到皮层设置。我不知道您是否需要"/mnt/c/openocd/tcl"
,但是您需要包含以前使用过的其他路径。
您可能需要考虑的其他更改包括
将“
https://stackoverflow.com/questions/71191095
复制相似问题