From 5ba7f18f3a9886ad5de3aa4be1e45e7bbc59e7ac Mon Sep 17 00:00:00 2001 From: LuChiChick <1084116302@qq.com> Date: Mon, 14 Sep 2026 21:03:22 +0800 Subject: [PATCH] Add VsCode workspace .json configuration files for IntelliSense engine setup, path indexing, recommended extensions, and tasks for debug build flash programming. --- .vscode/c_cpp_properties.json | 26 +++++++++++++++++ .vscode/extensions.json | 7 +++++ .vscode/launch.json | 50 +++++++++++++++++++++++++++++++++ .vscode/settings.json | 5 ++++ .vscode/tasks.json | 53 +++++++++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..9dd4363 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,26 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "Core/Inc", + "Drivers/STM32G0xx_HAL_Driver/Inc", + "Drivers/STM32G0xx_HAL_Driver/Inc/Legacy", + "Middlewares/Third_Party/FreeRTOS/Source/include", + "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS", + "Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0", + "Drivers/CMSIS/Device/ST/STM32G0xx/Include", + "Drivers/CMSIS/Include", + "${workspaceFolder}/**", + "${workspaceFolder}/User/Main/Inc" + ], + "defines": [ + "USE_HAL_DRIVER", + "STM32G030xx" + ], + "cStandard": "c23", + "cppStandard": "c++23" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..188e6f5 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "ms-vscode.cpptools", + "marus25.cortex-debug", + "PKief.material-icon-theme" // 图标包,可选 + ], +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d9c174a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,50 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "ST-Link OpenOCD", + "type": "cortex-debug", + "cwd": "${workspaceFolder}", + "preLaunchTask": "ST-Link Debug-Flash", + "executable": "Build\\Debug\\STM32G030F6P6_Evaluation.elf", + "request": "launch", + "runToEntryPoint": "main", + "servertype": "openocd", + "configFiles": [ + "Tools\\Specific_Config\\stlink-interface.cfg", + "Tools\\Specific_Config\\stm32g0x-target.cfg" + ], + "liveWatch": { + "enabled": true, + "samplesPerSecond": 4 + }, + "postLaunchCommands": [ + "-enable-pretty-printing" + ] + }, + { + "name": "CMSIS-DAP OpenOCD", + "type": "cortex-debug", + "cwd": "${workspaceFolder}", + "preLaunchTask": "CMSIS-DAP Debug-Flash", + "executable": "Build\\Debug\\STM32G030F6P6_Evaluation.elf", + "request": "launch", + "runToEntryPoint": "main", + "servertype": "openocd", + "configFiles": [ + "Tools\\Specific_Config\\cmsis-dap-interface.cfg", + "Tools\\Specific_Config\\stm32g0x-target.cfg" + ], + "liveWatch": { + "enabled": true, + "samplesPerSecond": 4 + }, + "postLaunchCommands": [ + "-enable-pretty-printing" + ], + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..118f77e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cortex-debug.openocdPath": "Tools\\xpack-openocd-0.12.0-7\\bin\\openocd.exe", + // "cortex-debug.armToolchainPath": "D:\\Arm GNU Toolchain\\arm-gnu-toolchain-15.3.rel1-mingw-w64-x86_64-arm-none-eabi\\bin", + // "cortex-debug.gdbPath": "D:\\Arm GNU Toolchain\\arm-gnu-toolchain-15.3.rel1-mingw-w64-x86_64-arm-none-eabi\\bin\\arm-none-eabi-gdb.exe" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..0215962 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,53 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Debug-Build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": ".\\Tools\\mingw32-make.exe -f .\\Tools\\Makefile debug" + }, + { + "label": "ST-Link Debug-Flash", + "dependsOn": [ + "Debug-Build" + ], + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": ".\\Tools\\xpack-openocd-0.12.0-7\\bin\\openocd.exe", + "args": [ + "-f", + ".\\Tools\\Specific_Config\\stlink-interface.cfg", + "-f", + ".\\Tools\\Specific_Config\\stm32g0x-target.cfg", + "-c", + "program Build/Debug/STM32G030F6P6_Evaluation.elf verify reset exit" + ] + }, + { + "label": "CMSIS-DAP Debug-Flash", + "dependsOn": [ + "Debug-Build" + ], + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": ".\\Tools\\xpack-openocd-0.12.0-7\\bin\\openocd.exe", + "args": [ + "-f", + ".\\Tools\\Specific_Config\\cmsis-dap-interface.cfg", + "-f", + ".\\Tools\\Specific_Config\\stm32g0x-target.cfg", + "-c", + "program Build/Debug/STM32G030F6P6_Evaluation.elf verify reset exit" + ] + } + ] +} \ No newline at end of file