工作笔记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
相关推荐
蒸蒸yyyyzwd5 小时前
AI应用相关可能的面试问题
笔记
叼烟扛炮6 小时前
[Git 实战] 学习笔记:从生成 SSH 密钥到解决 TortoiseGit 推送报错全指南
linux·运维·笔记·git·学习
蒸蒸yyyyzwd7 小时前
学习笔记 八股手撕
笔记·学习
揣一尾游鱼yu8 小时前
Spring上(IOC)笔记
java·笔记·spring·ioc
小李不想当小白10 小时前
BKP备份寄存器与RTC实时时钟(STM32标准库学习笔记)
笔记·stm32·单片机·嵌入式硬件·学习·嵌入式
瑞码空间12 小时前
JSP与Servlet核心开发与CRUD实战笔记
java·笔记·servlet·jsp
La Pulga12 小时前
【FreeRTOS源码学习笔记】链表的实现
数据结构·笔记·stm32·mcu·链表·嵌入式·freertos
wuyoutrans15 小时前
以色列专利OA答复翻译,重点要避开哪些坑?
笔记
宝绿特塑业再生科技15 小时前
HDPE再生颗粒户外家具表面粉化机理与改性技术全解析
笔记·户外家具·再生塑料·塑木桌椅
凉、介16 小时前
深入理解 ARMv7-A | Generic Timer
笔记·学习·嵌入式·arm