From 1341a41c8c2f4529123fa0e8d8bc365b47454fd4 Mon Sep 17 00:00:00 2001 From: Edwin <20777515+Lucien950@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:12:36 -0800 Subject: [PATCH] More Build System Changes (#1408) ### Changelist - fully moves away from C++ - update docker cubemx for quintuna - cmakefile tweaks ### Testing Done ### Resolved Tickets --- .github/workflows/ci.yml | 59 ++- .../runConfigurations/Quadruna_CRIT_DEBUG.xml | 10 + .idea/runConfigurations/Quadruna_FSM.xml | 10 + .../runConfigurations/Quadruna_FSM_Debug.xml | 10 + .idea/runConfigurations/Quadruna_RSM.xml | 5 +- .../runConfigurations/Quadruna_RSM_Debug.xml | 5 +- .idea/runConfigurations/Quadruna_VC.xml | 5 +- .idea/runConfigurations/Quadruna_VC_Debug.xml | 5 +- .idea/runConfigurations/Quintuna_CRIT.xml | 5 +- .../runConfigurations/Quintuna_CRIT_DEBUG.xml | 5 +- .idea/runConfigurations/Quintuna_RSM.xml | 10 + .../runConfigurations/Quintuna_RSM_Debug.xml | 10 + .idea/runConfigurations/Quintuna_VC.xml | 10 + .idea/runConfigurations/Quintuna_VC_Debug.xml | 10 + .idea/runConfigurations/quadruna_BMS_hex.xml | 6 +- .idea/runConfigurations/quadruna_CRIT_hex.xml | 4 +- .idea/runConfigurations/quadruna_FSM_hex.xml | 4 +- .idea/runConfigurations/quadruna_RSM_hex.xml | 4 +- .idea/runConfigurations/quadruna_VC_hex.xml | 6 +- CMakeLists.txt | 4 +- environment/.gitignore | 1 + environment/Dockerfile | 14 +- environment/requirements.txt | 2 +- firmware/cmake/embedded.cmake | 27 +- firmware/cmake/shared.cmake | 15 +- firmware/cmake/stmlib.cmake | 28 +- firmware/quadruna/BMS/CMakeLists.txt | 4 +- firmware/quadruna/BMS/src/cubemx/Src/main.c | 1 + .../quadruna/BMS/src/cubemx/Src/syscalls.c | 23 -- firmware/quadruna/CRIT/CMakeLists.txt | 4 +- firmware/quadruna/FSM/CMakeLists.txt | 4 +- firmware/quadruna/RSM/CMakeLists.txt | 4 +- firmware/quadruna/VC/CMakeLists.txt | 15 +- firmware/quintuna/CRIT/CMakeLists.txt | 42 +- .../quintuna/CRIT/boot/cubemx/CRIT_boot.ioc | 6 +- .../CRIT/boot/cubemx/CRIT_boot.ioc.md5 | 2 +- .../CRIT/boot/cubemx/Inc/stm32f4xx_hal_conf.h | 2 +- firmware/quintuna/CRIT/boot/cubemx/Src/main.c | 1 + .../CRIT/boot/cubemx/Src/stm32f4xx_hal_msp.c | 2 +- .../cubemx/Src/stm32f4xx_hal_timebase_tim.c | 2 - .../quintuna/CRIT/src/app/app_critHeartbeat.h | 9 - firmware/quintuna/CRIT/src/app/app_critShdn.h | 9 - .../quintuna/CRIT/src/app/app_driveMode.cpp | 14 - .../quintuna/CRIT/src/app/app_driveMode.h | 6 - firmware/quintuna/CRIT/src/app/app_leds.cpp | 106 ----- firmware/quintuna/CRIT/src/app/app_leds.h | 6 - .../quintuna/CRIT/src/app/app_mainState.cpp | 32 -- .../quintuna/CRIT/src/app/app_mainState.h | 8 - .../CRIT/src/app/app_stackMonitorConfig.cpp | 22 -- .../CRIT/src/app/app_stackMonitorConfig.h | 7 - .../quintuna/CRIT/src/app/app_switches.cpp | 16 - firmware/quintuna/CRIT/src/app/app_switches.h | 6 - firmware/quintuna/CRIT/src/cubemx/CRIT.ioc | 6 +- .../quintuna/CRIT/src/cubemx/CRIT.ioc.md5 | 2 +- firmware/quintuna/CRIT/src/cubemx/Inc/main.h | 4 +- .../CRIT/src/cubemx/Inc/stm32f4xx_hal_conf.h | 2 +- firmware/quintuna/CRIT/src/cubemx/Src/main.c | 1 + .../CRIT/src/cubemx/Src/stm32f4xx_hal_msp.c | 2 +- .../cubemx/Src/stm32f4xx_hal_timebase_tim.c | 2 - firmware/quintuna/CRIT/src/hw/hw_adcs.cpp | 14 - firmware/quintuna/CRIT/src/hw/hw_adcs.h | 36 -- firmware/quintuna/CRIT/src/hw/hw_cans.cpp | 25 -- firmware/quintuna/CRIT/src/hw/hw_cans.h | 7 - firmware/quintuna/CRIT/src/hw/hw_gpios.cpp | 59 --- firmware/quintuna/CRIT/src/hw/hw_gpios.h | 62 --- ...wDescConfig.cpp => hw_sysviewDescConfig.c} | 2 +- firmware/quintuna/CRIT/src/hw/hw_uarts.h | 16 - firmware/quintuna/CRIT/src/hw/hw_watchdogs.h | 17 - .../quintuna/CRIT/src/io/io_canMsgQueues.h | 43 -- .../quintuna/CRIT/src/io/io_chimeraConfig.h | 65 ---- .../CRIT/src/io/io_critHeartbeatNodes.h | 18 - firmware/quintuna/CRIT/src/io/io_critShdn.h | 14 - .../quintuna/CRIT/src/io/io_driveMode.cpp | 13 - firmware/quintuna/CRIT/src/io/io_driveMode.h | 10 - firmware/quintuna/CRIT/src/io/io_leds.h | 23 -- .../CRIT/src/io/io_stackMonitorConfig.h | 8 - firmware/quintuna/CRIT/src/io/io_switches.h | 10 - .../quintuna/CRIT/src/{tasks.cpp => tasks.c} | 78 +--- firmware/quintuna/CRIT/src/tasks.h | 25 +- firmware/quintuna/RSM/CMakeLists.txt | 6 +- .../RSM/boot/cubemx/Inc/stm32f4xx_hal_conf.h | 2 +- .../quintuna/RSM/boot/cubemx/RSM_boot.ioc | 6 +- .../quintuna/RSM/boot/cubemx/RSM_boot.ioc.md5 | 2 +- firmware/quintuna/RSM/boot/cubemx/Src/main.c | 1 + .../RSM/boot/cubemx/Src/stm32f4xx_hal_msp.c | 2 +- .../cubemx/Src/stm32f4xx_hal_timebase_tim.c | 2 - firmware/quintuna/VC/CMakeLists.txt | 5 +- .../VC/boot/cubemx/Inc/FreeRTOSConfig.h | 181 +++++++++ firmware/quintuna/VC/boot/cubemx/Inc/main.h | 44 ++- .../VC/boot/cubemx/Inc/stm32h7xx_hal_conf.h | 14 +- .../VC/boot/cubemx/Inc/stm32h7xx_it.h | 6 +- .../quintuna/VC/boot/cubemx/Src/freertos.c | 58 +++ firmware/quintuna/VC/boot/cubemx/Src/main.c | 366 +++++++++++++++++- .../VC/boot/cubemx/Src/stm32h7xx_hal_msp.c | 128 +++++- .../cubemx/Src/stm32h7xx_hal_timebase_tim.c | 128 ++++++ .../VC/boot/cubemx/Src/stm32h7xx_it.c | 68 ++-- firmware/quintuna/VC/boot/cubemx/VC_boot.ioc | 322 +++++++++++---- .../quintuna/VC/boot/cubemx/VC_boot.ioc.md5 | 1 + .../VC/src/cubemx/Inc/FreeRTOSConfig.h | 1 + ...beatMonitor.h => app_heartbeatMonitor.hpp} | 5 +- .../app/{app_shdnLoop.h => app_shdnLoop.hpp} | 2 +- ...pp_stackMonitor.h => app_stackMonitor.hpp} | 2 +- .../shared/srcpp/app/app_stateMachine.cpp | 2 +- ...pp_stateMachine.h => app_stateMachine.hpp} | 0 firmware/shared/srcpp/app/app_timer.cpp | 4 +- .../srcpp/app/{app_timer.h => app_timer.hpp} | 0 .../srcpp/app/{app_utils.h => app_utils.hpp} | 0 .../shared/srcpp/hw/{hw_adc.h => hw_adc.hpp} | 2 +- firmware/shared/srcpp/hw/hw_assert.cpp | 6 +- firmware/shared/srcpp/hw/hw_bootup.cpp | 4 +- .../srcpp/hw/{hw_bootup.h => hw_bootup.hpp} | 0 firmware/shared/srcpp/hw/hw_can.cpp | 4 +- .../shared/srcpp/hw/{hw_can.h => hw_can.hpp} | 2 +- firmware/shared/srcpp/hw/hw_error.cpp | 6 +- .../srcpp/hw/{hw_error.h => hw_error.hpp} | 0 firmware/shared/srcpp/hw/hw_gpio.cpp | 2 +- .../srcpp/hw/{hw_gpio.h => hw_gpio.hpp} | 2 +- .../shared/srcpp/hw/{hw_hal.h => hw_hal.hpp} | 0 .../shared/srcpp/hw/hw_hardFaultHandler.cpp | 6 +- ...FaultHandler.h => hw_hardFaultHandler.hpp} | 0 firmware/shared/srcpp/hw/hw_uart.cpp | 2 +- .../srcpp/hw/{hw_uart.h => hw_uart.hpp} | 2 +- .../srcpp/hw/{hw_utils.h => hw_utils.hpp} | 2 +- firmware/shared/srcpp/hw/hw_watchdog.cpp | 4 +- .../hw/{hw_watchdog.h => hw_watchdog.hpp} | 0 firmware/shared/srcpp/io/io_canMsgQueue.cpp | 4 +- .../{io_canMsgQueue.h => io_canMsgQueue.hpp} | 2 +- firmware/shared/srcpp/io/io_chimera.cpp | 4 +- .../srcpp/io/{io_chimera.h => io_chimera.hpp} | 4 +- firmware/shared/srcpp/io/io_heartbeatNode.cpp | 2 +- ...o_heartbeatNode.h => io_heartbeatNode.hpp} | 2 +- firmware/shared/srcpp/io/io_jsoncan.cpp | 4 +- .../srcpp/io/{io_jsoncan.h => io_jsoncan.hpp} | 2 +- firmware/shared/srcpp/io/io_led.cpp | 2 +- .../shared/srcpp/io/{io_led.h => io_led.hpp} | 2 +- firmware/shared/srcpp/io/io_log.cpp | 2 +- .../shared/srcpp/io/{io_log.h => io_log.hpp} | 2 +- firmware/shared/srcpp/io/io_shdnLoopNode.cpp | 2 +- ...{io_shdnLoopNode.h => io_shdnLoopNode.hpp} | 2 +- firmware/shared/srcpp/io/io_stackMonitor.cpp | 2 +- ...{io_stackMonitor.h => io_stackMonitor.hpp} | 1 + firmware/shared/srcpp/io/io_switch.cpp | 2 +- .../srcpp/io/{io_switch.h => io_switch.hpp} | 2 +- firmware/shared/srcpp/io/io_time.cpp | 2 +- .../srcpp/io/{io_time.h => io_time.hpp} | 0 .../third_party/sysview/SEGGER_SYSVIEW_Conf.h | 2 +- .../commit_info_gen/commit_info.cmake | 1 + 147 files changed, 1494 insertions(+), 1147 deletions(-) create mode 100644 .idea/runConfigurations/Quadruna_CRIT_DEBUG.xml create mode 100644 .idea/runConfigurations/Quadruna_FSM.xml create mode 100644 .idea/runConfigurations/Quadruna_FSM_Debug.xml create mode 100644 .idea/runConfigurations/Quintuna_RSM.xml create mode 100644 .idea/runConfigurations/Quintuna_RSM_Debug.xml create mode 100644 .idea/runConfigurations/Quintuna_VC.xml create mode 100644 .idea/runConfigurations/Quintuna_VC_Debug.xml create mode 100644 environment/.gitignore delete mode 100644 firmware/quintuna/CRIT/src/app/app_critHeartbeat.h delete mode 100644 firmware/quintuna/CRIT/src/app/app_critShdn.h delete mode 100644 firmware/quintuna/CRIT/src/app/app_driveMode.cpp delete mode 100644 firmware/quintuna/CRIT/src/app/app_driveMode.h delete mode 100644 firmware/quintuna/CRIT/src/app/app_leds.cpp delete mode 100644 firmware/quintuna/CRIT/src/app/app_leds.h delete mode 100644 firmware/quintuna/CRIT/src/app/app_mainState.cpp delete mode 100644 firmware/quintuna/CRIT/src/app/app_mainState.h delete mode 100644 firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.cpp delete mode 100644 firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.h delete mode 100644 firmware/quintuna/CRIT/src/app/app_switches.cpp delete mode 100644 firmware/quintuna/CRIT/src/app/app_switches.h delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_adcs.cpp delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_adcs.h delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_cans.cpp delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_cans.h delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_gpios.cpp delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_gpios.h rename firmware/quintuna/CRIT/src/hw/{hw_sysviewDescConfig.cpp => hw_sysviewDescConfig.c} (72%) delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_uarts.h delete mode 100644 firmware/quintuna/CRIT/src/hw/hw_watchdogs.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_canMsgQueues.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_chimeraConfig.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_critHeartbeatNodes.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_critShdn.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_driveMode.cpp delete mode 100644 firmware/quintuna/CRIT/src/io/io_driveMode.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_leds.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_stackMonitorConfig.h delete mode 100644 firmware/quintuna/CRIT/src/io/io_switches.h rename firmware/quintuna/CRIT/src/{tasks.cpp => tasks.c} (52%) create mode 100644 firmware/quintuna/VC/boot/cubemx/Inc/FreeRTOSConfig.h create mode 100644 firmware/quintuna/VC/boot/cubemx/Src/freertos.c create mode 100644 firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_timebase_tim.c create mode 100644 firmware/quintuna/VC/boot/cubemx/VC_boot.ioc.md5 rename firmware/shared/srcpp/app/{app_heartbeatMonitor.h => app_heartbeatMonitor.hpp} (97%) rename firmware/shared/srcpp/app/{app_shdnLoop.h => app_shdnLoop.hpp} (94%) rename firmware/shared/srcpp/app/{app_stackMonitor.h => app_stackMonitor.hpp} (97%) rename firmware/shared/srcpp/app/{app_stateMachine.h => app_stateMachine.hpp} (100%) rename firmware/shared/srcpp/app/{app_timer.h => app_timer.hpp} (100%) rename firmware/shared/srcpp/app/{app_utils.h => app_utils.hpp} (100%) rename firmware/shared/srcpp/hw/{hw_adc.h => hw_adc.hpp} (99%) rename firmware/shared/srcpp/hw/{hw_bootup.h => hw_bootup.hpp} (100%) rename firmware/shared/srcpp/hw/{hw_can.h => hw_can.hpp} (98%) rename firmware/shared/srcpp/hw/{hw_error.h => hw_error.hpp} (100%) rename firmware/shared/srcpp/hw/{hw_gpio.h => hw_gpio.hpp} (95%) rename firmware/shared/srcpp/hw/{hw_hal.h => hw_hal.hpp} (100%) rename firmware/shared/srcpp/hw/{hw_hardFaultHandler.h => hw_hardFaultHandler.hpp} (100%) rename firmware/shared/srcpp/hw/{hw_uart.h => hw_uart.hpp} (99%) rename firmware/shared/srcpp/hw/{hw_utils.h => hw_utils.hpp} (94%) rename firmware/shared/srcpp/hw/{hw_watchdog.h => hw_watchdog.hpp} (100%) rename firmware/shared/srcpp/io/{io_canMsgQueue.h => io_canMsgQueue.hpp} (99%) rename firmware/shared/srcpp/io/{io_chimera.h => io_chimera.hpp} (86%) rename firmware/shared/srcpp/io/{io_heartbeatNode.h => io_heartbeatNode.hpp} (98%) rename firmware/shared/srcpp/io/{io_jsoncan.h => io_jsoncan.hpp} (96%) rename firmware/shared/srcpp/io/{io_led.h => io_led.hpp} (96%) rename firmware/shared/srcpp/io/{io_log.h => io_log.hpp} (98%) rename firmware/shared/srcpp/io/{io_shdnLoopNode.h => io_shdnLoopNode.hpp} (94%) rename firmware/shared/srcpp/io/{io_stackMonitor.h => io_stackMonitor.hpp} (96%) rename firmware/shared/srcpp/io/{io_switch.h => io_switch.hpp} (90%) rename firmware/shared/srcpp/io/{io_time.h => io_time.hpp} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e494fd1fe2..e3573ef0f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,21 +38,43 @@ jobs: include: - board: VC ioc_dir: firmware/quadruna/VC/src/cubemx + env_version: latest - board: BMS ioc_dir: firmware/quadruna/BMS/src/cubemx + env_version: latest - board: FSM ioc_dir: firmware/quadruna/FSM/src/cubemx + env_version: latest - board: RSM ioc_dir: firmware/quadruna/RSM/src/cubemx + env_version: latest - board: CRIT ioc_dir: firmware/quadruna/CRIT/src/cubemx + env_version: latest - board: f4dev ioc_dir: firmware/dev/f4dev/src/cubemx + env_version: latest - board: h7dev ioc_dir: firmware/dev/h7dev/src/cubemx + env_version: latest + # - board: BMS_Quint + # ioc_dir: firmware/quintuna/BMS/src/cubemx + # env_version: cube_6_12_0 + - board: CRIT + ioc_dir: firmware/quintuna/CRIT/src/cubemx + env_version: cube_6_12_0 + # - board: FSM_Quint + # ioc_dir: firmware/quintuna/FSM/src/cubemx + # env_version: cube_6_12_0 + - board: RSM + ioc_dir: firmware/quintuna/RSM/src/cubemx + env_version: cube_6_12_0 + - board: VC + ioc_dir: firmware/quintuna/VC/src/cubemx + env_version: cube_6_12_0 container: - image: ubcformulaelectric/environment:latest + image: ubcformulaelectric/environment:${{ matrix.env_version }} credentials: username: ubcformulaelectric password: ${{ secrets.DOCKER_TOKEN }} @@ -89,17 +111,34 @@ jobs: strategy: fail-fast: false matrix: - board: - - quadruna_VC - - quadruna_BMS - - quadruna_FSM - - quadruna_RSM - - quadruna_CRIT - - f4dev - - h7dev + include: + - board: quadruna_VC + env_version: latest + - board: quadruna_BMS + env_version: latest + - board: quadruna_FSM + env_version: latest + - board: quadruna_RSM + env_version: latest + - board: quadruna_CRIT + env_version: latest + - board: f4dev + env_version: latest + - board: h7dev + env_version: latest + # - board: quintuna_BMS + # env_version: cube_6_12_0 + - board: quintuna_CRIT + env_version: cube_6_12_0 + # - board: quintuna_FSM + # env_version: cube_6_12_0 + - board: quintuna_RSM + env_version: cube_6_12_0 + - board: quintuna_VC + env_version: cube_6_12_0 container: - image: ubcformulaelectric/environment:latest + image: ubcformulaelectric/environment:${{ matrix.env_version }} credentials: username: ubcformulaelectric password: ${{ secrets.docker_token }} diff --git a/.idea/runConfigurations/Quadruna_CRIT_DEBUG.xml b/.idea/runConfigurations/Quadruna_CRIT_DEBUG.xml new file mode 100644 index 0000000000..033fdab87e --- /dev/null +++ b/.idea/runConfigurations/Quadruna_CRIT_DEBUG.xml @@ -0,0 +1,10 @@ + + + + C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Quadruna_FSM.xml b/.idea/runConfigurations/Quadruna_FSM.xml new file mode 100644 index 0000000000..a6fb98c13b --- /dev/null +++ b/.idea/runConfigurations/Quadruna_FSM.xml @@ -0,0 +1,10 @@ + + + + C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Quadruna_FSM_Debug.xml b/.idea/runConfigurations/Quadruna_FSM_Debug.xml new file mode 100644 index 0000000000..a516f9747a --- /dev/null +++ b/.idea/runConfigurations/Quadruna_FSM_Debug.xml @@ -0,0 +1,10 @@ + + + + C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Quadruna_RSM.xml b/.idea/runConfigurations/Quadruna_RSM.xml index f8f918acd2..64e33b27fc 100644 --- a/.idea/runConfigurations/Quadruna_RSM.xml +++ b/.idea/runConfigurations/Quadruna_RSM.xml @@ -1,8 +1,7 @@ - - + + C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe -