Compare commits
1 Commits
template_p
...
template_x
Author | SHA1 | Date | |
---|---|---|---|
941ca598b1 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,5 @@
|
|||||||
# 忽略构建输出目录
|
# 忽略构建输出目录
|
||||||
Build/
|
Build/
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# 忽略 Toolchain 目录下所有内容,但保留目录本身
|
# 忽略 Toolchain 目录下所有内容,但保留目录本身
|
||||||
Toolchain/*
|
Toolchain/*
|
||||||
|
26
.vscode/extensions.json
vendored
Normal file
26
.vscode/extensions.json
vendored
Normal 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
36
.vscode/launch.json
vendored
Normal 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"
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
30
.vscode/settings.json
vendored
Normal file
30
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"terminal.integrated.tabs.enabled": true,
|
||||||
|
"terminal.integrated.profiles.windows": {
|
||||||
|
"Git Bash": {
|
||||||
|
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
|
||||||
|
"icon": "terminal-bash"
|
||||||
|
},
|
||||||
|
"Git-Bash": {
|
||||||
|
"path": "D:\\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",
|
||||||
|
"array": "c",
|
||||||
|
"string": "c",
|
||||||
|
"string_view": "c",
|
||||||
|
"ranges": "c",
|
||||||
|
"span": "c"
|
||||||
|
},
|
||||||
|
"cortex-debug.variableUseNaturalFormat": true,
|
||||||
|
}
|
145
.vscode/tasks.json
vendored
Normal file
145
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build and Flash",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"dependsOn": [
|
||||||
|
"Build",
|
||||||
|
"Flash MCU"
|
||||||
|
],
|
||||||
|
"dependsOrder": "sequence",
|
||||||
|
"icon": {
|
||||||
|
"id": "insert",
|
||||||
|
"tooltip": "Build and Flash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"id": "gather",
|
||||||
|
"tooltip": "Flash MCU"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"id": "discard",
|
||||||
|
"tooltip": "Reset MCU"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"id": "clear-all",
|
||||||
|
"tooltip": "Erase MCU"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"id": "code",
|
||||||
|
"tooltip": "Build"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -30,7 +30,6 @@ set(TARGET_SRC
|
|||||||
Src/uart_ring_buffer.c
|
Src/uart_ring_buffer.c
|
||||||
Src/command.c
|
Src/command.c
|
||||||
Src/i2c.c
|
Src/i2c.c
|
||||||
Src/board_config.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# 设置输出目录
|
# 设置输出目录
|
||||||
|
3
start-vscode-no-openocd-env.bat
Normal file
3
start-vscode-no-openocd-env.bat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
set OPENOCD_SCRIPTS=
|
||||||
|
start "" "C:\Users\dell\AppData\Local\Programs\Microsoft VS Code\Code.exe"
|
Reference in New Issue
Block a user