Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • avn/swd/skyward-boardcore
  • emilio.corigliano/skyward-boardcore
  • nicolo.caruso/skyward-boardcore
  • ettore.pane/skyward-boardcore
  • giulia.facchi/skyward-boardcore
  • valerio.flamminii/skyward-boardcore
6 results
Show changes
Commits on Source (62)
Showing with 334 additions and 106 deletions
{
BasedOnStyle: Google,
AccessModifierOffset: -4,
AlignConsecutiveAssignments: true,
AllowShortIfStatementsOnASingleLine: false,
AllowShortLoopsOnASingleLine: false,
BreakBeforeBraces: Allman,
ColumnLimit: 80,
ConstructorInitializerAllOnOneLineOrOnePerLine: false,
IndentCaseLabels: true,
IndentWidth: 4,
KeepEmptyLinesAtTheStartOfBlocks: true,
}
BasedOnStyle: Google
ColumnLimit: 80
IndentWidth: 4
AccessModifierOffset: -4
BreakBeforeBraces: Allman
# Allow braceless single line if/else/for/while statements
RemoveBracesLLVM: true
AlignConsecutiveAssignments: Consecutive
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
PackConstructorInitializers: BinPack
IndentCaseLabels: true
# Empty lines behavior
InsertNewlineAtEOF: true
KeepEmptyLinesAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
# Align pointers/references to the type, not the variable
DerivePointerAlignment: false
PointerAlignment: Left
......@@ -21,6 +21,7 @@ STM32F429zi_Discovery.xml
._*
.DS_Store
build
build-host
cmake-build-*
*.sublime-workspace
*.sublime-project
......
......@@ -23,7 +23,7 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive
default:
image: registry.skywarder.eu/avn/swd/docker/miosix:latest
image: registry.skywarder.eu/avn/swd/docker/miosix:v2
stages:
- lint
......@@ -66,7 +66,7 @@ build-debug:
- cmake --version
- ccache --version
- ninja --version
- ./sbs --debug
- ./sbs build --debug
build-release:
stage: build
......@@ -74,7 +74,7 @@ build-release:
- cmake --version
- ccache --version
- ninja --version
- ./sbs
- ./sbs build
logdecoder:
stage: build
......@@ -88,7 +88,7 @@ logdecoder:
test:
stage: test
script:
- ./sbs --test catch-tests-boardcore
- ./sbs test
# Stage documentation
......
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/
SkywardBoardcore
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSharedSettings">
<configurations>
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_TOOLCHAIN_FILE=$CMakeProjectDir$/libs/miosix-kernel/miosix/_tools/toolchain.cmake -GNinja" />
<configuration PROFILE_NAME="Release" ENABLED="true" CONFIG_NAME="Release" GENERATION_OPTIONS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_TOOLCHAIN_FILE=$CMakeProjectDir$/libs/miosix-kernel/miosix/_tools/toolchain.cmake -GNinja" />
</configurations>
</component>
</project>
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<clangFormatSettings>
<option name="ENABLED" value="true" />
</clangFormatSettings>
</code_scheme>
</component>
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="CidrRootsConfiguration">
<sourceRoots>
<file path="$PROJECT_DIR$/src" />
</sourceRoots>
<excludeRoots>
<file path="$PROJECT_DIR$/build" />
<file path="$PROJECT_DIR$/libs" />
</excludeRoots>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/skyward-boardcore.iml" filepath="$PROJECT_DIR$/.idea/skyward-boardcore.iml" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/Catch2" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/eigen" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/fmt" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/mavlink_skyward_lib" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/miosix-kernel" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/miosix-kernel/miosix/_examples/datalogger/tscpp" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/mxgui" vcs="Git" />
<mapping directory="$PROJECT_DIR$/libs/tscpp" vcs="Git" />
</component>
</project>
......@@ -16,16 +16,17 @@
"${workspaceFolder}/libs/mxgui",
"${workspaceFolder}/libs/tscpp",
"${workspaceFolder}/src/shared",
"${workspaceFolder}/src/tests"
"${workspaceFolder}/src/tests",
"${workspaceFolder}/version"
]
},
"configurations": [
// Skyward boards
{
"name": "stm32f205rc_ciuti",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f205rc_ciuti",
......@@ -48,6 +49,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_death_stack_v1",
......@@ -72,6 +74,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_death_stack_v2",
......@@ -95,6 +98,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_death_stack_v3",
......@@ -118,6 +122,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_nokia",
......@@ -141,6 +146,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_parafoil",
......@@ -164,6 +170,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_pyxis_auxiliary",
......@@ -186,6 +193,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_rig",
......@@ -209,6 +217,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_con_rig",
......@@ -227,11 +236,35 @@
"${workspaceFolder}/src/bsps/stm32f429zi_con_rig"
]
},
{
"name": "stm32f767zi_conrig_v2",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_conrig_v2",
"_BOARD_STM32F767ZI_CONRIG_V2",
"_ARCH_CORTEXM7_STM32F7",
"HSE_VALUE=25000000",
"SYSCLK_FREQ_216MHz=216000000",
"__ENABLE_XRAM",
"V_DDA_VOLTAGE=3.3f"
],
"includePath": [
"${defaultIncludePaths}",
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM7_stm32f7/common",
"${workspaceFolder}/src/bsps/stm32f767zi_conrig_v2/config",
"${workspaceFolder}/src/bsps/stm32f767zi_conrig_v2"
]
},
{
"name": "stm32f756zg_nucleo",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f756zg_nucleo",
......@@ -255,6 +288,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_automated_antennas",
......@@ -278,6 +312,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_compute_unit",
......@@ -301,6 +336,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_compute_unit_v2",
......@@ -324,6 +360,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_rig_v2",
......@@ -347,12 +384,13 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_lyra_biscotto",
"_BOARD_STM32F767ZI_BIKESHED",
"_BOARD_STM32F767ZI_LYRA_BISCOTTO",
"_ARCH_CORTEXM7_STM32F7",
"STM32F769xx",
"STM32F767xx",
"HSE_VALUE=25000000",
"SYSCLK_FREQ_216MHz=216000000",
"__ENABLE_XRAM",
......@@ -370,6 +408,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_lyra_motor",
......@@ -393,6 +432,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_death_stack_v4",
......@@ -416,6 +456,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_gemini_gs",
......@@ -439,6 +480,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_gemini_motor",
......@@ -457,12 +499,84 @@
"${workspaceFolder}/src/bsps/stm32f767zi_gemini_motor"
]
},
// Miosix boards
{
"name": "stm32f767zi_lyra_gs",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_lyra_gs",
"_BOARD_STM32F767ZI_LYRA_GS",
"_ARCH_CORTEXM7_STM32F7",
"STM32F767xx",
"HSE_VALUE=25000000",
"SYSCLK_FREQ_216MHz=216000000",
"__ENABLE_XRAM",
"V_DDA_VOLTAGE=3.3f"
],
"includePath": [
"${defaultIncludePaths}",
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM7_stm32f7/common",
"${workspaceFolder}/src/bsps/stm32f767zi_lyra_gs/config",
"${workspaceFolder}/src/bsps/stm32f767zi_lyra_gs"
]
},
{
"name": "stm32f767zi_orion_biscotto",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_orion_biscotto",
"_BOARD_STM32F767ZI_ORION_BISCOTTO",
"_ARCH_CORTEXM7_STM32F7",
"STM32F767xx",
"HSE_VALUE=25000000",
"SYSCLK_FREQ_216MHz=216000000",
"__ENABLE_XRAM",
"V_DDA_VOLTAGE=3.3f"
],
"includePath": [
"${defaultIncludePaths}",
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM7_stm32f7/common",
"${workspaceFolder}/src/bsps/stm32f767zi_orion_biscotto/config",
"${workspaceFolder}/src/bsps/stm32f767zi_orion_biscotto"
]
},
{
"name": "stm32f767zi_orion_engine",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_orion_engine",
"_BOARD_STM32F767ZI_ORION_ENGINE",
"_ARCH_CORTEXM7_STM32F7",
"STM32F767xx",
"HSE_VALUE=25000000",
"SYSCLK_FREQ_216MHz=216000000",
"__ENABLE_XRAM",
"V_DDA_VOLTAGE=3.3f"
],
"includePath": [
"${defaultIncludePaths}",
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM7_stm32f7/common",
"${workspaceFolder}/src/bsps/stm32f767zi_orion_engine/config",
"${workspaceFolder}/src/bsps/stm32f767zi_orion_engine"
]
},
{
"name": "stm32f407vg_stm32f4discovery",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f407vg_stm32f4discovery",
......@@ -485,6 +599,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_stm32f4discovery",
......@@ -508,6 +623,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f767zi_nucleo",
......@@ -531,6 +647,7 @@
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f769ni_discovery",
......@@ -548,6 +665,30 @@
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM7_stm32f7/stm32f769ni_discovery",
"${workspaceFolder}/libs/miosix-kernel/miosix/config/arch/cortexM7_stm32f7/stm32f769ni_discovery"
]
},
{
"name": "stm32f429zi_lyra_cubesat",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_lyra_cubesat",
"_BOARD_STM32F429ZI_LYRA_CUBESAT",
"_ARCH_CORTEXM4_STM32F4",
"STM32F429xx",
"HSE_VALUE=8000000",
"SYSCLK_FREQ_168MHz=168000000",
"__ENABLE_XRAM",
"V_DDA_VOLTAGE=3.3f"
],
"includePath": [
"${defaultIncludePaths}",
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM4_stm32f4/common",
"${workspaceFolder}/src/bsps/stm32f429zi_lyra_cubesat/config",
"${workspaceFolder}/src/bsps/stm32f429zi_lyra_cubesat"
]
}
],
"version": 4
......
......@@ -21,13 +21,13 @@
cmake_minimum_required(VERSION 3.25)
enable_testing()
include(cmake/sbs.cmake)
#-----------------------------------------------------------------------------#
# Project #
#-----------------------------------------------------------------------------#
project(Boardcore)
include(cmake/sbs.cmake)
#-----------------------------------------------------------------------------#
# Entrypoints #
......@@ -129,6 +129,7 @@ sbs_target(test-hil stm32f767zi_death_stack_v4)
add_executable(catch-tests-boardcore
src/tests/catch/catch-tests-entry.cpp
src/tests/catch/skyQuaternion/test-skyquaternion.cpp
src/tests/catch/examples/example-test-factorial.cpp
src/tests/catch/test-aero.cpp
# src/tests/catch/test-buttonhandler.cpp
......@@ -147,6 +148,7 @@ add_executable(catch-tests-boardcore
src/tests/catch/test-pitot.cpp
src/tests/catch/test-units.cpp
src/tests/catch/test-registry-frontend.cpp
src/tests/catch/propagator/test-propagator.cpp
)
target_compile_definitions(catch-tests-boardcore PRIVATE USE_MOCK_PERIPHERALS)
sbs_target(catch-tests-boardcore stm32f429zi_stm32f4discovery)
......@@ -300,6 +302,9 @@ sbs_target(test-wiz5500 stm32f767zi_gemini_gs)
add_executable(test-bsram src/tests/drivers/test-bsram.cpp)
sbs_target(test-bsram stm32f767zi_lyra_biscotto)
add_executable(test-dipswitch src/tests/drivers/test-dipswitch.cpp)
sbs_target(test-dipswitch stm32f767zi_lyra_gs)
#-----------------------------------------------------------------------------#
# Tests - Events #
#-----------------------------------------------------------------------------#
......@@ -463,6 +468,10 @@ sbs_target(test-vn100-serial stm32f407vg_stm32f4discovery)
add_executable(test-vn100-spi src/tests/sensors/test-vn100-spi.cpp)
sbs_target(test-vn100-spi stm32f407vg_stm32f4discovery)
add_executable(test-vn300 src/tests/sensors/test-vn300.cpp)
sbs_target(test-vn300 stm32f767zi_compute_unit)
add_executable(test-lis2mdl src/tests/sensors/test-lis2mdl.cpp)
sbs_target(test-lis2mdl stm32f429zi_stm32f4discovery)
......@@ -478,6 +487,9 @@ sbs_target(test-lps22df stm32f767zi_nucleo)
add_executable(test-lsm6dsrx src/tests/sensors/test-lsm6dsrx.cpp)
sbs_target(test-lsm6dsrx stm32f407vg_stm32f4discovery)
add_executable(test-nd015x src/tests/sensors/test-nd015x.cpp)
sbs_target(test-nd015x stm32f767zi_lyra_biscotto)
#-----------------------------------------------------------------------------#
# Tests - Utils #
#-----------------------------------------------------------------------------#
......
......@@ -29,11 +29,17 @@ The project is built with the CMake build system. We also have our own script th
### Dependencies
The following are required to build the project:
* `CMake` 3.25
* `Git`
* `Miosix` Toolchain
We also recommend to install `Ccache`, `Ninja`, `OpenOCD`, `Cppcheck`,`ClangFormat` and `pre-commit` for a smoother development experience.
You will also need the following tools for linting and formatting:
* `Python3`
* `Cppcheck 2.7`
* `ClangFormat 18`
We also recommend to install `Ccache`, `Ninja`, `OpenOCD`, and `pre-commit` for a smoother development experience.
### Cloning the repo
......
......@@ -36,6 +36,7 @@ set(BOARDCORE_HOST_SRC
${SBS_BASE}/src/shared/algorithms/MEA/MEA.cpp
${SBS_BASE}/src/shared/algorithms/AirBrakes/AirBrakesPI.cpp
${SBS_BASE}/src/shared/algorithms/AirBrakes/AirBrakesInterp.cpp
${SBS_BASE}/src/shared/algorithms/Propagator/Propagator.cpp
# Logger
${SBS_BASE}/src/shared/logger/Logger.cpp
......
......@@ -19,8 +19,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# Load in BOARDCORE_PATH the project path
cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH BOARDCORE_PATH)
# Load in BOARDCORE_PATH the project path if not already defined
if (NOT DEFINED BOARDCORE_PATH)
cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH BOARDCORE_PATH)
endif()
# Include dependencies and board list
include(${BOARDCORE_PATH}/cmake/dependencies.cmake)
......@@ -42,6 +44,8 @@ set(BOARDCORE_SRC
${BOARDCORE_PATH}/src/shared/algorithms/AirBrakes/AirBrakesInterp.cpp
${BOARDCORE_PATH}/src/shared/algorithms/NAS/NAS.cpp
${BOARDCORE_PATH}/src/shared/algorithms/NAS/StateInitializer.cpp
${SBS_BASE}/src/shared/algorithms/Propagator/Propagator.cpp
${SBS_BASE}/src/shared/algorithms/Follower/Follower.cpp
# Debug
${BOARDCORE_PATH}/src/shared/utils/Debug.cpp
......@@ -64,6 +68,7 @@ set(BOARDCORE_SRC
${BOARDCORE_PATH}/src/shared/drivers/i2c/I2CDriver-f7.cpp
${BOARDCORE_PATH}/src/shared/drivers/i2c/I2C.cpp
${BOARDCORE_PATH}/src/shared/drivers/WIZ5500/WIZ5500.cpp
${BOARDCORE_PATH}/src/shared/drivers/DipSwitch/DipSwitch.cpp
# Events
${BOARDCORE_PATH}/src/shared/events/EventBroker.cpp
......@@ -109,12 +114,16 @@ set(BOARDCORE_SRC
${BOARDCORE_PATH}/src/shared/sensors/SensorSampler.cpp
${BOARDCORE_PATH}/src/shared/sensors/UBXGPS/UBXGPSSerial.cpp
${BOARDCORE_PATH}/src/shared/sensors/UBXGPS/UBXGPSSpi.cpp
${BOARDCORE_PATH}/src/shared/sensors/VN100/VN100Serial.cpp
${BOARDCORE_PATH}/src/shared/sensors/VN100/VN100Spi.cpp
${BOARDCORE_PATH}/src/shared/sensors/Vectornav/VNCommonSerial.cpp
${BOARDCORE_PATH}/src/shared/sensors/Vectornav/VN100/VN100Serial.cpp
${BOARDCORE_PATH}/src/shared/sensors/Vectornav/VN100/VN100Spi.cpp
${BOARDCORE_PATH}/src/shared/sensors/Vectornav/VN300/VN300.cpp
${BOARDCORE_PATH}/src/shared/sensors/LIS2MDL/LIS2MDL.cpp
${BOARDCORE_PATH}/src/shared/sensors/LPS28DFW/LPS28DFW.cpp
${BOARDCORE_PATH}/src/shared/sensors/LPS22DF/LPS22DF.cpp
${BOARDCORE_PATH}/src/shared/sensors/LSM6DSRX/LSM6DSRX.cpp
${BOARDCORE_PATH}/src/shared/sensors/ND015X/ND015D.cpp
${BOARDCORE_PATH}/src/shared/sensors/ND015X/ND015A.cpp
# Calibration
${BOARDCORE_PATH}/src/shared/sensors/calibration/BiasCalibration/BiasCalibration.cpp
......
......@@ -38,6 +38,11 @@ set(BOARDCORE_BOARDS_OPTIONS_FILES
${BOARDCORE_PATH}/src/bsps/stm32f767zi_gemini_motor/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_death_stack_v4/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_rig_v2/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_conrig_v2/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_biscotto/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_motor/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_gs/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f429zi_lyra_cubesat/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_orion_biscotto/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_orion_engine/config/board_options.cmake
)
......@@ -21,36 +21,52 @@
enable_language(C CXX ASM)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Load in SBS_BASE the project path
cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH SBS_BASE)
# Load in BOARDCORE_PATH the boardcore path
cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH BOARDCORE_PATH)
# Add the version information header to the global include path, so that all
# targets defined after this point will have access to it (Boardcore, Kernel)
include_directories(${BOARDCORE_PATH}/version)
# Include the Boardcore libraries
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include(boardcore)
# Command to print all the available boards used by the sbs script
string(REPLACE ";" "\\n" BOARDS_STR "${MIOSIX_BOARDS};${BOARDCORE_BOARDS}")
add_custom_target(
help-boards
COMMAND printf ${BOARDS_STR}
COMMENT "All boards available:"
VERBATIM
)
# Function to link the Boardcore library to the target
function(sbs_target TARGET OPT_BOARD)
if(NOT OPT_BOARD)
message(FATAL_ERROR "No board selected")
endif()
# The only include directory of Boardcore is shared!
target_include_directories(${TARGET} PRIVATE src/shared)
# Define the version information generation command
add_custom_target(${TARGET}-version-info
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/generated/${TARGET}/version.cpp
COMMAND "${CMAKE_COMMAND}"
"-D" "TARGET_NAME=${TARGET}"
"-D" "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
"-D" "BOARDCORE_PATH=${BOARDCORE_PATH}"
"-D" "OUT_DIR=${CMAKE_CURRENT_BINARY_DIR}/generated/${TARGET}"
"-P" "${BOARDCORE_PATH}/cmake/version.cmake"
COMMENT "Generating version information file for ${TARGET}"
VERBATIM
)
# Build the generated version information file as part of the target
target_sources(${TARGET} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/generated/${TARGET}/version.cpp
)
if(CMAKE_CROSSCOMPILING)
# Link the embedded Boardcore library
target_link_libraries(${TARGET} PRIVATE Skyward::Boardcore::${OPT_BOARD})
# Linker script and linking options are eredited from the kernel library
# Linker script and linking options are inherited from the kernel library
# Add a post build command to create the hex file to flash on the board
add_custom_command(
......
# Copyright (c) 2025 Skyward Experimental Rocketry
# Author: Niccolò Betto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# --- Version Information File Generation ---
# Find Git executable
find_package(Git REQUIRED QUIET)
set(GIT_WORKING_DIR ${CMAKE_SOURCE_DIR})
# Determine dirty status
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --dirty --always --broken
WORKING_DIRECTORY ${GIT_WORKING_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT # We don't use the output directly, just for the dirty check
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE GIT_DESCRIBE_RESULT
ERROR_QUIET # Ignore errors
)
set(GIT_DIRTY_SUFFIX "")
# Check if the command succeeded AND if its output ends with "-dirty"
if(GIT_DESCRIBE_RESULT EQUAL 0 AND GIT_DESCRIBE_OUTPUT MATCHES "-dirty$")
set(GIT_DIRTY_SUFFIX "-dirty")
endif()
# Get *annotated* tag name
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --exact-match HEAD
WORKING_DIRECTORY ${GIT_WORKING_DIR}
OUTPUT_VARIABLE GIT_TAG # Captures the annotated tag name if successful
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE GIT_EXACT_TAG_RESULT # Will be 0 on success, non-zero on failure
ERROR_QUIET # Ignore errors, we expect this to fail when not on an annotated tag
)
# Get branch name
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${GIT_WORKING_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
# No ERROR_QUIET/RESULT_VARIABLE -> CMake halts on git command failure
)
# Get short commit hash
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${GIT_WORKING_DIR}
OUTPUT_VARIABLE GIT_REV
OUTPUT_STRIP_TRAILING_WHITESPACE
# No ERROR_QUIET/RESULT_VARIABLE -> CMake halts on git command failure
)
# Determine the version info based on tag match result
set(GIT_VERSION_INFO "")
if(GIT_EXACT_TAG_RESULT EQUAL 0)
# Use the tag name when exactly on an annotated tag
set(GIT_VERSION_INFO "${GIT_TAG}")
else()
# Use branch-rev when not on a tag
set(GIT_VERSION_INFO "${GIT_BRANCH}-${GIT_REV}")
endif()
# Construct the final version string
# Format: <annotated_tag>[-dirty] OR <branch>-<hash>[-dirty]
set(GIT_VERSION_STRING "${GIT_VERSION_INFO}${GIT_DIRTY_SUFFIX}")
# Additional variables set by the called of this script via command line args:
# - TARGET_NAME
# - CMAKE_BUILD_TYPE
configure_file(
"${BOARDCORE_PATH}/version/version.cpp.in"
"${OUT_DIR}/version.cpp"
)