芯片解密安装配置 Cortex-Debug
在VSCode的插件中, 搜索安装Cortex-Debug
在VSCode中, 芯片解密切换到Run And Debug, 点击上方的 Add Configuration, 会在 .vscode 目录下的 launch.json (如果没有会自动创建)中添加配置, 需要增加对应的配置信息
- "configurations": [
- {
- "name": "Cortex Debug",
- "cwd": "${workspaceFolder}",
- "executable": "${workspaceFolder}/Build/app.elf",
- "request": "launch", // 可以是launch或attach, 后者表示运行中接入, 前者会执行前置任务并重启
- "type": "cortex-debug",
- "runToEntryPoint": "main",
- "servertype": "jlink",
- "device": "HC32L110X4", // 如果是32K的版本, 需要修改为 HC32L110X6
- "interface": "swd",
- "runToMain": true, // false则从 reset handler 开始停留
- "preLaunchTask": "build", // 根据 tasks.json 中配置的任务填写,
- // "preLaunchCommands": ["Build all"], // 如果不使用 preLaunchTask, 可以用这个参数指定命令行命令
- "svdFile": "", // svd 用于观察外设
- "showDevDebugOutput": "vscode", // 输出的日志级别, parsed:解析后的内容, raw:直接输出, vscode:包含scode调用和raw
- "swoConfig":
- {
- "enabled": true,
- "cpuFrequency": 24000000,
- "swoFrequency": 4000000,
- "source": "probe",
- "decoders":
- [
- {
- "label": "ITM port 0 output",
- "type": "console",
- "port": 0,
- "showOnStartup": true,
- "encoding": "ascii"
- }
- ]
- }
- }
- ]
复制代码