From fba19329b09d19fc7a5bf26f15654463b6d647c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20S=C3=A1ez?= Date: Fri, 6 Feb 2026 12:24:47 +0100 Subject: [PATCH 1/6] Added presets --- .github/workflows/build.yml | 6 +- .github/workflows/compile-checks.yml | 9 +- .github/workflows/tests.yml | 85 ++++++++ .vscode/launch.json | 111 ++++++++--- .vscode/tasks.json | 32 +-- CMakeLists.txt | 287 +++++++++++++++++---------- CMakePresets.json | 94 ++++++--- Core/Inc/Code_generation/JSON_ADE | 2 +- Core/Src/main.cpp | 50 +++-- deps/ST-LIB | 2 +- 10 files changed, 477 insertions(+), 201 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2864d04..196da5a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: preset: description: > CMake preset to build the project, run - `cmake --build --list-presets` to see options + `cmake --list-presets` to see options required: false type: string default: 'nucleo-debug' @@ -20,7 +20,7 @@ on: preset: description: > CMake preset to build the project, run - `cmake --build --list-presets` to see options + `cmake --list-presets` to see options required: false type: string default: 'nucleo-debug' @@ -76,4 +76,4 @@ jobs: path: out/build/latest.elf retention-days: 7 compression-level: 0 - if-no-files-found: error \ No newline at end of file + if-no-files-found: error diff --git a/.github/workflows/compile-checks.yml b/.github/workflows/compile-checks.yml index 9cfea1a7..3798a961 100644 --- a/.github/workflows/compile-checks.yml +++ b/.github/workflows/compile-checks.yml @@ -28,9 +28,12 @@ jobs: - board-debug - board-release - board-relwithdebinfo - - board-debug-eth - - board-release-eth - - board-relwithdebinfo-eth + - board-debug-eth-ksz8041 + - board-debug-eth-lan8742 + - board-release-eth-ksz8041 + - board-release-eth-lan8742 + - board-relwithdebinfo-eth-ksz8041 + - board-relwithdebinfo-eth-lan8742 # - simulator fail-fast: false uses: ./.github/workflows/build.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..ed959ee8 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,85 @@ +name: Run tests + +on: + workflow_dispatch: + pull_request: + paths: + - '**.cpp' + - '**.hpp' + - '**.c' + - '**.h' + - '**.py' + - 'CMakeLists.txt' + - 'CMakePresets.json' + - 'requirements.txt' + - 'tools/**' + - 'deps/ST-LIB/**' + branches: + - main + +concurrency: + group: tests-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + tests: + name: Simulator tests + runs-on: ubuntu-24.04 + timeout-minutes: 30 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: false + fetch-depth: 1 + + - name: Init submodules + run: | + git config --global --add safe.directory '*' + git submodule update --init --depth 1 + ./deps/ST-LIB/tools/init-submodules.sh + shell: bash + + - name: Cache simulator deps + uses: actions/cache@v4 + with: + path: out/build/simulator/_deps + key: simulator-deps-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'deps/ST-LIB/Tests/CMakeLists.txt') }} + restore-keys: | + simulator-deps-${{ runner.os }}- + + - name: Setup Python environment + run: | + python3 -m venv virtual + source virtual/bin/activate + pip install --upgrade pip + pip install -r requirements.txt + shell: bash + + - name: Configure (CMake) + run: | + source virtual/bin/activate + cmake --preset simulator + shell: bash + + - name: Build + run: | + source virtual/bin/activate + cmake --build --preset simulator + shell: bash + + - name: Run tests (ctest) + run: | + ctest --test-dir out/build/simulator --no-tests=error --output-on-failure + shell: bash + + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: simulator-test-reports + path: | + out/build/simulator/Testing/Temporary/LastTest.log + retention-days: 7 + if-no-files-found: ignore diff --git a/.vscode/launch.json b/.vscode/launch.json index dea90b45..2b644dbf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,6 @@ { - "version": "0.2.0", - "configurations": [ + "version": "0.2.0", + "configurations": [ { "name": "Build and Debug STM32H723 (OpenOCD + RTT)", "type": "cortex-debug", @@ -16,7 +16,7 @@ "device": "STM32H723ZGTx", "interface": "swd", "runToEntryPoint": "main", - "svdFile":"./STM32H723.svd", + "svdFile": "./STM32H723.svd", "showDevDebugOutput": "parsed", "postLaunchCommands": [ "monitor rtt setup 0x24000000 0x24080000 \"SEGGER RTT\"", @@ -39,8 +39,7 @@ } ] }, - "preLaunchTask": "CMake: build then pre-flash check" - + "preLaunchTask": "CMake: build" }, { "name": "Debug STM32H723 (OpenOCD + RTT) - No Build", @@ -57,7 +56,7 @@ "device": "STM32H723ZGTx", "interface": "swd", "runToEntryPoint": "main", - "svdFile":"./STM32H723.svd", + "svdFile": "./STM32H723.svd", "showDevDebugOutput": "parsed", "postLaunchCommands": [ "monitor rtt setup 0x24000000 0x24080000 \"SEGGER RTT\"", @@ -80,26 +79,86 @@ } ] }, - "preLaunchTask": "Pre-flash check" + // "preLaunchTask": "Pre-flash check" }, - { - "name": "Debug simulator on Rosetta", - "type": "cppdbg", - "request": "launch", - "program": "out/build/latest.elf", - "miDebuggerServerAddress": "localhost:1234", - "miDebuggerPath": "/usr/bin/gdb", - "MIMode": "gdb", - "setupCommands": [ { - "description": "Set architecture to x86-64", - "text": "set architecture i386:x86-64", - "ignoreFailures": false + "name": "Debug simulator on Rosetta", + "type": "cppdbg", + "request": "launch", + "program": "out/build/latest.elf", + "miDebuggerServerAddress": "localhost:1234", + "miDebuggerPath": "/usr/bin/gdb", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Set architecture to x86-64", + "text": "set architecture i386:x86-64", + "ignoreFailures": false + } + ], + "preLaunchTask": "Start Debug Server for Simulator on emulated arch", + "cwd": "${workspaceFolder}", + "externalConsole": false + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Build and Debug Project", + "servertype": "stlink", + "cwd": "${workspaceRoot}", + "runToEntryPoint": "main", + "showDevDebugOutput": "raw", + "executable": "out/build/latest.elf", + "device": "STM32H723ZG", + "configFiles": [ + ".vscode/stlink.cfg", + ".vscode/stm32h7x.cfg" + ], + "svdFile": ".vscode/STM32H723.svd", + "swoConfig": { + "enabled": true, + "cpuFrequency": 8000000, + "swoFrequency": 2000000, + "source": "probe", + "decoders": [ + { + "type": "console", + "label": "ITM", + "port": 0 + } + ] + }, + "preLaunchTask": "CMake: build" + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug Project", + "servertype": "stlink", + "cwd": "${workspaceRoot}", + "runToEntryPoint": "main", + "showDevDebugOutput": "raw", + "executable": "out/build/latest.elf", + "device": "STM32H723ZG", + "configFiles": [ + ".vscode/stlink.cfg", + ".vscode/stm32h7x.cfg" + ], + "svdFile": "./STM32H723.svd", + "swoConfig": { + "enabled": true, + "cpuFrequency": 8000000, + "swoFrequency": 2000000, + "source": "probe", + "decoders": [ + { + "type": "console", + "label": "ITM", + "port": 0 + } + ] + }, + "stm32cubeprogrammer": "/opt/st/stm32cubeclt_1.16.0/STM32CubeProgrammer/bin" } - ], - "preLaunchTask": "Start Debug Server for Simulator on emulated arch", - "cwd": "${workspaceFolder}", - "externalConsole": false - } - ] -} + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index bf4f5d3f..f393b8b6 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -8,22 +8,22 @@ "problemMatcher": [], "isBackground": true }, - { - "label": "Pre-flash check", - "type": "shell", - "command": "${workspaceFolder}/virtual/bin/python", - "windows": { - "command": "${workspaceFolder}/virtual/Scripts/python" - }, - "args": [ - "${workspaceFolder}/tools/preflash_check.py" - ], - "problemMatcher": [], - "presentation": { - "reveal": "always", - "panel": "shared" - } - }, + // { + // "label": "Pre-flash check", + // "type": "shell", + // "command": "${workspaceFolder}/virtual/bin/python", + // "windows": { + // "command": "${workspaceFolder}/virtual/Scripts/python" + // }, + // "args": [ + // "${workspaceFolder}/tools/preflash_check.py" + // ], + // "problemMatcher": [], + // "presentation": { + // "reveal": "always", + // "panel": "shared" + // } + // }, { "label": "CMake: build then pre-flash check", "dependsOn": ["CMake: build", "Pre-flash check"], diff --git a/CMakeLists.txt b/CMakeLists.txt index 354cbc73..0404ace1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,29 +11,33 @@ find_package(Python3 COMPONENTS Interpreter REQUIRED) set(GENERATOR_SCRIPT "${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Generator.py") -add_custom_target(run_generator ALL - COMMAND ${Python3_EXECUTABLE} ${GENERATOR_SCRIPT} ${Board} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} -) - if(CMAKE_HOST_WIN32 ) - set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/Scripts/python) +set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/Scripts/python) else() - set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/bin/python) +set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/bin/python) endif() -add_custom_target( - my_custom_target_that_always_runs ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_tmp.h -) -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/_tmp.h # fake! ensure we run! - COMMAND ${VENV_PYTHON} ${CMAKE_SOURCE_DIR}/tools/generate_binary_metadata.py -) - option(USE_ETHERNET "Enable ethernet peripheral" OFF) option(TARGET_NUCLEO "Targets the STM32H723 Nucleo development board" OFF) +option(BUILD_EXAMPLES "Build Core/Src/Examples sources" OFF) +option(USE_CCACHE "Use ccache if available" ON) +if(NOT DEFINED ENABLE_LTO) + if(CMAKE_CROSSCOMPILING) + set(ENABLE_LTO OFF) + else() + set(ENABLE_LTO ON) + endif() +endif() +set(ENABLE_LTO "${ENABLE_LTO}" CACHE BOOL "Enable link-time optimization (LTO)") + +if(USE_CCACHE) + find_program(CCACHE_PROGRAM ccache) + if(CCACHE_PROGRAM) + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM}) + set(CMAKE_ASM_COMPILER_LAUNCHER ${CCACHE_PROGRAM}) + endif() +endif() if (PROJECT_IS_TOP_LEVEL AND (NOT CMAKE_CROSSCOMPILING)) include(FetchContent) @@ -56,115 +60,182 @@ message(STATUS "Template project: TARGET_NUCLEO = ${TARGET_NUCLEO}") add_subdirectory(${STLIB_DIR}) message(STATUS "Using ST-LIB target: ${STLIB_LIBRARY}") -file(GLOB_RECURSE SOURCE_C ${CMAKE_SOURCE_DIR}/Core/*.c) -file(GLOB_RECURSE SOURCE_CPP ${CMAKE_SOURCE_DIR}/Core/*.cpp) -file(GLOB_RECURSE SOURCE_H ${CMAKE_SOURCE_DIR}/Core/*.h) -file(GLOB_RECURSE SOURCE_HPP ${CMAKE_SOURCE_DIR}/Core/*.hpp) - -add_executable(${EXECUTABLE} - ${SOURCE_C} - ${SOURCE_CPP} - ${SOURCE_H} - ${SOURCE_HPP} - - $<$:${STLIB_DIR}/startup_stm32h723zgtx.s> +file(GLOB_RECURSE GENERATOR_JSONS + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/JSON_ADE/*.json ) -target_link_libraries(${EXECUTABLE} PRIVATE - ${STLIB_LIBRARY} -) - -set_target_properties(${EXECUTABLE} PROPERTIES - CXX_STANDARD 23 - CXX_STANDARD_REQUIRED YES - C_STANDARD 17 - C_STANDARD_REQUIRED YES +set(GENERATED_DATA_PACKETS ${CMAKE_SOURCE_DIR}/Core/Inc/Communications/Packets/DataPackets.hpp) +set(GENERATED_ORDER_PACKETS ${CMAKE_SOURCE_DIR}/Core/Inc/Communications/Packets/OrderPackets.hpp) +set(GENERATED_STATE_MACHINE ${CMAKE_SOURCE_DIR}/Core/Inc/state_machine.hpp) +add_custom_command( + OUTPUT + ${GENERATED_DATA_PACKETS} + ${GENERATED_ORDER_PACKETS} + ${GENERATED_STATE_MACHINE} + COMMAND ${VENV_PYTHON} ${GENERATOR_SCRIPT} ${Board} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + DEPENDS + ${GENERATOR_SCRIPT} + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/Packet_generation.py + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/DataTemplate.hpp + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/OrderTemplate.hpp + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/State_machine_generation/State_machine_generation.py + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/State_machine_generation/State_machine_description.py + ${CMAKE_SOURCE_DIR}/state_machine.json + ${GENERATOR_JSONS} + COMMENT "Generating packets and state machine" ) -target_compile_definitions(${EXECUTABLE} PRIVATE - $<$:STLIB_ETH> - $,NUCLEO,BOARD> - $,HSE_VALUE=8000000,HSE_VALUE=25000000> +add_custom_target(run_generator ALL + DEPENDS + ${GENERATED_DATA_PACKETS} + ${GENERATED_ORDER_PACKETS} + ${GENERATED_STATE_MACHINE} ) -target_compile_options(${EXECUTABLE} PRIVATE - $<$:-mcpu=cortex-m7> - $<$:-mfpu=fpv5-d16> - $<$:-mfloat-abi=hard> - $<$:-mthumb> - $<$:-specs=nosys.specs> - -g - -ffunction-sections - -fdata-sections - -fno-exceptions - - -Wno-psabi - - $<$:-w> - - $<$:-Wall> - # $<$:-Wpedantic> - $<$:-Werror> - $<$:-fno-use-cxa-atexit> - $<$:-fno-rtti> +file(GLOB_RECURSE METADATA_SOURCES + ${CMAKE_SOURCE_DIR}/Core/*.c + ${CMAKE_SOURCE_DIR}/Core/*.cpp + ${CMAKE_SOURCE_DIR}/Core/*.h + ${CMAKE_SOURCE_DIR}/Core/*.hpp ) -target_include_directories(${EXECUTABLE} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/Core/Inc -) +set(METADATA_OUTPUT ${CMAKE_SOURCE_DIR}/Core/Src/Runes/generated_metadata.cpp) +set(METADATA_TEMPLATE ${CMAKE_SOURCE_DIR}/tools/binary_metadata_template.cpp) +set(METADATA_SCRIPT ${CMAKE_SOURCE_DIR}/tools/generate_binary_metadata.py) -target_link_options(${EXECUTABLE} PRIVATE - $<$:-T${LD_SCRIPT}> - $<$:-mcpu=cortex-m7> - $<$:-mthumb> - $<$:-mfpu=fpv5-d16> - $<$:-mfloat-abi=hard> - $<$:-specs=nosys.specs> - $<$:-lc> - $<$:-lm> - $<$:-lnosys> - $<$:-Wl,-Map=${PROJECT_NAME}.map,--cref> - $<$:-Wl,--gc-sections> -) +list(REMOVE_ITEM METADATA_SOURCES ${METADATA_OUTPUT}) -add_custom_target(generate_binary_metadata ALL - COMMAND ${VENV_PYTHON} ${CMAKE_SOURCE_DIR}/tools/generate_binary_metadata.py +add_custom_command( + OUTPUT ${METADATA_OUTPUT} + COMMAND ${VENV_PYTHON} ${METADATA_SCRIPT} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + DEPENDS + ${METADATA_SCRIPT} + ${METADATA_TEMPLATE} + ${METADATA_SOURCES} COMMENT "Generating binary metadata" ) -add_dependencies(${EXECUTABLE} generate_binary_metadata) -if (PROJECT_IS_TOP_LEVEL) - execute_process( - COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_BINARY_DIR}/compile_commands.json - ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json - ) -endif() -# Post-build: Copy binary to out/build/latest.elf and create marker for BOARD builds -add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - # Create output directory - COMMAND ${CMAKE_COMMAND} -E make_directory - ${CMAKE_SOURCE_DIR}/out/build - # Copy the built binary to out/build/latest.elf - COMMAND ${CMAKE_COMMAND} -E copy - $ - ${CMAKE_SOURCE_DIR}/out/build/latest.elf - COMMENT "Copying ${EXECUTABLE} to out/build/latest.elf" +add_custom_target(generate_binary_metadata + DEPENDS ${METADATA_OUTPUT} ) -# Create or remove marker file for BOARD builds (used by preflash_check.py) -if(NOT TARGET_NUCLEO) - add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_SOURCE_DIR}/out/build/board_build_marker - COMMENT "Creating BOARD build marker for pre-flash check" +if(CMAKE_CROSSCOMPILING) + file(GLOB_RECURSE SOURCE_C ${CMAKE_SOURCE_DIR}/Core/*.c) + file(GLOB_RECURSE SOURCE_CPP ${CMAKE_SOURCE_DIR}/Core/*.cpp) + file(GLOB_RECURSE SOURCE_H ${CMAKE_SOURCE_DIR}/Core/*.h) + file(GLOB_RECURSE SOURCE_HPP ${CMAKE_SOURCE_DIR}/Core/*.hpp) + + if(NOT BUILD_EXAMPLES) + file(GLOB_RECURSE EXAMPLE_CPP ${CMAKE_SOURCE_DIR}/Core/Src/Examples/*.cpp) + list(REMOVE_ITEM SOURCE_CPP ${EXAMPLE_CPP}) + endif() + + add_executable(${EXECUTABLE} + ${SOURCE_C} + ${SOURCE_CPP} + ${SOURCE_H} + ${SOURCE_HPP} + + $<$:${STLIB_DIR}/startup_stm32h723zgtx.s> ) -else() - add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_SOURCE_DIR}/out/build/board_build_marker - COMMENT "Removing BOARD build marker (NUCLEO build)" + + target_link_libraries(${EXECUTABLE} PRIVATE + ${STLIB_LIBRARY} + ) + + set_target_properties(${EXECUTABLE} PROPERTIES + CXX_STANDARD 23 + CXX_STANDARD_REQUIRED YES + C_STANDARD 17 + C_STANDARD_REQUIRED YES + ) + + target_compile_definitions(${EXECUTABLE} PRIVATE + $<$:STLIB_ETH> + $,NUCLEO,BOARD> + $,HSE_VALUE=8000000,HSE_VALUE=25000000> + ) + + target_compile_options(${EXECUTABLE} PRIVATE + $<$:-mcpu=cortex-m7> + $<$:-mfpu=fpv5-d16> + $<$:-mfloat-abi=hard> + $<$:-mthumb> + $<$:-specs=nosys.specs> + $<$:-g> + $<$:-g> + -ffunction-sections + -fdata-sections + -fno-exceptions + + -Wno-psabi + + $<$:-w> + + $<$:-Wall> + # $<$:-Wpedantic> + $<$:-Werror> + $<$:-fno-use-cxa-atexit> + $<$:-fno-rtti> + ) + + target_include_directories(${EXECUTABLE} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/Core/Inc ) -endif() + target_link_options(${EXECUTABLE} PRIVATE + $<$:-T${LD_SCRIPT}> + $<$:-mcpu=cortex-m7> + $<$:-mthumb> + $<$:-mfpu=fpv5-d16> + $<$:-mfloat-abi=hard> + $<$:-specs=nosys.specs> + $<$:-lc> + $<$:-lm> + $<$:-lnosys> + $<$:-Wl,-Map=${PROJECT_NAME}.map,--cref> + $<$:-Wl,--gc-sections> + ) + + add_dependencies(${EXECUTABLE} run_generator generate_binary_metadata) + if(ENABLE_LTO) + set_property(TARGET ${EXECUTABLE} PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) + set_property(TARGET ${EXECUTABLE} PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON) + endif() + + # Post-build: Copy binary to out/build/latest.elf and create marker for BOARD builds + add_custom_command(TARGET ${EXECUTABLE} POST_BUILD + # Create output directory + COMMAND ${CMAKE_COMMAND} -E make_directory + ${CMAKE_SOURCE_DIR}/out/build + # Copy the built binary to out/build/latest.elf + COMMAND ${CMAKE_COMMAND} -E copy + $ + ${CMAKE_SOURCE_DIR}/out/build/latest.elf + COMMENT "Copying ${EXECUTABLE} to out/build/latest.elf" + ) + + # Create or remove marker file for BOARD builds (used by preflash_check.py) + if(NOT TARGET_NUCLEO) + add_custom_command(TARGET ${EXECUTABLE} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_SOURCE_DIR}/out/build/board_build_marker + COMMENT "Creating BOARD build marker for pre-flash check" + ) + else() + add_custom_command(TARGET ${EXECUTABLE} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_SOURCE_DIR}/out/build/board_build_marker + COMMENT "Removing BOARD build marker (NUCLEO build)" + ) + endif() +endif() +if (PROJECT_IS_TOP_LEVEL) + execute_process( + COMMAND ${CMAKE_COMMAND} -E create_symlink + ${CMAKE_BINARY_DIR}/compile_commands.json + ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json + ) +endif() diff --git a/CMakePresets.json b/CMakePresets.json index 3c341ea8..38087504 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -123,36 +123,75 @@ } }, { - "name": "board-debug-eth", - "displayName": "Board [DBG] [ETH]", + "name": "board-debug-eth-ksz8041", + "displayName": "Board [DBG] [ETH] [KSZ8041]", "inherits": [ "mcu" ], "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "USE_ETHERNET": "ON" + "USE_ETHERNET": "ON", + "PHY_TYPE": "KSZ8041" } }, { - "name": "board-release-eth", - "displayName": "Board [REL] [ETH]", + "name": "board-debug-eth-lan8742", + "displayName": "Board [DBG] [ETH] [LAN8742]", + "inherits": [ + "mcu" + ], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "USE_ETHERNET": "ON", + "PHY_TYPE": "LAN8742" + } + }, + { + "name": "board-release-eth-ksz8041", + "displayName": "Board [REL] [ETH] [KSZ8041]", "inherits": [ "mcu" ], "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "USE_ETHERNET": "ON" + "USE_ETHERNET": "ON", + "PHY_TYPE": "KSZ8041" + } + }, + { + "name": "board-release-eth-lan8742", + "displayName": "Board [REL] [ETH] [LAN8742]", + "inherits": [ + "mcu" + ], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "USE_ETHERNET": "ON", + "PHY_TYPE": "LAN8742" } }, { - "name": "board-relwithdebinfo-eth", - "displayName": "Board [RWD] [ETH]", + "name": "board-relwithdebinfo-eth-ksz8041", + "displayName": "Board [RWD] [ETH] [KSZ8041]", "inherits": [ "mcu" ], "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "USE_ETHERNET": "ON" + "USE_ETHERNET": "ON", + "PHY_TYPE": "KSZ8041" + } + }, + { + "name": "board-relwithdebinfo-eth-lan8742", + "displayName": "Board [RWD] [ETH] [LAN8742]", + "inherits": [ + "mcu" + ], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "USE_ETHERNET": "ON", + "PHY_TYPE": "LAN8742" } }, { @@ -169,67 +208,66 @@ "buildPresets": [ { "name": "nucleo-debug", - "displayName": "Nucleo [DBG]", "configurePreset": "nucleo-debug" }, { "name": "nucleo-release", - "displayName": "Nucleo [REL]", "configurePreset": "nucleo-release" }, { "name": "nucleo-relwithdebinfo", - "displayName": "Nucleo [RWD]", "configurePreset": "nucleo-relwithdebinfo" }, { "name": "nucleo-debug-eth", - "displayName": "Nucleo [DBG] [ETH]", "configurePreset": "nucleo-debug-eth" }, { "name": "nucleo-release-eth", - "displayName": "Nucleo [REL] [ETH]", "configurePreset": "nucleo-release-eth" }, { "name": "nucleo-relwithdebinfo-eth", - "displayName": "Nucleo [RWD] [ETH]", "configurePreset": "nucleo-relwithdebinfo-eth" }, { "name": "board-debug", - "displayName": "Board [DBG]", "configurePreset": "board-debug" }, { "name": "board-release", - "displayName": "Board [REL]", "configurePreset": "board-release" }, { "name": "board-relwithdebinfo", - "displayName": "Board [RWD]", "configurePreset": "board-relwithdebinfo" }, { - "name": "board-debug-eth", - "displayName": "Board [DBG] [ETH]", - "configurePreset": "board-debug-eth" + "name": "board-debug-eth-ksz8041", + "configurePreset": "board-debug-eth-ksz8041" + }, + { + "name": "board-debug-eth-lan8742", + "configurePreset": "board-debug-eth-lan8742" }, { - "name": "board-release-eth", - "displayName": "Board [REL] [ETH]", - "configurePreset": "board-release-eth" + "name": "board-release-eth-ksz8041", + "configurePreset": "board-release-eth-ksz8041" }, { - "name": "board-relwithdebinfo-eth", - "displayName": "Board [RWD] [ETH]", - "configurePreset": "board-relwithdebinfo-eth" + "name": "board-release-eth-lan8742", + "configurePreset": "board-release-eth-lan8742" + }, + { + "name": "board-relwithdebinfo-eth-ksz8041", + "configurePreset": "board-relwithdebinfo-eth-ksz8041" + }, + { + "name": "board-relwithdebinfo-eth-lan8742", + "configurePreset": "board-relwithdebinfo-eth-lan8742" }, { "name": "simulator", - "displayName": "Simulator", "configurePreset": "simulator" } ] diff --git a/Core/Inc/Code_generation/JSON_ADE b/Core/Inc/Code_generation/JSON_ADE index ee857f81..76d1b303 160000 --- a/Core/Inc/Code_generation/JSON_ADE +++ b/Core/Inc/Code_generation/JSON_ADE @@ -1 +1 @@ -Subproject commit ee857f81e0aef674a19f8fc5db4a2d3c28a75a51 +Subproject commit 76d1b30360d881a6af4ef9dbf307f418980c9594 diff --git a/Core/Src/main.cpp b/Core/Src/main.cpp index c367556e..94e6b8ee 100644 --- a/Core/Src/main.cpp +++ b/Core/Src/main.cpp @@ -1,23 +1,43 @@ #include "Examples/ExampleMPU.cpp" #include "Examples/ExamplesHardFault.cpp" -#include "main.h" #include "ST-LIB.hpp" +#include "main.h" -int main(void) { - Hard_fault_check(); - STLIB::start(); - - using myBoard = ST_LIB::Board<>; - myBoard::init(); - +using namespace ST_LIB; + +constexpr auto led = + ST_LIB::DigitalOutputDomain::DigitalOutput(ST_LIB::PB0); + +#ifdef STLIB_ETH +constexpr auto eth = + EthernetDomain::Ethernet(EthernetDomain::PINSET_H11, "00:80:e1:00:01:07", + "192.168.1.7", "255.255.0.0"); + +using myBoard = ST_LIB::Board; +#else +using myBoard = ST_LIB::Board; +#endif + +int main(void) { + Hard_fault_check(); + + myBoard::init(); +#ifdef STLIB_ETH + auto eth_instance = &myBoard::instance_of(); +#endif + auto led_instance = &myBoard::instance_of(); + + while (1) { +#ifdef STLIB_ETH + eth_instance->update(); +#endif + led_instance->toggle(); + HAL_Delay(100); + } +} +void Error_Handler(void) { + ErrorHandler("HAL error handler triggered"); while (1) { - STLIB::update(); } } -void Error_Handler(void) { - ErrorHandler("HAL error handler triggered"); - while (1) { - } -} - diff --git a/deps/ST-LIB b/deps/ST-LIB index 80d9efef..49215110 160000 --- a/deps/ST-LIB +++ b/deps/ST-LIB @@ -1 +1 @@ -Subproject commit 80d9efef0634408b10695db836da861a702bcde2 +Subproject commit 49215110d0b13cfe4645051dfc1b957276e1e175 From 788ddad903e5c2f65de79951dd0459cac586e8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20S=C3=A1ez?= Date: Fri, 6 Feb 2026 17:48:17 +0100 Subject: [PATCH 2/6] three phys working --- .github/workflows/compile-checks.yml | 6 ++--- CMakePresets.json | 32 +++++++++++----------- Core/Src/main.cpp | 40 +++++++++++++++++----------- deps/ST-LIB | 2 +- 4 files changed, 45 insertions(+), 35 deletions(-) diff --git a/.github/workflows/compile-checks.yml b/.github/workflows/compile-checks.yml index 3798a961..19c1e5b1 100644 --- a/.github/workflows/compile-checks.yml +++ b/.github/workflows/compile-checks.yml @@ -29,11 +29,11 @@ jobs: - board-release - board-relwithdebinfo - board-debug-eth-ksz8041 - - board-debug-eth-lan8742 + - board-debug-eth-lan8700 - board-release-eth-ksz8041 - - board-release-eth-lan8742 + - board-release-eth-lan8700 - board-relwithdebinfo-eth-ksz8041 - - board-relwithdebinfo-eth-lan8742 + - board-relwithdebinfo-eth-lan8700 # - simulator fail-fast: false uses: ./.github/workflows/build.yml diff --git a/CMakePresets.json b/CMakePresets.json index 38087504..f59704a4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -135,15 +135,15 @@ } }, { - "name": "board-debug-eth-lan8742", - "displayName": "Board [DBG] [ETH] [LAN8742]", + "name": "board-debug-eth-lan8700", + "displayName": "Board [DBG] [ETH] [LAN8700]", "inherits": [ "mcu" ], "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", "USE_ETHERNET": "ON", - "PHY_TYPE": "LAN8742" + "PHY_TYPE": "LAN8700" } }, { @@ -159,15 +159,15 @@ } }, { - "name": "board-release-eth-lan8742", - "displayName": "Board [REL] [ETH] [LAN8742]", + "name": "board-release-eth-lan8700", + "displayName": "Board [REL] [ETH] [LAN8700]", "inherits": [ "mcu" ], "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", "USE_ETHERNET": "ON", - "PHY_TYPE": "LAN8742" + "PHY_TYPE": "LAN8700" } }, { @@ -183,15 +183,15 @@ } }, { - "name": "board-relwithdebinfo-eth-lan8742", - "displayName": "Board [RWD] [ETH] [LAN8742]", + "name": "board-relwithdebinfo-eth-lan8700", + "displayName": "Board [RWD] [ETH] [LAN8700]", "inherits": [ "mcu" ], "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", "USE_ETHERNET": "ON", - "PHY_TYPE": "LAN8742" + "PHY_TYPE": "LAN8700" } }, { @@ -247,28 +247,28 @@ "configurePreset": "board-debug-eth-ksz8041" }, { - "name": "board-debug-eth-lan8742", - "configurePreset": "board-debug-eth-lan8742" + "name": "board-debug-eth-lan8700", + "configurePreset": "board-debug-eth-lan8700" }, { "name": "board-release-eth-ksz8041", "configurePreset": "board-release-eth-ksz8041" }, { - "name": "board-release-eth-lan8742", - "configurePreset": "board-release-eth-lan8742" + "name": "board-release-eth-lan8700", + "configurePreset": "board-release-eth-lan8700" }, { "name": "board-relwithdebinfo-eth-ksz8041", "configurePreset": "board-relwithdebinfo-eth-ksz8041" }, { - "name": "board-relwithdebinfo-eth-lan8742", - "configurePreset": "board-relwithdebinfo-eth-lan8742" + "name": "board-relwithdebinfo-eth-lan8700", + "configurePreset": "board-relwithdebinfo-eth-lan8700" }, { "name": "simulator", "configurePreset": "simulator" } ] -} \ No newline at end of file +} diff --git a/Core/Src/main.cpp b/Core/Src/main.cpp index 94e6b8ee..a740113f 100644 --- a/Core/Src/main.cpp +++ b/Core/Src/main.cpp @@ -1,18 +1,29 @@ -#include "Examples/ExampleMPU.cpp" -#include "Examples/ExamplesHardFault.cpp" - -#include "ST-LIB.hpp" -#include "main.h" - +#include "Examples/ExampleMPU.cpp" +#include "Examples/ExamplesHardFault.cpp" + +#include "ST-LIB.hpp" +#include "main.h" + using namespace ST_LIB; -constexpr auto led = - ST_LIB::DigitalOutputDomain::DigitalOutput(ST_LIB::PB0); +constexpr auto led = ST_LIB::DigitalOutputDomain::DigitalOutput(ST_LIB::PB0); #ifdef STLIB_ETH +#if defined(USE_PHY_LAN8742) +constexpr auto eth = + EthernetDomain::Ethernet(EthernetDomain::PINSET_H10, "00:80:e1:00:01:07", + "192.168.1.7", "255.255.0.0"); +#elif defined(USE_PHY_LAN8700) +constexpr auto eth = + EthernetDomain::Ethernet(EthernetDomain::PINSET_H10, "00:80:e1:00:01:07", + "192.168.1.7", "255.255.0.0"); +#elif defined(USE_PHY_KSZ8041) constexpr auto eth = EthernetDomain::Ethernet(EthernetDomain::PINSET_H11, "00:80:e1:00:01:07", "192.168.1.7", "255.255.0.0"); +#else +#error "No PHY selected for Ethernet pinset selection" +#endif using myBoard = ST_LIB::Board; #else @@ -28,16 +39,15 @@ int main(void) { #endif auto led_instance = &myBoard::instance_of(); + led_instance->turn_on(); while (1) { #ifdef STLIB_ETH eth_instance->update(); #endif - led_instance->toggle(); - HAL_Delay(100); } } -void Error_Handler(void) { - ErrorHandler("HAL error handler triggered"); - while (1) { - } -} +void Error_Handler(void) { + ErrorHandler("HAL error handler triggered"); + while (1) { + } +} diff --git a/deps/ST-LIB b/deps/ST-LIB index 49215110..d3c8915b 160000 --- a/deps/ST-LIB +++ b/deps/ST-LIB @@ -1 +1 @@ -Subproject commit 49215110d0b13cfe4645051dfc1b957276e1e175 +Subproject commit d3c8915bd98db95f4d23c32bf7b67d4d04f8025d From bcc10aa6c77869186b354d0b1516906ebdedd3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20S=C3=A1ez?= Date: Fri, 6 Feb 2026 18:48:37 +0100 Subject: [PATCH 3/6] fixed tims --- CMakeLists.txt | 70 ++++++++++++++++++++-------------------- Core/Src/Runes/Runes.cpp | 26 +++++++-------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0404ace1..46b91298 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,18 +3,18 @@ cmake_minimum_required(VERSION 3.14) project(template-project LANGUAGES ASM C CXX) set(EXECUTABLE ${PROJECT_NAME}.elf) -set(Board "VCU") # User must change the Board name +set(Board "PCU") # User must change the Board name set(STLIB_DIR ${CMAKE_CURRENT_LIST_DIR}/deps/ST-LIB) -set(LD_SCRIPT ${STLIB_DIR}/STM32H723ZGTX_FLASH.ld) +set(LD_SCRIPT ${STLIB_DIR}/STM32H723ZGTX_FLASH.ld) find_package(Python3 COMPONENTS Interpreter REQUIRED) set(GENERATOR_SCRIPT "${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Generator.py") -if(CMAKE_HOST_WIN32 ) -set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/Scripts/python) +if(CMAKE_HOST_WIN32) + set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/Scripts/python) else() -set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/bin/python) + set(VENV_PYTHON ${CMAKE_SOURCE_DIR}/virtual/bin/python) endif() option(USE_ETHERNET "Enable ethernet peripheral" OFF) @@ -39,14 +39,14 @@ if(USE_CCACHE) endif() endif() -if (PROJECT_IS_TOP_LEVEL AND (NOT CMAKE_CROSSCOMPILING)) +if(PROJECT_IS_TOP_LEVEL AND (NOT CMAKE_CROSSCOMPILING)) include(FetchContent) option(BUILD_GMOCK OFF) option(INSTALL_GTEST OFF) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG v1.15.2 + GIT_TAG v1.15.2 ) FetchContent_MakeAvailable(googletest) add_library(GTest::GTest INTERFACE IMPORTED) @@ -69,28 +69,28 @@ set(GENERATED_ORDER_PACKETS ${CMAKE_SOURCE_DIR}/Core/Inc/Communications/Packets/ set(GENERATED_STATE_MACHINE ${CMAKE_SOURCE_DIR}/Core/Inc/state_machine.hpp) add_custom_command( OUTPUT - ${GENERATED_DATA_PACKETS} - ${GENERATED_ORDER_PACKETS} - ${GENERATED_STATE_MACHINE} + ${GENERATED_DATA_PACKETS} + ${GENERATED_ORDER_PACKETS} + ${GENERATED_STATE_MACHINE} COMMAND ${VENV_PYTHON} ${GENERATOR_SCRIPT} ${Board} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} DEPENDS - ${GENERATOR_SCRIPT} - ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/Packet_generation.py - ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/DataTemplate.hpp - ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/OrderTemplate.hpp - ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/State_machine_generation/State_machine_generation.py - ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/State_machine_generation/State_machine_description.py - ${CMAKE_SOURCE_DIR}/state_machine.json - ${GENERATOR_JSONS} + ${GENERATOR_SCRIPT} + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/Packet_generation.py + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/DataTemplate.hpp + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/Packet_generation/OrderTemplate.hpp + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/State_machine_generation/State_machine_generation.py + ${CMAKE_SOURCE_DIR}/Core/Inc/Code_generation/State_machine_generation/State_machine_description.py + ${CMAKE_SOURCE_DIR}/state_machine.json + ${GENERATOR_JSONS} COMMENT "Generating packets and state machine" ) add_custom_target(run_generator ALL DEPENDS - ${GENERATED_DATA_PACKETS} - ${GENERATED_ORDER_PACKETS} - ${GENERATED_STATE_MACHINE} + ${GENERATED_DATA_PACKETS} + ${GENERATED_ORDER_PACKETS} + ${GENERATED_STATE_MACHINE} ) file(GLOB_RECURSE METADATA_SOURCES @@ -111,9 +111,9 @@ add_custom_command( COMMAND ${VENV_PYTHON} ${METADATA_SCRIPT} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} DEPENDS - ${METADATA_SCRIPT} - ${METADATA_TEMPLATE} - ${METADATA_SOURCES} + ${METADATA_SCRIPT} + ${METADATA_TEMPLATE} + ${METADATA_SOURCES} COMMENT "Generating binary metadata" ) @@ -122,10 +122,10 @@ add_custom_target(generate_binary_metadata ) if(CMAKE_CROSSCOMPILING) - file(GLOB_RECURSE SOURCE_C ${CMAKE_SOURCE_DIR}/Core/*.c) - file(GLOB_RECURSE SOURCE_CPP ${CMAKE_SOURCE_DIR}/Core/*.cpp) - file(GLOB_RECURSE SOURCE_H ${CMAKE_SOURCE_DIR}/Core/*.h) - file(GLOB_RECURSE SOURCE_HPP ${CMAKE_SOURCE_DIR}/Core/*.hpp) + file(GLOB_RECURSE SOURCE_C ${CMAKE_SOURCE_DIR}/Core/*.c) + file(GLOB_RECURSE SOURCE_CPP ${CMAKE_SOURCE_DIR}/Core/*.cpp) + file(GLOB_RECURSE SOURCE_H ${CMAKE_SOURCE_DIR}/Core/*.h) + file(GLOB_RECURSE SOURCE_HPP ${CMAKE_SOURCE_DIR}/Core/*.hpp) if(NOT BUILD_EXAMPLES) file(GLOB_RECURSE EXAMPLE_CPP ${CMAKE_SOURCE_DIR}/Core/Src/Examples/*.cpp) @@ -185,7 +185,7 @@ if(CMAKE_CROSSCOMPILING) ${CMAKE_CURRENT_SOURCE_DIR}/Core/Inc ) - target_link_options(${EXECUTABLE} PRIVATE + target_link_options(${EXECUTABLE} PRIVATE $<$:-T${LD_SCRIPT}> $<$:-mcpu=cortex-m7> $<$:-mthumb> @@ -210,11 +210,11 @@ if(CMAKE_CROSSCOMPILING) add_custom_command(TARGET ${EXECUTABLE} POST_BUILD # Create output directory COMMAND ${CMAKE_COMMAND} -E make_directory - ${CMAKE_SOURCE_DIR}/out/build + ${CMAKE_SOURCE_DIR}/out/build # Copy the built binary to out/build/latest.elf COMMAND ${CMAKE_COMMAND} -E copy - $ - ${CMAKE_SOURCE_DIR}/out/build/latest.elf + $ + ${CMAKE_SOURCE_DIR}/out/build/latest.elf COMMENT "Copying ${EXECUTABLE} to out/build/latest.elf" ) @@ -232,10 +232,10 @@ if(CMAKE_CROSSCOMPILING) endif() endif() -if (PROJECT_IS_TOP_LEVEL) +if(PROJECT_IS_TOP_LEVEL) execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_BINARY_DIR}/compile_commands.json - ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json + ${CMAKE_BINARY_DIR}/compile_commands.json + ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ) endif() diff --git a/Core/Src/Runes/Runes.cpp b/Core/Src/Runes/Runes.cpp index 16a735b0..d43f1d8d 100644 --- a/Core/Src/Runes/Runes.cpp +++ b/Core/Src/Runes/Runes.cpp @@ -17,19 +17,19 @@ ADC_HandleTypeDef hadc3; LPTIM_HandleTypeDef hlptim1; LPTIM_HandleTypeDef hlptim2; LPTIM_HandleTypeDef hlptim3; -TIM_HandleTypeDef htim1; -TIM_HandleTypeDef htim2; -TIM_HandleTypeDef htim3; -TIM_HandleTypeDef htim4; -TIM_HandleTypeDef htim5; -TIM_HandleTypeDef htim7; -TIM_HandleTypeDef htim8; -TIM_HandleTypeDef htim12; -TIM_HandleTypeDef htim16; -TIM_HandleTypeDef htim17; -TIM_HandleTypeDef htim15; -TIM_HandleTypeDef htim23; -TIM_HandleTypeDef htim24; +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim3; +extern TIM_HandleTypeDef htim4; +extern TIM_HandleTypeDef htim5; +extern TIM_HandleTypeDef htim7; +extern TIM_HandleTypeDef htim8; +extern TIM_HandleTypeDef htim12; +extern TIM_HandleTypeDef htim16; +extern TIM_HandleTypeDef htim17; +extern TIM_HandleTypeDef htim15; +extern TIM_HandleTypeDef htim23; +extern TIM_HandleTypeDef htim24; UART_HandleTypeDef huart1; UART_HandleTypeDef huart2; UART_HandleTypeDef huart3; From 1e065bb4a9f065e4a40e65bbf23b4c831f6b0b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20S=C3=A1ez?= Date: Fri, 6 Feb 2026 18:54:12 +0100 Subject: [PATCH 4/6] pointing to last st-lib --- deps/ST-LIB | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/ST-LIB b/deps/ST-LIB index d3c8915b..77224aa7 160000 --- a/deps/ST-LIB +++ b/deps/ST-LIB @@ -1 +1 @@ -Subproject commit d3c8915bd98db95f4d23c32bf7b67d4d04f8025d +Subproject commit 77224aa709b0b77e54f5a2cf2ce55bc6f0deb9af From 1a35c0186d6af83002e64f3b025f922dd244fafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20S=C3=A1ez?= Date: Fri, 6 Feb 2026 18:55:26 +0100 Subject: [PATCH 5/6] Fixed data packets generation --- CMakeLists.txt | 2 +- Core/Inc/Code_generation/JSON_ADE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46b91298..ee8dd6df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14) project(template-project LANGUAGES ASM C CXX) set(EXECUTABLE ${PROJECT_NAME}.elf) -set(Board "PCU") # User must change the Board name +set(Board "VCU") # User must change the Board name set(STLIB_DIR ${CMAKE_CURRENT_LIST_DIR}/deps/ST-LIB) set(LD_SCRIPT ${STLIB_DIR}/STM32H723ZGTX_FLASH.ld) diff --git a/Core/Inc/Code_generation/JSON_ADE b/Core/Inc/Code_generation/JSON_ADE index 76d1b303..ee857f81 160000 --- a/Core/Inc/Code_generation/JSON_ADE +++ b/Core/Inc/Code_generation/JSON_ADE @@ -1 +1 @@ -Subproject commit 76d1b30360d881a6af4ef9dbf307f418980c9594 +Subproject commit ee857f81e0aef674a19f8fc5db4a2d3c28a75a51 From c5c2a3e1ae738021e9da73d573944a58f46821d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20S=C3=A1ez?= Date: Fri, 6 Feb 2026 18:59:36 +0100 Subject: [PATCH 6/6] removed tests on template --- .github/workflows/tests.yml | 85 ------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index ed959ee8..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Run tests - -on: - workflow_dispatch: - pull_request: - paths: - - '**.cpp' - - '**.hpp' - - '**.c' - - '**.h' - - '**.py' - - 'CMakeLists.txt' - - 'CMakePresets.json' - - 'requirements.txt' - - 'tools/**' - - 'deps/ST-LIB/**' - branches: - - main - -concurrency: - group: tests-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - tests: - name: Simulator tests - runs-on: ubuntu-24.04 - timeout-minutes: 30 - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: false - fetch-depth: 1 - - - name: Init submodules - run: | - git config --global --add safe.directory '*' - git submodule update --init --depth 1 - ./deps/ST-LIB/tools/init-submodules.sh - shell: bash - - - name: Cache simulator deps - uses: actions/cache@v4 - with: - path: out/build/simulator/_deps - key: simulator-deps-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'deps/ST-LIB/Tests/CMakeLists.txt') }} - restore-keys: | - simulator-deps-${{ runner.os }}- - - - name: Setup Python environment - run: | - python3 -m venv virtual - source virtual/bin/activate - pip install --upgrade pip - pip install -r requirements.txt - shell: bash - - - name: Configure (CMake) - run: | - source virtual/bin/activate - cmake --preset simulator - shell: bash - - - name: Build - run: | - source virtual/bin/activate - cmake --build --preset simulator - shell: bash - - - name: Run tests (ctest) - run: | - ctest --test-dir out/build/simulator --no-tests=error --output-on-failure - shell: bash - - - name: Upload test reports - if: always() - uses: actions/upload-artifact@v4 - with: - name: simulator-test-reports - path: | - out/build/simulator/Testing/Temporary/LastTest.log - retention-days: 7 - if-no-files-found: ignore