工作笔记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
相关推荐
handler013 小时前
Linux: 基本指令知识点(2)
linux·服务器·c语言·c++·笔记·学习
南境十里·墨染春水7 小时前
C++ 笔记 thread
java·开发语言·c++·笔记·学习
南境十里·墨染春水7 小时前
C++ 笔记 高级线程同步原语与线程池实现
java·开发语言·c++·笔记·学习
lkforce7 小时前
MiniMind学习笔记(二)--model_minimind.py
笔记·python·学习·minimind·minimindconfig
三品吉他手会点灯8 小时前
STM32 VSCode 开发-C/C++的环境配置中,找不到C/C++: Edit Configurations选项
c语言·c++·vscode·stm32·单片机·嵌入式硬件·编辑器
三品吉他手会点灯8 小时前
C语言学习笔记 - 1.C概述 - 本讲内容概述
c语言·笔记·学习
是孑然呀10 小时前
【笔记】激光定位-激光切割指针偏移设置
笔记
中屹指纹浏览器11 小时前
2026指纹浏览器性能优化实战:多开稳定性与资源占用控制全解析
经验分享·笔记
小堃学编程12 小时前
【项目实战】基于protobuf的发布订阅式消息队列(4)—— 服务端
c语言·c++·vscode·消息队列·gtest·protobuf·muduo
一只大袋鼠12 小时前
MyBatis 特性(三):缓存、延迟加载、注解开发
java·数据库·笔记·sql·缓存·mybatis