工作笔记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
相关推荐
xian_wwq4 分钟前
【学习笔记】网络安全死于平庸
笔记·学习·安全防护
d111111111d24 分钟前
在STM32F103C8T6中什么是读写寄存器模型,有什么用,可以干什么,详细解释。
笔记·stm32·单片机·嵌入式硬件·学习
星梦客33 分钟前
FRP 内网穿透工具部署教程
网络·经验分享·笔记
iiiiii1134 分钟前
【论文阅读笔记】FOCAL 离线元强化学习,从静态数据中快速适应新任务
论文阅读·人工智能·笔记·学习·机器学习·学习方法·具身智能
啃火龙果的兔子1 小时前
android studio运行下载gradle特别慢怎么处理
android·ide·android studio
jimmyleeee1 小时前
人工智能基础知识笔记二十三:构建一个可以查询数据库的Agent
人工智能·笔记
malajisi011 小时前
鸿蒙PC开发笔记二:HarmonyOS PC 开发基本概念
笔记
未若君雅裁1 小时前
JVM高级篇总结笔记
java·jvm·笔记
dazhong20121 小时前
Android Studio 安装之历史版本下载问题解决
android·ide·android studio