工作笔记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
相关推荐
Hello_Embed5 小时前
STM32HAL 快速入门(二十):UART 中断改进 —— 环形缓冲区解决数据丢失
笔记·stm32·单片机·学习·嵌入式软件
咸甜适中5 小时前
rust语言 (1.88) 学习笔记:客户端和服务器端同在一个项目中
笔记·学习·rust
Grassto6 小时前
RAG 从入门到放弃?丐版 demo 实战笔记(go+python)
笔记
Magnetic_h6 小时前
【iOS】设计模式复习
笔记·学习·ios·设计模式·objective-c·cocoa
周周记笔记9 小时前
学习笔记:第一个Python程序
笔记·学习
丑小鸭是白天鹅9 小时前
Kotlin协程详细笔记之切线程和挂起函数
开发语言·笔记·kotlin
潘达斯奈基~9 小时前
《大数据之路1》笔记2:数据模型
大数据·笔记
..过云雨9 小时前
05.【Linux系统编程】进程(冯诺依曼体系结构、进程概念、进程状态(注意僵尸和孤儿)、进程优先级、进程切换和调度)
linux·笔记·学习
咸甜适中10 小时前
rust语言 (1.88) egui (0.32.2) 学习笔记(逐行注释)(二十八)使用图片控件显示图片
笔记·学习·rust·egui
一又四分之一.10 小时前
高数基础知识(下)②
笔记