Initial commit

This commit is contained in:
2025-10-22 20:40:25 +03:00
commit 63d038ee63
57 changed files with 104378 additions and 0 deletions

41
.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -0,0 +1,41 @@
{
"configurations": [
{
"name": "M2",
"intelliSenseMode": "gcc-arm",
"cStandard": "c17",
"cppStandard": "c++17",
"includePath": [
"libs",
"src"
],
"defines": [
"DEBUG",
"STM32F10X_CL",
"HSE_VALUE=16000000",
"CAN_FIRMWARE=1",
"MOBICAR_1_2=1"
],
"compilerPath": "${userHome}/.xpack-dev-tools/xpack-arm-none-eabi-gcc-12.3.1-1.2/bin/arm-none-eabi-gcc"
},
{
"name": "M3",
"intelliSenseMode": "gcc-arm",
"cStandard": "c17",
"cppStandard": "c++17",
"includePath": [
"libs",
"src"
],
"defines": [
"DEBUG",
"STM32F10X_CL",
"HSE_VALUE=16000000",
"CAN_FIRMWARE=1",
"MOBICAR_3=1"
],
"compilerPath": "${userHome}/.xpack-dev-tools/xpack-arm-none-eabi-gcc-12.3.1-1.2/bin/arm-none-eabi-gcc"
}
],
"version": 4
}

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

@@ -0,0 +1,18 @@
{
"recommendations": [
/* mandatory extensions */
"ms-vscode.cpptools", // C/C++ support
"marus25.cortex-debug", // Cortex-Debug
/* handy extensions (optional) */
"spencerwmiles.vscode-task-buttons",// Run tasks using statusbar buttons
"mhutchie.git-graph", // Git Graph
"pkief.material-icon-theme", // Icons
"ZixuanWang.linkerscript", // Linker Script files syntax
"trond-snekvik.gnu-mapfiles", // Linker Map files syntax
"keroc.hex-fmt", // Intel Hex files syntax
"ms-vscode.hexeditor", // Hex editor for binary files
"dan-c-underwood.arm", // ARM Assembly files syntax
"EditorConfig.EditorConfig", // editorconfig
"YuTengjing.open-in-external-app", // Open files in external app
]
}

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

@@ -0,0 +1,106 @@
{
"configurations": [
{
"name": "Debug M2",
"request": "launch",
"preLaunchTask": "Build M2 Debug",
"executable": "./build/M2_Debug/CAN_FW.elf",
"cwd": "${workspaceRoot}",
"showDevDebugOutput": "parsed",
"type": "cortex-debug",
// J-Link config //
"servertype": "jlink",
"serverArgs": ["-speed", "4000"],
"windows": {
"serverpath": "C:/Program Files/SEGGER/JLink/JLinkGDBServerCL.exe"
},
"osx": {
"serverpath": "/Applications/SEGGER/JLink/JLinkGDBServer"
},
"device": "STM32F105VC",
"svdFile": "sys/STM32F107.svd",
"swoConfig":
{
"enabled": true,
"cpuFrequency": 36000000,
"swoFrequency": 12000000,
"source": "probe",
"decoders":
[
{
"label": "ITM",
"type": "console",
"port": 0,
"showOnStartup": true,
"encoding": "ascii",
}
]
},
// "rttConfig": {
// "enabled": true,
// "address": "auto",
// "decoders": [
// {
// "label": "RTT Log",
// "port": 0,
// "type": "console",
// "noprompt": true,
// }
// ]
// },
// Other //
"internalConsoleOptions": "neverOpen"
},
{
"name": "Debug M3",
"request": "launch",
"preLaunchTask": "Build M3 Debug",
"executable": "./build/M3_Debug/CAN_FW.elf",
"cwd": "${workspaceRoot}",
"showDevDebugOutput": "parsed",
"type": "cortex-debug",
// J-Link config //
"servertype": "jlink",
"serverArgs": ["-speed", "4000"],
"windows": {
"serverpath": "C:/Program Files/SEGGER/JLink/JLinkGDBServerCL.exe"
},
"osx": {
"serverpath": "/Applications/SEGGER/JLink/JLinkGDBServer"
},
"device": "STM32F446ZE",
"svdFile": "sys/STM32F446.svd",
"swoConfig":
{
"enabled": true,
"cpuFrequency": 36000000,
"swoFrequency": 12000000,
"source": "probe",
"decoders":
[
{
"label": "ITM",
"type": "console",
"port": 0,
"showOnStartup": true,
"encoding": "ascii"
}
]
},
// "rttConfig": {
// "enabled": true,
// "address": "auto",
// "decoders": [
// {
// "label": "RTT Log",
// "port": 0,
// "type": "console",
// "noprompt": true,
// }
// ]
// },
// Other //
"internalConsoleOptions": "neverOpen"
}
]
}

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

@@ -0,0 +1,114 @@
{
// Terminal profiles:
"terminal.integrated.profiles.windows": {
"Git Bash": {
"source": "Git Bash",
// "icon": "tools",
"color": "terminal.ansiGreen",
"overrideName": false,
"env": {},
"args": ["--init-file", "sys/export.sh"]
},
"Command Prompt": {
"path": "C:/Windows/System32/cmd.exe",
// "icon": "tools",
"color": "terminal.ansiGreen",
"overrideName": false,
"env": {},
"args": ["/k call sys/export.bat"]
},
"PowerShell": {
"source": "PowerShell",
// "icon": "tools",
"color": "terminal.ansiGreen",
"overrideName": false,
"env": {},
"args": ["-noexit", "-file", "sys/export.ps1"]
}
},
"terminal.integrated.defaultProfile.linux": "Build bash",
"terminal.integrated.profiles.linux": {
"Build bash": {
"path": "bash",
"icon": "terminal-bash",
"color": "terminal.ansiGreen",
"overrideName": true,
"env": {},
"args": ["--init-file", "sys/export.sh"]
},
"Build zsh": {
"path": "zsh",
"icon": "terminal",
"color": "terminal.ansiGreen",
"overrideName": true,
"env": {"ZDOTDIR": "sys/zdotdir"},
"args": []
}
},
"terminal.integrated.defaultProfile.osx": "Build zsh",
"terminal.integrated.profiles.osx": {
"Build bash": {
"path": "bash",
"icon": "terminal-bash",
"color": "terminal.ansiGreen",
"overrideName": true,
"env": {},
"args": ["--init-file", "sys/export.sh"]
},
"Build zsh": {
"path": "zsh",
"icon": "terminal",
"color": "terminal.ansiGreen",
"overrideName": true,
"env": {"ZDOTDIR": "sys/zdotdir"},
"args": []
}
},
// Cortex-Debug
"cortex-debug.armToolchainPath": "${userHome}/.xpack-dev-tools/xpack-arm-none-eabi-gcc-12.3.1-1.2/bin",
// C/C++
"C_Cpp.autoAddFileAssociations": false,
// Task Buttons extention
"VsCodeTaskButtons.showCounter": false,
"VsCodeTaskButtons.tasks": [
{
"label": "$(tools) M2 Release",
"alignment": "left",
"task": "Build M2 Release"
},
{
"label": "$(tools) M3 Release",
"alignment": "left",
"task": "Build M3 Release"
},
{
"label": "$(tools) M2 Debug",
"alignment": "left",
"task": "Build M2 Debug"
},
{
"label": "$(tools) M3 Debug",
"alignment": "left",
"task": "Build M3 Debug"
},
{
"label": "$(tools) Clean",
"alignment": "left",
"task": "Clean"
},
],
"workbench.editorAssociations": {
"*.o": "hexEditor.hexedit",
"*.elf": "hexEditor.hexedit",
"*.bin": "hexEditor.hexedit",
"*.fw": "hexEditor.hexedit"
},
"search.exclude": {
"build/**": true
}
}

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

@@ -0,0 +1,125 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build M2 Release",
"type": "process",
"command": "bash",
"args": ["-c", ". sys/export.sh && make -e MODEL=M2 release"],
"windows": {
"command": "C:/Windows/System32/cmd.exe",
"args": ["/c call sys/export.bat && make -e MODEL=M2 release"]
},
"osx": {
"type": "shell"
},
"icon": {"id": "tools", "color": "terminal.ansiGreen"},
"options": {
"cwd": "${workspaceRoot}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Build M3 Release",
"type": "process",
"command": "bash",
"args": ["-c", ". sys/export.sh && make -e MODEL=M3 release"],
"windows": {
"command": "C:/Windows/System32/cmd.exe",
"args": ["/c call sys/export.bat && make -e MODEL=M3 release"]
},
"osx": {
"type": "shell"
},
"icon": {"id": "tools", "color": "terminal.ansiGreen"},
"options": {
"cwd": "${workspaceRoot}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Build M2 Debug",
"type": "process",
"command": "bash",
"args": ["-c", ". sys/export.sh && make -e MODEL=M2 debug"],
"windows": {
"command": "C:/Windows/System32/cmd.exe",
"args": ["/c call sys/export.bat && make -e MODEL=M2 debug"]
},
"osx": {
"type": "shell"
},
"icon": {"id": "tools", "color": "terminal.ansiGreen"},
"options": {
"cwd": "${workspaceRoot}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Build M3 Debug",
"type": "process",
"command": "bash",
"args": ["-c", ". sys/export.sh && make -e MODEL=M3 debug"],
"windows": {
"command": "C:/Windows/System32/cmd.exe",
"args": ["/c call sys/export.bat && make -e MODEL=M3 debug"]
},
"osx": {
"type": "shell"
},
"icon": {"id": "tools", "color": "terminal.ansiGreen"},
"options": {
"cwd": "${workspaceRoot}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Clean",
"type": "process",
"command": "bash",
"args": ["-c", ". sys/export.sh && rm -rf build"],
"windows": {
"command": "C:/Windows/System32/cmd.exe",
"args": ["/c call sys/export.bat && rm -rf build"]
},
"osx": {
"type": "shell"
},
"icon": {"id": "tools", "color": "terminal.ansiGreen"},
"options": {
"cwd": "${workspaceRoot}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
}
]
}