Skip to content

Commit 932ea14

Browse files
authored
Initial commit
0 parents  commit 932ea14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+106651
-0
lines changed

.cproject

+406
Large diffs are not rendered by default.

.devcontainer/Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu:24.04
2+
3+
# Install git, git-lfs, colorama and build tools
4+
RUN echo "deb http://security.ubuntu.com/ubuntu focal-security main universe" > /etc/apt/sources.list.d/ubuntu-focal-sources.list && \
5+
apt-get update && apt-get -y install git git-lfs python3-colorama cmake g++ build-essential libncurses5 libusb-1.0-0 gdb && \
6+
git lfs install
7+
8+
# Install cubeclt
9+
RUN mkdir /temp && cd /temp && git clone https://github.com/HyperloopUPV-H8/cubeclt.git && \
10+
cd cubeclt && git lfs pull && chmod +x cubeclt_1.16.0_installer.sh && \
11+
echo | LICENSE_ALREADY_ACCEPTED=1 ./cubeclt_1.16.0_installer.sh
12+
13+
ENV PATH="$PATH:/opt/st/stm32cubeclt_1.16.0/GNU-tools-for-STM32/bin:/opt/st/stm32cubeclt_1.16.0/CMake/bin:/opt/st/stm32cubeclt_1.16.0/Ninja/bin"
14+
15+
ENV PYTHONPATH="/workspaces/template-project/Tests/VirtualMCU/src/:$PYTHONPATH"

.devcontainer/devcontainer.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "Dev Container for Template Project",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"options": [
6+
"--platform=linux/amd64"
7+
]
8+
},
9+
"runArgs": [
10+
"--cap-add=SYS_PTRACE",
11+
"--security-opt=seccomp=unconfined"
12+
],
13+
"remoteUser": "root",
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"ms-vscode.cpptools-extension-pack",
18+
"ms-python.python",
19+
"mcu-debug.debug-tracker-vscode",
20+
"marus25.cortex-debug"
21+
]
22+
}
23+
}
24+
}

.github/workflows/build.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Project
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
preset:
7+
description: |
8+
'CMake preset to build the project, run `cmake --build --list-presets' to see a complete list of options'
9+
required: true
10+
type: string
11+
default: 'nucleo-debug'
12+
outputs:
13+
build-artifact:
14+
description: 'Build result artifact id for later use'
15+
value: ${{ jobs.build.outputs.build-artifact }}
16+
workflow_dispatch:
17+
inputs:
18+
preset:
19+
description: |
20+
'CMake preset to build the project, run `cmake --build --list-presets' to see a complete list of options'
21+
required: true
22+
type: string
23+
default: 'nucleo-debug'
24+
25+
jobs:
26+
build:
27+
name: Build Project
28+
runs-on: ubuntu-24.04
29+
outputs:
30+
build-artifact: ${{ steps.upload-build-artifact.outputs.artifact-id }}
31+
container:
32+
image: jmaralo/hyperloop-upv-firmware:0.3.0
33+
steps:
34+
- name: Clone Project
35+
uses: actions/checkout@v3
36+
with:
37+
submodules: recursive
38+
- name: Build
39+
run: |
40+
cmake --preset ${{ inputs.preset }} .
41+
cmake --build --preset ${{ inputs.preset }}
42+
- name: Upload Build
43+
id: upload-build-artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: ${{ inputs.preset }}
47+
path: out/build/latest.elf
48+
retention-days: 7
49+
compression-level: 0
50+
if-no-files-found: error
51+

.github/workflows/compile-checks.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Compile Checks
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
compile-checks:
8+
name: Check project compiles
9+
strategy:
10+
matrix:
11+
preset:
12+
- nucleo-debug
13+
- nucleo-release
14+
- nucleo-relwithdebinfo
15+
- nucleo-debug-eth
16+
- nucleo-release-eth
17+
- nucleo-relwithdebinfo-eth
18+
- board-debug
19+
- board-release
20+
- board-relwithdebinfo
21+
- board-debug-eth
22+
- board-release-eth
23+
- board-relwithdebinfo-eth
24+
- simulator
25+
fail-fast: false
26+
uses: ./.github/workflows/build.yml
27+
with:
28+
preset: ${{ matrix.preset }}

.gitignore

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# *-----------------------*
2+
# | General |
3+
# *-----------------------*
4+
5+
# Python
6+
__pycache__/
7+
8+
# Build
9+
Debug/
10+
Release/
11+
build/
12+
out/
13+
14+
# IDE
15+
*.launch
16+
.metadata
17+
.settings/
18+
compile_commands.json
19+
20+
# *-----------------------*
21+
# | CMake |
22+
# *-----------------------*
23+
24+
CMakeLists.txt.user
25+
CMakeCache.txt
26+
CMakeFiles
27+
CMakeScripts
28+
Testing
29+
Makefile
30+
cmake_install.cmake
31+
install_manifest.txt
32+
compile_commands.json
33+
CTestTestfile.cmake
34+
_deps
35+
CMakeUserPresets.json
36+
.cache
37+
38+
# *-----------------------*
39+
# | C/C++ |
40+
# *-----------------------*
41+
42+
# Prerequisites
43+
*.d
44+
45+
# Compiled Object files
46+
*.slo
47+
*.lo
48+
*.o
49+
*.obj
50+
*.ko
51+
*.elf
52+
53+
# Precompiled Headers
54+
*.gch
55+
*.pch
56+
57+
# Compiled Dynamic libraries
58+
*.so
59+
*.dylib
60+
*.dll
61+
*.so.*
62+
63+
# Compiled Static libraries
64+
*.lai
65+
*.la
66+
*.a
67+
*.lib
68+
*.lo
69+
70+
# Executables
71+
*.exe
72+
*.out
73+
*.app
74+
*.i*86
75+
*.x86_64
76+
*.hex
77+
78+
# Linker output
79+
*.ilk
80+
*.map
81+
*.exp
82+
83+
# Precompiled Headers
84+
*.gch
85+
*.pch
86+
87+
# Debug files
88+
*.dSYM/
89+
*.su
90+
*.idb
91+
*.pdb
92+
93+
# Log files
94+
*.log

.gitmodules

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "deps/ST-LIB"]
2+
path = deps/ST-LIB
3+
url = https://github.com/HyperloopUPV-H8/ST-LIB
4+
[submodule "Core/Inc/Communications/JSON_ADE"]
5+
path= Core/Inc/Communications/JSON_ADE
6+
url = https://github.com/HyperloopUPV-H8/JSON_ADE
7+
[submodule "Tests/VirtualMCU"]
8+
path = Tests/VirtualMCU
9+
url = https://github.com/HyperloopUPV-H8/VirtualMCU

.mxproject

+34
Large diffs are not rendered by default.

.project

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>template-project</name>
4+
<comment></comment>
5+
<projects>
6+
<project>ST-LIB</project>
7+
</projects>
8+
<buildSpec>
9+
<buildCommand>
10+
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
11+
<triggers>clean,full,incremental,</triggers>
12+
<arguments>
13+
</arguments>
14+
</buildCommand>
15+
<buildCommand>
16+
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
17+
<triggers>full,incremental,</triggers>
18+
<arguments>
19+
</arguments>
20+
</buildCommand>
21+
</buildSpec>
22+
<natures>
23+
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
24+
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
25+
<nature>org.eclipse.cdt.core.cnature</nature>
26+
<nature>org.eclipse.cdt.core.ccnature</nature>
27+
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
28+
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
29+
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
30+
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
31+
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
32+
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
33+
</natures>
34+
</projectDescription>

.vscode/c_cpp_properties.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "CMake",
5+
"cStandard": "c17",
6+
"cppStandard": "c++20",
7+
"configurationProvider": "ms-vscode.cmake-tools",
8+
"compileCommands": "compile_commands.json"
9+
}
10+
],
11+
"version": 4
12+
}

.vscode/launch.json

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "cortex-debug",
6+
"request": "launch",
7+
"name": "Build and Debug Project",
8+
"servertype": "stlink",
9+
"cwd": "${workspaceRoot}",
10+
"runToEntryPoint": "main",
11+
"showDevDebugOutput": "raw",
12+
"executable": "out/build/latest.elf",
13+
"device": "STM32H723ZG",
14+
"configFiles": [".vscode/stlink.cfg", ".vscode/stm32h7x.cfg"],
15+
"svdFile": ".vscode/STM32H723.svd",
16+
"swoConfig": {
17+
"enabled": true,
18+
"cpuFrequency": 8000000,
19+
"swoFrequency": 2000000,
20+
"source": "probe",
21+
"decoders": [{ "type": "console", "label": "ITM", "port": 0 }]
22+
},
23+
"preLaunchTask": "CMake: build"
24+
},
25+
{
26+
"type": "cortex-debug",
27+
"request": "launch",
28+
"name": "Debug Project",
29+
"servertype": "stlink",
30+
"cwd": "${workspaceRoot}",
31+
"runToEntryPoint": "main",
32+
"showDevDebugOutput": "raw",
33+
"executable": "out/build/latest.elf",
34+
"device": "STM32H723ZG",
35+
"configFiles": [".vscode/stlink.cfg", ".vscode/stm32h7x.cfg"],
36+
"svdFile": "./STM32H723.svd",
37+
"swoConfig": {
38+
"enabled": true,
39+
"cpuFrequency": 8000000,
40+
"swoFrequency": 2000000,
41+
"source": "probe",
42+
"decoders": [{ "type": "console", "label": "ITM", "port": 0 }]
43+
},
44+
"stm32cubeprogrammer": "/opt/st/stm32cubeclt_1.16.0/STM32CubeProgrammer/bin"
45+
},
46+
{
47+
"name": "Debug simulator on Rosetta",
48+
"type": "cppdbg",
49+
"request": "launch",
50+
"program": "out/build/latest.elf",
51+
"miDebuggerServerAddress": "localhost:1234",
52+
"miDebuggerPath": "/usr/bin/gdb",
53+
"MIMode": "gdb",
54+
"setupCommands": [
55+
{
56+
"description": "Set architecture to x86-64",
57+
"text": "set architecture i386:x86-64",
58+
"ignoreFailures": false
59+
}
60+
],
61+
"preLaunchTask": "Start Debug Server for Simulator on emulated arch",
62+
"cwd": "${workspaceFolder}",
63+
"externalConsole": false
64+
}
65+
]
66+
}

.vscode/settings.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"C_Cpp.default.cppStandard": "c++20",
3+
"C_Cpp.default.cStandard": "c17",
4+
"C_Cpp.clang_format_fallbackStyle": "{BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 80}",
5+
"C_Cpp.formatting": "clangFormat",
6+
"C_Cpp.clang_format_style": "{BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 80}",
7+
"C_Cpp.clang_format_sortIncludes": true,
8+
"C_Cpp.intelliSenseCacheSize": 0
9+
}

.vscode/stlink.cfg

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# STMicroelectronics ST-LINK/V1, ST-LINK/V2, ST-LINK/V2-1, STLINK-V3 in-circuit
3+
# debugger/programmer
4+
#
5+
6+
adapter driver hla
7+
hla_layout stlink
8+
hla_device_desc "ST-LINK"
9+
hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753
10+
11+
# Optionally specify the serial number of ST-LINK/V2 usb device. ST-LINK/V2
12+
# devices seem to have serial numbers with unreadable characters. ST-LINK/V2
13+
# firmware version >= V2.J21.S4 recommended to avoid issues with adapter serial
14+
# number reset issues.
15+
# eg.
16+
#hla_serial "\xaa\xbc\x6e\x06\x50\x75\xff\x55\x17\x42\x19\x3f"

0 commit comments

Comments
 (0)