vscode嵌入式配置环境setting.json配置
时间: 2023-12-18 20:05:40 浏览: 211
在VS Code中配置嵌入式开发环境,需要在`settings.json`文件中添加相关配置。以下是一份常用的`settings.json`配置:
```json
{
"files.autoSave": "onFocusChange",
"cortex-debug.openocdPath": "C:\\OpenOCD\\bin\\openocd.exe",
"cortex-debug.armToolchainPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\6 2017-q2-update\\bin",
"cortex-debug.JLinkGDBServerPath": "C:\\Program Files (x86)\\SEGGER\\JLink_V640\\JLinkGDBServer.exe",
"cortex-debug.gdbPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\6 2017-q2-update\\bin\\arm-none-eabi-gdb.exe",
"cortex-debug.armToolchainVersion": "6-2017-q2-update",
"cortex-debug.interface": "swd",
"cortex-debug.targetId": "auto",
"cortex-debug.endian": "little",
"cortex-debug.swoConfig": {
"enabled": true,
"cpuFrequency": 72000000,
"swoFrequency": 2000000,
"source": "probe",
"decoders": [
{
"type": "console",
"label": "ITM",
"port": 0,
"source": "stimulus",
"match": ".*"
}
]
},
"C_Cpp.default.configurationProvider": "ms-vscode.cpptools",
"C_Cpp.default.intelliSenseMode": "gcc-x64",
"C_Cpp.default.compilerPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\6 2017-q2-update\\bin\\arm-none-eabi-gcc.exe",
"C_Cpp.default.includePath": [
"${workspaceFolder}/**"
],
"C_Cpp.default.defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"C_Cpp.default.cStandard": "c11",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.debugConfig": {
"name": "OpenOCD",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/output.elf",
"cwd": "${workspaceRoot}",
"args": [],
"stopAtEntry": false,
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\6 2017-q2-update\\bin\\arm-none-eabi-gdb.exe",
"miDebuggerServerAddress": "localhost:3333",
"debugServerPath": "C:\\OpenOCD\\bin\\openocd.exe",
"debugServerArgs": [
"-f",
"interface/stlink.cfg",
"-c",
"transport select hla_swd",
"-f",
"target/stm32f1x.cfg"
]
},
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"terminal.integrated.env.windows": {
"CHCP": "65001"
},
"git.ignoreLegacyWarning": true
}
```
这份配置主要包括以下部分:
1. `cortex-debug`:嵌入式调试插件的配置,包括OpenOCD、JLinkGDBServer、GDB等工具的路径、SWO(Serial Wire Output)配置等;
2. `C_Cpp`:C/C++插件的配置,包括编译器路径、头文件搜索路径、宏定义等;
3. `terminal`:终端的配置,包括默认的shell、字符集等;
4. 其他配置,如自动保存、Git等。
需要注意的是,这份配置针对的是ARM Cortex-M系列芯片的开发,具体路径和配置可能需要根据实际情况进行修改。
阅读全文