相同的配置都在vscode使用stm32-jlink中,以下是不同配置:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"USE_HAL_DRIVER",
"STM32F103xE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "D:/vs studio/SDK/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-arm",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
{
"makefile.extensionOutputFolder": "./.vscode"
}
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc.exe 生成活动文件",
"command": "D:/LearnApp/SDK/C/Feil/mingw64/bin/gcc.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "D:/LearnApp/SDK/C/Feil/mingw64/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
},
//按照以上格式添加这段
{
"type": "shell",//类型
"label": "Update", //运行任务中的名称
"command": "D:/IOT/STM32/File/openocd-0.10.0/bin/openocd.exe", //执行的命令
"args": [
"-f", //文件
"D:/IOT/STM32/File/openocd-0.10.0/scripts/interface/stlink-v2.cfg",
"-f",
"D:/IOT/STM32/File/openocd-0.10.0/scripts/target/stm32f1x.cfg",
"-c",
"program build/f103zet6One.elf verify reset exit" //build/401CEU6fist.elf: 是你build里面的.elf文件名称和build路径
],
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
},
//按照最上面的格式添加这段
{
"type": "shell",//类型
"label": "Build",//运行任务中的名称
"command": "make",//执行的命令(需要在环境依赖中有配置)
"args": [
],
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
}
],
"version": "2.0.0"
}