工作笔记20240927——vscode + jlink调试

launch.json的配置,可以用的

复制代码
    {
        "name": "Debug",
        "type": "cppdbg",
        "request": "launch",
        "miDebuggerPath": "./arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gdb",
        "miDebuggerArgs": "-ex 'tar ext:2331' -ex 'load ${workspaceFolder}/Debug/r52_camsys.elf'",
        "program": "${workspaceFolder}/Debug/r52_camsys.elf",
        "cwd": "${workspaceFolder}",
        "externalConsole": true,
        "MIMode": "gdb",
        "preLaunchTask": "Start GDB Server"
    },

tasks.json的配置,可以用

{

"version": "2.0.0",

"tasks": [

{

"label": "Start GDB Server",

"type": "shell",

"command": "/opt/SEGGER/JLink/JLinkGDBServerCLExe",

"args": [

"-if",

"jtag",

"-device",

"Cortex-R52",

"-endian",

"little",

"-speed",

"4000",

"-port",

"2331",

"-swoport",

"2332",

"-telnetport",

"2333",

"-vd",

"-ir",

"-localhostonly",

"1",

"-singlerun",

"-strict",

"-timeout",

"0",

"-nogui"

],

"isBackground": true,

"presentation": {

"reveal": "always",

"panel": "shared"

},

"problemMatcher": \[\]

}

]

}
launch.json不能用配置

{

"name": "JLink - r52_camsys",

"type": "cortex-debug",

"request": "launch",

"servertype": "jlink",

"device": "Cortex-R52", // 替换为你的确切设备型号

"interface": "jtag", // 或者 "swd",取决于你的硬件连接

"executable": "${workspaceFolder}/Debug/r52_camsys.elf", // 替换为你的 elf 文件路径

"serverpath": "/opt/SEGGER/JLink/JLinkGDBServerCLExe",

"serverArgs": [

"-vd",

"-ir",

"-singlerun",

"-strict",

"-nogui"

],

"port": 2331, // 与脚本中 -port 参数一致

"swoport": 2332, // 与脚本中 -swoport 参数一致

"telnetport": 2333, // 与脚本中 -telnetport 参数一致

"runToMain": true,

"setupCommands": [

{

"text": "target extended-remote :2331"

},

{

"text": "monitor swoport 2332"

},

{

"text": "monitor telnetport 2333"

},

{

"text": "load"

},

{

"text": "monitor reset"

},

{

"text": "c"

}

]

}
脚本

bash 复制代码
/opt/SEGGER/JLink/JLinkGDBServerCLExe -if jtag -device Cortex-R52 -endian little -speed auto -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
相关推荐
sheeta199842 分钟前
LeetCode 每日一题笔记 日期:2026.06.02 题目:3635. 最早完成陆地和水上游乐设施的时间 II
笔记·算法·leetcode
小满Autumn2 小时前
MVVM Light 架构笔记:定位器、命令、消息与 IoC 实践
笔记·学习·架构·c#·上位机·mvvm
kobesdu3 小时前
【ROS2实战笔记-24】ROS2 Launch 实用技巧:条件逻辑与节点动态生成
笔记·ros·slam
小满Autumn3 小时前
CommunityToolkit.Mvvm 架构笔记:现代 MVVM、源生成器与工程化实践
笔记·架构·c#·.net·wpf·mvvm
棒棒的唐4 小时前
Vscode Continue插件 集成 本地llama.cpp大模型实现代码补全
ide·vscode·编辑器
养肥胖虎5 小时前
多Agent开发笔记:为什么4个Codex加1个Claude会把cpu跑满
vscode·agent·codex
imDwAaY5 小时前
贝叶斯网络到粒子滤波Python算法实现 CS188 Proj4 学习笔记
网络·人工智能·笔记·python·学习·算法
咸甜适中6 小时前
rust语言学习笔记Trait(十五)Drop(释放资源)
笔记·学习·rust
IT笔记7 小时前
【Rust】 Rust宏学习笔记
笔记·学习·rust
tianxingjian20197 小时前
从欧盟电池法新规看QFD:如何将合规需求转化为技术特性?
笔记