Initial commit

This commit is contained in:
2025-08-17 02:39:52 +08:00
commit f82ab23898
95 changed files with 52342 additions and 0 deletions

26
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,26 @@
{
"recommendations": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools-themes",
"ms-vscode.vscode-embedded-tools",
"ms-vscode.hexeditor",
"ms-vscode.notepadplusplus-keybindings",
"twxs.cmake",
"xaver.clang-format",
"marus25.cortex-debug",
"cheshirekow.cmake-format",
"mcu-debug.debug-tracker-vscode",
"mcu-debug.memory-view",
"mcu-debug.peripheral-viewer",
"mcu-debug.rtos-views",
"trond-snekvik.gnu-mapfiles",
"zixuanwang.linkerscript",
"gurumukhi.selected-lines-count",
"gruntfuggly.todo-tree",
"vscode-icons-team.vscode-icons",
"jeff-hykin.better-cpp-syntax",
"dan-c-underwood.arm"
]
}

36
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,36 @@
{
"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/Build/Debug/Application/Application.elf",
"name": "Debug with OpenOCD",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"gdbPath": "${workspaceFolder}/Toolchain/xpack-arm-none-eabi-gcc-11.3.1-1.1/bin/arm-none-eabi-gdb.exe",
"servertype": "openocd",
"serverpath": "${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/bin/openocd.exe",
"svdFile": "${workspaceFolder}/GD32E230.svd",
"liveWatch": {
"enabled": true,
"samplesPerSecond": 1
},
"configFiles": [
"${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/scripts/target/openocd_gdlink_gd32e23x.cfg"
],
"serverArgs": [
"-s", "${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/scripts"
],
"searchDir": [
"${workspaceFolder}"
],
"preLaunchTask": "Build",
"preRestartCommands": [
"load",
"continue"
],
},
]
}

20
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,20 @@
{
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.profiles.windows": {
"Git Bash": {
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "Git-Bash",
"clang-format.assumeFilename": ".clang-format",
"clang-format.executable": "clang-format",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": true,
"cmake.buildDirectory": "${workspaceFolder}/Build",
"vcpkg.storageLocation": "C:\\Dev\\Tools\\vcpkg",
"files.associations": {
"*.h": "c",
"*.c": "c"
},
}

125
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,125 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and Flash",
"group": {
"kind": "build",
"isDefault": true
},
"dependsOn": [
"Build",
"Flash MCU"
],
"dependsOrder": "sequence"
},
{
"label": "Flash MCU",
"type": "shell",
"command": "'${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/bin/openocd.exe' -s '${workspaceFolder}' -f '${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/scripts/target/openocd_gdlink_gd32e23x.cfg' -c 'init; reset halt; flash write_image erase ${command:cmake.launchTargetFilename}; reset; exit'",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${command:cmake.buildDirectory}/Application",
"environment": {
"CLICOLOR_FORCE": "1",
"OPENOCD_SCRIPTS": ""
}
},
"presentation": {
"clear": true
}
},
{
"label": "Reset MCU",
"type": "shell",
"command": "'${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/bin/openocd.exe' -s '${workspaceFolder}' -f '${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/scripts/target/openocd_gdlink_gd32e23x.cfg' -c 'init; reset; exit'",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${command:cmake.buildDirectory}/Application",
"environment": {
"CLICOLOR_FORCE": "1",
"OPENOCD_SCRIPTS": ""
}
},
"presentation": {
"clear": true
}
},
{
"label": "Mass Erase MCU",
"type": "shell",
"command": "'${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/bin/openocd.exe' -s '${workspaceFolder}' -f '${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/scripts/target/openocd_gdlink_gd32e23x.cfg' -c 'init; reset halt; gd32e23x mass_erase 0; exit'",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${command:cmake.buildDirectory}/Application",
"environment": {
"CLICOLOR_FORCE": "1",
"OPENOCD_SCRIPTS": ""
}
},
"presentation": {
"clear": true
}
},
{
"label": "OpenOCD Server",
"type": "shell",
"command": [
"'${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/bin/openocd.exe' -s '${workspaceFolder}' -f '${workspaceFolder}/Toolchain/xpack-openocd-0.11.0-3/scripts/target/openocd_gdlink_gd32e23x.cfg'"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${command:cmake.buildDirectory}/Application",
"environment": {
"CLICOLOR_FORCE": "1",
"OPENOCD_SCRIPTS": ""
}
},
"presentation": {
"clear": true
}
},
{
"label": "Build",
"type": "cmake",
"command": "build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
{
"base": "$gcc",
"fileLocation": [
"relative",
"${command:cmake.buildDirectory}"
]
}
],
"options": {
"environment": {
"CLICOLOR_FORCE": "1"
}
},
"presentation": {
"clear": true
}
}
]
}