工作笔记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
相关推荐
新晓·故知5 分钟前
<使用生成式AI对四种冒泡排序实现形式分析解释的探讨整理>
c++·经验分享·笔记·算法·aigc·排序算法
建学派-建筑资质申报实操教学1 小时前
建筑业挂靠行为的风险分析
大数据·经验分享·笔记·职场和发展·微信小程序·创业创新·业界资讯
tt5555555555551 小时前
机器学习学习笔记-20240927
笔记·学习·机器学习·计算机视觉
wdh38372 小时前
vscode+stfp插件,实现远程自动同步文件&代码
ide·vscode·编辑器
fengbizhe3 小时前
笔试-笔记
c语言·笔记
追逐远方的梦5 小时前
Julia的安装和使用(附vscode中使用)
开发语言·vscode·julia
罗曼蒂克在消亡5 小时前
django使用笔记6--docker部署
笔记·docker·django
karshey5 小时前
【HTML并不简单】笔记1-常用rel总结:nofollow、noopener、opener、noreferrer,relList
前端·笔记·html
咸芝麻鱼6 小时前
Android Studio中导入了包,但无法识别 WindowSizeClass 和相关函数的问题
android·ide·android studio