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
-
diff --git a/.idea/runConfigurations/Quadruna_RSM_Debug.xml b/.idea/runConfigurations/Quadruna_RSM_Debug.xml
index a2d801b9a9..e37bbd6631 100644
--- a/.idea/runConfigurations/Quadruna_RSM_Debug.xml
+++ b/.idea/runConfigurations/Quadruna_RSM_Debug.xml
@@ -1,8 +1,7 @@
-
-
+
+
C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
-
diff --git a/.idea/runConfigurations/Quadruna_VC.xml b/.idea/runConfigurations/Quadruna_VC.xml
index 25e736a2bf..ece571f2e8 100644
--- a/.idea/runConfigurations/Quadruna_VC.xml
+++ b/.idea/runConfigurations/Quadruna_VC.xml
@@ -1,8 +1,7 @@
-
-
+
+
C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
-
diff --git a/.idea/runConfigurations/Quadruna_VC_Debug.xml b/.idea/runConfigurations/Quadruna_VC_Debug.xml
index cf73991c3d..aeea6131b5 100644
--- a/.idea/runConfigurations/Quadruna_VC_Debug.xml
+++ b/.idea/runConfigurations/Quadruna_VC_Debug.xml
@@ -1,8 +1,7 @@
-
-
+
+
C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
-
diff --git a/.idea/runConfigurations/Quintuna_CRIT.xml b/.idea/runConfigurations/Quintuna_CRIT.xml
index 6eaddc6a21..998e7406f3 100644
--- a/.idea/runConfigurations/Quintuna_CRIT.xml
+++ b/.idea/runConfigurations/Quintuna_CRIT.xml
@@ -1,8 +1,7 @@
-
-
+
+
C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
-
diff --git a/.idea/runConfigurations/Quintuna_CRIT_DEBUG.xml b/.idea/runConfigurations/Quintuna_CRIT_DEBUG.xml
index 8945f08bd1..c39be11e96 100644
--- a/.idea/runConfigurations/Quintuna_CRIT_DEBUG.xml
+++ b/.idea/runConfigurations/Quintuna_CRIT_DEBUG.xml
@@ -1,8 +1,7 @@
-
-
+
+
C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
-
diff --git a/.idea/runConfigurations/Quintuna_RSM.xml b/.idea/runConfigurations/Quintuna_RSM.xml
new file mode 100644
index 0000000000..693fab8173
--- /dev/null
+++ b/.idea/runConfigurations/Quintuna_RSM.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/Quintuna_RSM_Debug.xml b/.idea/runConfigurations/Quintuna_RSM_Debug.xml
new file mode 100644
index 0000000000..16e3330687
--- /dev/null
+++ b/.idea/runConfigurations/Quintuna_RSM_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/Quintuna_VC.xml b/.idea/runConfigurations/Quintuna_VC.xml
new file mode 100644
index 0000000000..4ed3f6c809
--- /dev/null
+++ b/.idea/runConfigurations/Quintuna_VC.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/Quintuna_VC_Debug.xml b/.idea/runConfigurations/Quintuna_VC_Debug.xml
new file mode 100644
index 0000000000..2fcecf9c01
--- /dev/null
+++ b/.idea/runConfigurations/Quintuna_VC_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_BMS_hex.xml b/.idea/runConfigurations/quadruna_BMS_hex.xml
index 9fef144e55..f00ec3d10e 100644
--- a/.idea/runConfigurations/quadruna_BMS_hex.xml
+++ b/.idea/runConfigurations/quadruna_BMS_hex.xml
@@ -1,7 +1,7 @@
-
-
- C:\Users\jessi\Documents\School\fsae\Consolidated-Firmware\build_fw_deploy\_deps\gcc-arm-none-eabi-9-src\bin\arm-none-eabi-gdb.exe
+
+
+ C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
diff --git a/.idea/runConfigurations/quadruna_CRIT_hex.xml b/.idea/runConfigurations/quadruna_CRIT_hex.xml
index db99d5d595..68f1f68a01 100644
--- a/.idea/runConfigurations/quadruna_CRIT_hex.xml
+++ b/.idea/runConfigurations/quadruna_CRIT_hex.xml
@@ -1,7 +1,7 @@
-
+
- C:\Users\jessi\Documents\School\fsae\Consolidated-Firmware\build_fw_deploy\_deps\gcc-arm-none-eabi-9-src\bin\arm-none-eabi-gdb.exe
+ C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
diff --git a/.idea/runConfigurations/quadruna_FSM_hex.xml b/.idea/runConfigurations/quadruna_FSM_hex.xml
index 7501af3d5b..86ed3e696c 100644
--- a/.idea/runConfigurations/quadruna_FSM_hex.xml
+++ b/.idea/runConfigurations/quadruna_FSM_hex.xml
@@ -1,7 +1,7 @@
-
+
- C:\Users\jessi\Documents\School\fsae\Consolidated-Firmware\build_fw_deploy\_deps\gcc-arm-none-eabi-9-src\bin\arm-none-eabi-gdb.exe
+ C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
diff --git a/.idea/runConfigurations/quadruna_RSM_hex.xml b/.idea/runConfigurations/quadruna_RSM_hex.xml
index 722b394268..2f628891db 100644
--- a/.idea/runConfigurations/quadruna_RSM_hex.xml
+++ b/.idea/runConfigurations/quadruna_RSM_hex.xml
@@ -1,7 +1,7 @@
-
+
- C:\Users\jessi\Documents\School\fsae\Consolidated-Firmware\build_fw_deploy\_deps\gcc-arm-none-eabi-9-src\bin\arm-none-eabi-gdb.exe
+ C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe
diff --git a/.idea/runConfigurations/quadruna_VC_hex.xml b/.idea/runConfigurations/quadruna_VC_hex.xml
index 984919c849..7814331f75 100644
--- a/.idea/runConfigurations/quadruna_VC_hex.xml
+++ b/.idea/runConfigurations/quadruna_VC_hex.xml
@@ -1,7 +1,7 @@
-
-
- $PROJECT_DIR$/build_fw_deploy/_deps/gcc-arm-none-eabi-9-src/bin/arm-none-eabi-gdb.exe
+
+
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f2452d232..8c7c8bb7df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,8 +68,8 @@ IF (FIX_FORMATTING)
ENDIF ()
# ======== Code Time ========
-option(PLATFORM "The platform to build for, either \"firmware\" or \"dimos\"" "firmware")
-option(TARGET "The target to build for. Choose between \"binary\" and \"test\"." "binary")
+set(PLATFORM "firmware" CACHE STRING "The platform to build for, either \"firmware\" or \"dimos\"")
+set(TARGET "binary" CACHE STRING "The target to build for. Choose between \"binary\" and \"test\".")
message("")
message("⚙️ Configuring for \"${PLATFORM}\" platform and \"${TARGET}\" build target")
IF ("${PLATFORM}" STREQUAL "firmware")
diff --git a/environment/.gitignore b/environment/.gitignore
new file mode 100644
index 0000000000..6320cd248d
--- /dev/null
+++ b/environment/.gitignore
@@ -0,0 +1 @@
+data
\ No newline at end of file
diff --git a/environment/Dockerfile b/environment/Dockerfile
index 96968468e9..a8a06d18d7 100644
--- a/environment/Dockerfile
+++ b/environment/Dockerfile
@@ -29,17 +29,19 @@ RUN apt update -y && apt install -y \
libxrender1 \
protobuf-compiler
-COPY . /root/environment/
-
# Install python package dependencies.
-WORKDIR /root/environment/scripts
-RUN pip3 install -r ../requirements.txt
+WORKDIR /root/environment
+COPY requirements.txt /root/environment/
+RUN pip3 install -r requirements.txt
# Install GNU ARM Embedded Toolchain, for compiling/debugging on embedded.
-RUN /bin/sh install_gcc_arm_none_eabi.sh /usr/local
+COPY scripts/install_gcc_arm_none_eabi.sh /root/environment/
+RUN /bin/sh ./install_gcc_arm_none_eabi.sh /usr/local
# Install STM32CubeMX for auto-generating code.
-RUN python3 install_stm32cubemx.py --install-dir /usr/local/STM32CubeMX --cube-zip ../data/en.stm32cubemx-lin-v6-9-2.zip
+COPY scripts/install_stm32cubemx.py /root/environment/
+COPY data/en.stm32cubemx-lin-v6-12-0.zip /root/environment
+RUN python3 install_stm32cubemx.py --install-dir /usr/local/STM32CubeMX --cube-zip en.stm32cubemx-lin-v6-12-0.zip
# Cleanup copied directory.
WORKDIR /root/
diff --git a/environment/requirements.txt b/environment/requirements.txt
index 9d5a46844a..6934bab9d3 100644
--- a/environment/requirements.txt
+++ b/environment/requirements.txt
@@ -8,7 +8,7 @@ pyclibrary
jinja2
gitpython
intelhex
-protobuf
+protobuf==4.25.5
grpcio-tools
pyserial
protoletariat
diff --git a/firmware/cmake/embedded.cmake b/firmware/cmake/embedded.cmake
index 01a4aa5784..b1126398e6 100644
--- a/firmware/cmake/embedded.cmake
+++ b/firmware/cmake/embedded.cmake
@@ -36,9 +36,6 @@ set(SHARED_COMPILER_FLAGS
-fdata-sections
-fno-common
-fmessage-length=0
- -Wl,--gc-sections
- --specs=nosys.specs
- --specs=nano.specs
-Wall
-Werror
-Wextra
@@ -145,6 +142,30 @@ function(embedded_library
)
endfunction()
+function(embedded_interface_library
+ LIB_NAME
+ LIB_SRCS
+ LIB_INCLUDE_DIRS
+ THIRD_PARTY
+)
+ add_library(${LIB_NAME} INTERFACE)
+ target_sources(${LIB_NAME} INTERFACE ${LIB_SRCS})
+
+ IF (${THIRD_PARTY})
+ # Suppress header file warnings for third-party code by marking them as system includes.
+ target_include_directories(${LIB_NAME} SYSTEM
+ INTERFACE
+ ${LIB_INCLUDE_DIRS}
+ )
+ set_source_files_properties(
+ ${LIB_SRCS}
+ PROPERTIES COMPILE_FLAGS "-w"
+ )
+ ELSE ()
+ target_include_directories(${LIB_NAME} INTERFACE ${LIB_INCLUDE_DIRS})
+ ENDIF ()
+endfunction()
+
message(" 🔃 Registered embedded_binary() function")
# Generate an embedded binary target, a hex file, and an optional assembly file.
function(embedded_binary
diff --git a/firmware/cmake/shared.cmake b/firmware/cmake/shared.cmake
index 492ee2a450..2d0daf0d1f 100644
--- a/firmware/cmake/shared.cmake
+++ b/firmware/cmake/shared.cmake
@@ -29,42 +29,39 @@ function(commit_info_library
BIND_TARGET
LIB_NAME
OUTPUT_PATH
- ARM_CORE
)
commit_info_generate_sources(${BIND_TARGET} ${OUTPUT_PATH})
IF("${TARGET}" STREQUAL "binary")
- embedded_library(
+ embedded_interface_library(
"${LIB_NAME}"
"${COMMIT_INFO_SRC}"
"${COMMIT_INFO_INCLUDE_DIR}"
- "${ARM_CORE}"
FALSE
)
- target_include_directories("${LIB_NAME}" PUBLIC "${COMMIT_INFO_INCLUDE_DIR}")
ELSEIF("${TARGET}" STREQUAL "test")
get_filename_component(HEADER_DIR "${HEADER_OUTPUT_PATH}" DIRECTORY)
+ # TODO make this an interface library as well
add_library(
- "${LIB_NAME}" STATIC
+ "${LIB_NAME}" INTERFACE
"${COMMIT_INFO_SRC}"
)
- target_include_directories("${LIB_NAME}" PUBLIC "${HEADER_DIR}")
+ target_include_directories("${LIB_NAME}" INTERFACE "${HEADER_DIR}")
ENDIF()
endfunction()
# Generates library ${CAR}_${BOARD}_jsoncan
message(" 🔃 Registered jsoncan_library() function")
-function(jsoncan_embedded_library BOARD CAR JSONCAN_DIR ARM_CORE)
+function(jsoncan_embedded_library BOARD CAR JSONCAN_DIR)
jsoncan_sources(
${BOARD}
${JSONCAN_DIR}
TRUE
${CAR}
)
- embedded_library(
+ embedded_interface_library(
"${CAR}_${BOARD}_jsoncan"
"${CAN_SRCS}"
"${CAN_INCLUDE_DIRS}"
- "${ARM_CORE}"
TRUE
)
endfunction()
diff --git a/firmware/cmake/stmlib.cmake b/firmware/cmake/stmlib.cmake
index 918df8d01c..b0a95c1f34 100644
--- a/firmware/cmake/stmlib.cmake
+++ b/firmware/cmake/stmlib.cmake
@@ -116,28 +116,27 @@ function(stm32f412rx_cube_library
if(USB_ENABLED)
set(USB_MIDDLEWARE_DIR "${STM32CUBEF4_SOURCE_DIR}/Middlewares/ST/STM32_USB_Device_Library")
- list(APPEND STM32CUBE_SRCS
+ list(APPEND STM32CUBE_SRCS
"${USB_MIDDLEWARE_DIR}/Class/CDC/Src/usbd_cdc.c"
"${USB_MIDDLEWARE_DIR}/Core/Src/usbd_core.c"
"${USB_MIDDLEWARE_DIR}/Core/Src/usbd_ctlreq.c"
"${USB_MIDDLEWARE_DIR}/Core/Src/usbd_ioreq.c"
)
- list(APPEND STM32CUBE_INCLUDE_DIRS
- "${USB_MIDDLEWARE_DIR}/Core/Inc"
+ list(APPEND STM32CUBE_INCLUDE_DIRS
+ "${USB_MIDDLEWARE_DIR}/Core/Inc"
"${USB_MIDDLEWARE_DIR}/Class/CDC/Inc"
)
endif()
- embedded_library(
+ embedded_interface_library(
"${HAL_LIB_NAME}"
"${STM32CUBE_SRCS}"
"${STM32CUBE_INCLUDE_DIRS}"
- "cm4"
TRUE
)
target_compile_definitions(${HAL_LIB_NAME}
- PUBLIC
+ INTERFACE
USE_HAL_DRIVER
STM32F412Rx
)
@@ -183,7 +182,6 @@ function(stm32h733xx_cube_library
file(GLOB RTOS_SRCS
"${FREERTOS_DIR}/*.c"
"${FREERTOS_DIR}/CMSIS_RTOS_V2/cmsis_os2.c"
- "${FREERTOS_DIR}/portable/MemMang/heap_4.c"
"${FREERTOS_DIR}/portable/GCC/ARM_CM4F/port.c"
)
@@ -203,38 +201,36 @@ function(stm32h733xx_cube_library
# Startup assembly script.
set(STARTUP_SRC "${DRIVERS_DIR}/CMSIS/Device/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h733xx.s")
- set(STM32CUBE_SRCS ${STM32_HAL_SRCS} ${RTOS_SRCS} ${SYSTEMVIEW_SRCS} ${SYSCALLS} ${IOC_CHECKSUM} ${STARTUP_SRC})
+ set(STM32CUBE_SRCS ${STM32_HAL_SRCS} ${RTOS_SRCS} ${SYSTEMVIEW_SRCS} ${SYSCALLS} ${IOC_CHECKSUM} ${STARTUP_SRC} ${NEWLIB_SRCS})
# Handle usb srcs and include directories.
# Currently, all our USB devices are of the Communications Device Class (CDC).
- # If we want to ever support different device classes,
+ # If we want to ever support different device classes,
# you will need to add a argument to this function with the requested class.
if(USB_ENABLED)
set(USB_MIDDLEWARE_DIR "${STM32CUBEH7_SOURCE_DIR}/Middlewares/ST/STM32_USB_Device_Library")
- list(APPEND STM32CUBE_SRCS
+ list(APPEND STM32CUBE_SRCS
"${USB_MIDDLEWARE_DIR}/Class/CDC/Src/usbd_cdc.c"
"${USB_MIDDLEWARE_DIR}/Core/Src/usbd_core.c"
"${USB_MIDDLEWARE_DIR}/Core/Src/usbd_ctlreq.c"
"${USB_MIDDLEWARE_DIR}/Core/Src/usbd_ioreq.c"
)
- list(APPEND STM32CUBE_INCLUDE_DIRS
- "${USB_MIDDLEWARE_DIR}/Core/Inc"
+ list(APPEND STM32CUBE_INCLUDE_DIRS
+ "${USB_MIDDLEWARE_DIR}/Core/Inc"
"${USB_MIDDLEWARE_DIR}/Class/CDC/Inc"
)
endif()
-
- embedded_library(
+ embedded_interface_library(
"${HAL_LIB_NAME}"
"${STM32CUBE_SRCS}"
"${STM32CUBE_INCLUDE_DIRS}"
- "cm7"
TRUE
)
target_compile_definitions(${HAL_LIB_NAME}
- PUBLIC
+ INTERFACE
USE_HAL_DRIVER
STM32H733xx
CANFD
diff --git a/firmware/quadruna/BMS/CMakeLists.txt b/firmware/quadruna/BMS/CMakeLists.txt
index d0a7e69b0c..5544c20736 100644
--- a/firmware/quadruna/BMS/CMakeLists.txt
+++ b/firmware/quadruna/BMS/CMakeLists.txt
@@ -118,17 +118,15 @@ IF ("${TARGET}" STREQUAL "binary")
)
# JSONCAN
- jsoncan_embedded_library(BMS quadruna "${CMAKE_CURRENT_BINARY_DIR}" ${ARM_CORE})
+ jsoncan_embedded_library(BMS quadruna ${CMAKE_CURRENT_BINARY_DIR})
# Autogenerate git commit info header/source.
commit_info_library(
"quadruna_BMS_app.elf"
"quadruna_BMS_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quadruna_BMS_jsoncan" PRIVATE "quadruna_BMS_stm32cube")
target_link_libraries("quadruna_BMS_app.elf" PRIVATE "quadruna_BMS_stm32cube" "quadruna_BMS_jsoncan" "quadruna_BMS_commit_info" "debug_modules")
target_link_libraries("quadruna_BMS_boot.elf" PRIVATE "quadruna_BMS_commit_info")
diff --git a/firmware/quadruna/BMS/src/cubemx/Src/main.c b/firmware/quadruna/BMS/src/cubemx/Src/main.c
index f13d7f358c..2fd1c6ccd0 100644
--- a/firmware/quadruna/BMS/src/cubemx/Src/main.c
+++ b/firmware/quadruna/BMS/src/cubemx/Src/main.c
@@ -24,6 +24,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include
+#include
#include "tasks.h"
#include "hw_gpio.h"
#include "hw_error.h"
diff --git a/firmware/quadruna/BMS/src/cubemx/Src/syscalls.c b/firmware/quadruna/BMS/src/cubemx/Src/syscalls.c
index 7bda981ce3..93e51b8c66 100644
--- a/firmware/quadruna/BMS/src/cubemx/Src/syscalls.c
+++ b/firmware/quadruna/BMS/src/cubemx/Src/syscalls.c
@@ -109,29 +109,6 @@ __attribute__((weak)) int _write(int file, char *ptr, int len)
return len;
}
-caddr_t _sbrk(int incr)
-{
- extern char end asm("end");
- static char *heap_end;
- char *prev_heap_end;
-
- if (heap_end == 0)
- heap_end = &end;
-
- prev_heap_end = heap_end;
- if (heap_end + incr > stack_ptr)
- {
- // write(1, "Heap and stack collision\n", 25);
- // abort();
- errno = ENOMEM;
- return (caddr_t)-1;
- }
-
- heap_end += incr;
-
- return (caddr_t)prev_heap_end;
-}
-
int _close(int file)
{
return -1;
diff --git a/firmware/quadruna/CRIT/CMakeLists.txt b/firmware/quadruna/CRIT/CMakeLists.txt
index 94bba71779..4d16242af9 100644
--- a/firmware/quadruna/CRIT/CMakeLists.txt
+++ b/firmware/quadruna/CRIT/CMakeLists.txt
@@ -110,17 +110,15 @@ IF ("${TARGET}" STREQUAL "binary")
)
# JSONCAN
- jsoncan_embedded_library(CRIT quadruna "${CMAKE_CURRENT_BINARY_DIR}" ${ARM_CORE})
+ jsoncan_embedded_library(CRIT quadruna "${CMAKE_CURRENT_BINARY_DIR}")
# CommitInfo
commit_info_library(
"quadruna_CRIT_app.elf"
"quadruna_CRIT_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quadruna_CRIT_jsoncan" PRIVATE "quadruna_CRIT_stm32cube")
target_link_libraries("quadruna_CRIT_app.elf" PRIVATE "quadruna_CRIT_stm32cube" "quadruna_CRIT_jsoncan" "quadruna_CRIT_commit_info" "debug_modules")
target_link_libraries("quadruna_CRIT_boot.elf" PRIVATE "quadruna_CRIT_commit_info")
diff --git a/firmware/quadruna/FSM/CMakeLists.txt b/firmware/quadruna/FSM/CMakeLists.txt
index 5ecda28f65..9659186847 100644
--- a/firmware/quadruna/FSM/CMakeLists.txt
+++ b/firmware/quadruna/FSM/CMakeLists.txt
@@ -112,17 +112,15 @@ IF ("${TARGET}" STREQUAL "binary")
)
# JSONCAN
- jsoncan_embedded_library(FSM quadruna "${CMAKE_CURRENT_BINARY_DIR}" "${ARM_CORE}")
+ jsoncan_embedded_library(FSM quadruna ${CMAKE_CURRENT_BINARY_DIR})
# CommitInfo
commit_info_library(
"quadruna_FSM_app.elf"
"quadruna_FSM_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quadruna_FSM_jsoncan" PRIVATE "quadruna_FSM_stm32cube")
target_link_libraries("quadruna_FSM_app.elf" PRIVATE "quadruna_FSM_stm32cube" "quadruna_FSM_jsoncan" "quadruna_FSM_commit_info" "debug_modules" "m")
target_link_libraries("quadruna_FSM_boot.elf" PRIVATE "quadruna_FSM_commit_info")
diff --git a/firmware/quadruna/RSM/CMakeLists.txt b/firmware/quadruna/RSM/CMakeLists.txt
index 9804e6e9e6..124d8ef208 100644
--- a/firmware/quadruna/RSM/CMakeLists.txt
+++ b/firmware/quadruna/RSM/CMakeLists.txt
@@ -110,17 +110,15 @@ IF ("${TARGET}" STREQUAL "binary")
)
# JSONCAN
- jsoncan_embedded_library(RSM quadruna "${CMAKE_CURRENT_BINARY_DIR}" ${ARM_CORE})
+ jsoncan_embedded_library(RSM quadruna ${CMAKE_CURRENT_BINARY_DIR})
# CommitInfo
commit_info_library(
"quadruna_RSM_app.elf"
"quadruna_RSM_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quadruna_RSM_jsoncan" PRIVATE "quadruna_RSM_stm32cube")
target_link_libraries("quadruna_RSM_app.elf" PRIVATE "quadruna_RSM_stm32cube" "quadruna_RSM_jsoncan" "quadruna_RSM_commit_info" "debug_modules" "m")
target_link_libraries("quadruna_RSM_boot.elf" PRIVATE "quadruna_RSM_commit_info")
diff --git a/firmware/quadruna/VC/CMakeLists.txt b/firmware/quadruna/VC/CMakeLists.txt
index 2d953eb7d5..26fcce614b 100644
--- a/firmware/quadruna/VC/CMakeLists.txt
+++ b/firmware/quadruna/VC/CMakeLists.txt
@@ -129,18 +129,25 @@ IF ("${TARGET}" STREQUAL "binary")
)
# JSONCAN
- jsoncan_embedded_library(VC quadruna "${CMAKE_CURRENT_BINARY_DIR}" ${ARM_CORE})
+ jsoncan_embedded_library(VC quadruna ${CMAKE_CURRENT_BINARY_DIR})
# CommitInfo
commit_info_library(
"quadruna_VC_app.elf"
"quadruna_VC_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quadruna_VC_jsoncan" PRIVATE "quadruna_VC_stm32cube")
- target_link_libraries("quadruna_VC_app.elf" PRIVATE "quadruna_VC_stm32cube" "quadruna_VC_jsoncan" "quadruna_VC_commit_info" "logfs_cm7" "debug_modules" "m" "telem_proto" "sbg_ecom_cm7")
+ target_link_libraries("quadruna_VC_app.elf" PRIVATE
+ "quadruna_VC_stm32cube"
+ "quadruna_VC_jsoncan"
+ "quadruna_VC_commit_info"
+ "logfs_cm7"
+ "debug_modules"
+ "m"
+ "telem_proto"
+ "sbg_ecom_cm7"
+ )
target_link_libraries("quadruna_VC_boot.elf" PRIVATE "quadruna_VC_commit_info")
embedded_image(
diff --git a/firmware/quintuna/CRIT/CMakeLists.txt b/firmware/quintuna/CRIT/CMakeLists.txt
index a0d79dabb2..2817c16fc3 100644
--- a/firmware/quintuna/CRIT/CMakeLists.txt
+++ b/firmware/quintuna/CRIT/CMakeLists.txt
@@ -4,51 +4,35 @@ set(ARM_CORE "cm4")
set(LINKER_SCRIPT "${LINKER_DIR}/stm32f412rgtx/stm32f412rgtx_app.ld")
file(GLOB_RECURSE SYSTEM_SRCS
- "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/cubemx/Src/*.c"
)
set(SYSTEM_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/src"
)
-file(GLOB_RECURSE APP_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/app/*.cpp")
+file(GLOB_RECURSE APP_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/app/*.c")
list(APPEND APP_SRCS
- "${SHARED_APP_INCLUDE_DIR_CPP}/app_stateMachine.cpp"
- "${SHARED_APP_INCLUDE_DIR_CPP}/app_timer.cpp"
+ ""
)
-set(APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src/app" "${SHARED_APP_INCLUDE_DIR_CPP}")
+set(APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src/app" "${SHARED_APP_INCLUDE_DIR}")
-file(GLOB_RECURSE IO_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/io/*.cpp")
+file(GLOB_RECURSE IO_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/io/*.c")
list(APPEND IO_SRCS
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_led.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_switch.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_shdnLoopNode.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_heartbeatNode.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_log.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_jsoncan.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_canMsgQueue.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_time.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_chimera.cpp"
- "${SHARED_IO_INCLUDE_DIR_CPP}/io_stackMonitor.cpp"
+ ""
)
-set(IO_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src/io" "${SHARED_IO_INCLUDE_DIR_CPP}")
+set(IO_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src/io" "${SHARED_IO_INCLUDE_DIR}")
file(GLOB_RECURSE HW_SRCS
- "${CMAKE_CURRENT_SOURCE_DIR}/src/hw/*.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/hw/*.c"
)
list(APPEND HW_SRCS
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_error.cpp"
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_hardFaultHandler.cpp"
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_gpio.cpp"
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_can.cpp"
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_bootup.cpp"
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_assert.cpp"
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_uart.cpp"
- "${SHARED_HW_INCLUDE_DIR_CPP}/hw_watchdog.cpp"
+ "${SHARED_HW_INCLUDE_DIR}/hw_error.c"
+ "${SHARED_HW_INCLUDE_DIR}/hw_hardFaultHandler.c"
)
set(HW_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/src/hw"
- "${SHARED_HW_INCLUDE_DIR_CPP}"
+ "${SHARED_HW_INCLUDE_DIR}"
)
if ("${TARGET}" STREQUAL "binary")
@@ -107,17 +91,15 @@ if ("${TARGET}" STREQUAL "binary")
)
# JSONCAN
- jsoncan_embedded_library(CRIT quintuna "${CMAKE_CURRENT_BINARY_DIR}" ${ARM_CORE})
+ jsoncan_embedded_library(CRIT quintuna "${CMAKE_CURRENT_BINARY_DIR}")
# CommitInfo
commit_info_library(
"quintuna_CRIT_app.elf"
"quintuna_CRIT_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quintuna_CRIT_jsoncan" PRIVATE "quintuna_CRIT_stm32cube")
target_link_libraries("quintuna_CRIT_app.elf" PRIVATE "quintuna_CRIT_stm32cube" "quintuna_CRIT_jsoncan" "quintuna_CRIT_commit_info" "debug_modules")
target_link_libraries("quintuna_CRIT_boot.elf" PRIVATE "quintuna_CRIT_commit_info")
diff --git a/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc b/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc
index 255413c29b..cf36ab1937 100644
--- a/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc
+++ b/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc
@@ -74,8 +74,8 @@ Mcu.PinsNb=38
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F412RGTx
-MxCube.Version=6.9.2
-MxDb.Version=DB.6.0.92
+MxCube.Version=6.12.0
+MxDb.Version=DB.6.0.120
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
@@ -232,7 +232,7 @@ ProjectManager.CustomerFirmwarePackage=
ProjectManager.DefaultFWLocation=true
ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32F412RGTx
-ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.27.1
+ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.28.1
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=0x00
diff --git a/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc.md5 b/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc.md5
index d6bf660a2a..8e914305a1 100644
--- a/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc.md5
+++ b/firmware/quintuna/CRIT/boot/cubemx/CRIT_boot.ioc.md5
@@ -1 +1 @@
-2d762bad1b1a74592e25cb8336ff2930
\ No newline at end of file
+b7c7b31bb83a0bff6af4ae6a95e3655b
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/boot/cubemx/Inc/stm32f4xx_hal_conf.h b/firmware/quintuna/CRIT/boot/cubemx/Inc/stm32f4xx_hal_conf.h
index 94b320d3cb..9dd18a75e2 100644
--- a/firmware/quintuna/CRIT/boot/cubemx/Inc/stm32f4xx_hal_conf.h
+++ b/firmware/quintuna/CRIT/boot/cubemx/Inc/stm32f4xx_hal_conf.h
@@ -215,7 +215,7 @@ extern "C"
#define MAC_ADDR5 0U
/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE /* buffer size for receive */
+#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
diff --git a/firmware/quintuna/CRIT/boot/cubemx/Src/main.c b/firmware/quintuna/CRIT/boot/cubemx/Src/main.c
index 680f946f3c..67b58b7bf1 100644
--- a/firmware/quintuna/CRIT/boot/cubemx/Src/main.c
+++ b/firmware/quintuna/CRIT/boot/cubemx/Src/main.c
@@ -185,6 +185,7 @@ int main(void)
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
+
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
diff --git a/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_msp.c b/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_msp.c
index 8d95c88f19..060cad00b8 100644
--- a/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_msp.c
+++ b/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_msp.c
@@ -1,3 +1,4 @@
+
/* USER CODE BEGIN Header */
/**
******************************************************************************
@@ -20,7 +21,6 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
-
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
diff --git a/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c b/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c
index a04ddea3c2..02adafab26 100644
--- a/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c
+++ b/firmware/quintuna/CRIT/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c
@@ -49,10 +49,8 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
/* Enable TIM6 clock */
__HAL_RCC_TIM6_CLK_ENABLE();
-
/* Get clock configuration */
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
-
/* Get APB1 prescaler */
uwAPB1Prescaler = clkconfig.APB1CLKDivider;
/* Compute TIM6 clock */
diff --git a/firmware/quintuna/CRIT/src/app/app_critHeartbeat.h b/firmware/quintuna/CRIT/src/app/app_critHeartbeat.h
deleted file mode 100644
index bc68da1e39..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_critHeartbeat.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "app_heartbeatMonitor.h"
-#include "io_critHeartbeatNodes.h"
-
-namespace app::heartbeat
-{
-static const monitor<4> critHeartbeat{ app_canTx_CRIT_Heartbeat_set,
- { &io::heartbeat::bms, &io::heartbeat::vc, &io::heartbeat::rsm,
- &io::heartbeat::fsm } };
-}
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/app/app_critShdn.h b/firmware/quintuna/CRIT/src/app/app_critShdn.h
deleted file mode 100644
index b5e39bcd9c..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_critShdn.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-#include
-#include "app_shdnLoop.h"
-#include "io_critShdn.h"
-
-namespace app::shdn
-{
-static const shdnLoop<2> critShdn{ { &io::shdn::cockpit_estop_node, &io::shdn::inertia_sen_node } };
-}
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/app/app_driveMode.cpp b/firmware/quintuna/CRIT/src/app/app_driveMode.cpp
deleted file mode 100644
index d5176a6d50..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_driveMode.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "io_driveMode.h"
-extern "C"
-{
-#include "app_canTx.h"
-}
-
-namespace app::driveMode
-{
-void broadcast()
-{
- uint16_t driveMode = io::driveMode::readPins();
- app_canTx_CRIT_DriveMode_set(driveMode);
-}
-} // namespace app::driveMode
diff --git a/firmware/quintuna/CRIT/src/app/app_driveMode.h b/firmware/quintuna/CRIT/src/app/app_driveMode.h
deleted file mode 100644
index 67eedd4432..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_driveMode.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-namespace app::driveMode
-{
-void broadcast();
-}
diff --git a/firmware/quintuna/CRIT/src/app/app_leds.cpp b/firmware/quintuna/CRIT/src/app/app_leds.cpp
deleted file mode 100644
index 2979dd644e..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_leds.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "app_leds.h"
-#include "io_leds.h"
-extern "C"
-{
-#include "app_canRx.h"
-#include "app_canAlerts.h"
-}
-
-enum class BoardLEDStatus
-{
- OK,
- WARNING,
- FAULT,
- NOT_IMPLEMENTED,
- MISSING_HEARTBEAT
-};
-
-static BoardLEDStatus worstBoardStatus(CanAlertBoard board)
-{
- bool is_missing_heartbeat;
- switch (board)
- {
- case BMS_ALERT_BOARD:
- {
- is_missing_heartbeat = app_canAlerts_CRIT_Fault_MissingBMSHeartbeat_get();
- break;
- }
- case CRIT_ALERT_BOARD:
- {
- is_missing_heartbeat = false; // lmao like
- break;
- }
- case FSM_ALERT_BOARD:
- {
- is_missing_heartbeat = app_canAlerts_CRIT_Fault_MissingFSMHeartbeat_get();
- break;
- }
- case VC_ALERT_BOARD:
- {
- is_missing_heartbeat = app_canAlerts_CRIT_Fault_MissingVCHeartbeat_get();
- break;
- }
- case RSM_ALERT_BOARD:
- {
- is_missing_heartbeat = app_canAlerts_CRIT_Fault_MissingRSMHeartbeat_get();
- break;
- }
- default:
- is_missing_heartbeat = false;
- }
- if (is_missing_heartbeat)
- {
- return BoardLEDStatus::MISSING_HEARTBEAT;
- }
- else if (app_canAlerts_BoardHasFault(board))
- {
- return BoardLEDStatus::FAULT;
- }
- else if (app_canAlerts_BoardHasWarning(board))
- {
- return BoardLEDStatus::WARNING;
- }
- return BoardLEDStatus::OK;
-}
-
-io::led::RgbColor board_status_to_rgb(const BoardLEDStatus status)
-{
- switch (status)
- {
- case BoardLEDStatus::FAULT:
- return io::led::RgbColor::RED;
- case BoardLEDStatus::OK:
- return io::led::RgbColor::GREEN;
- case BoardLEDStatus::WARNING:
- return io::led::RgbColor::YELLOW;
- case BoardLEDStatus::NOT_IMPLEMENTED:
- return io::led::RgbColor::WHITE;
- case BoardLEDStatus::MISSING_HEARTBEAT:
- default:
- return io::led::RgbColor::OFF;
- }
-}
-
-namespace app::leds
-{
-void update()
-{
- io::leds::imd_led.set(app_canRx_BMS_ImdLatchedFault_get());
- io::leds::bspd_led.set(app_canRx_BMS_BspdLatchedFault_get());
- io::leds::ams_led.set(app_canRx_BMS_BmsLatchedFault_get());
- io::leds::start_led.set(app_canRx_VC_State_get() == VC_DRIVE_STATE);
- io::leds::regen_led.set(app_canRx_VC_RegenEnabled_get());
- io::leds::torquevec_led.set(app_canRx_VC_TorqueVectoringEnabled_get());
-
- // or driven by BMS_drive_state???
- io::leds::shutdown_status_led.set(
- board_status_to_rgb(app_canRx_VC_FirstFaultNode_get() == SHDN_OK ? BoardLEDStatus::OK : BoardLEDStatus::FAULT));
-
- io::leds::bms_status_led.set(board_status_to_rgb(worstBoardStatus(BMS_ALERT_BOARD)));
- io::leds::fsm_status_led.set(board_status_to_rgb(worstBoardStatus(FSM_ALERT_BOARD)));
- io::leds::vc_status_led.set(board_status_to_rgb(worstBoardStatus(VC_ALERT_BOARD)));
- io::leds::rsm_status_led.set(board_status_to_rgb(worstBoardStatus(RSM_ALERT_BOARD)));
- io::leds::aux_status_led.set(board_status_to_rgb(BoardLEDStatus::NOT_IMPLEMENTED)); // TODO AUX status
- io::leds::crit_status_led.set(board_status_to_rgb(worstBoardStatus(CRIT_ALERT_BOARD)));
-}
-} // namespace app::leds
diff --git a/firmware/quintuna/CRIT/src/app/app_leds.h b/firmware/quintuna/CRIT/src/app/app_leds.h
deleted file mode 100644
index 7726d3540e..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_leds.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-namespace app::leds
-{
-void update();
-}
diff --git a/firmware/quintuna/CRIT/src/app/app_mainState.cpp b/firmware/quintuna/CRIT/src/app/app_mainState.cpp
deleted file mode 100644
index 53fdd5c7f3..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_mainState.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "app_mainState.h"
-#include "app_switches.h"
-#include "app_leds.h"
-#include "app_driveMode.h"
-#include "app_critShdn.h"
-#include "app_critHeartbeat.h"
-#include "app_stackMonitorConfig.h"
-
-static void mainStateRunOnTick100Hz()
-{
- app::switches::broadcast();
- app::leds::update();
- app::driveMode::broadcast();
- app::shdn::critShdn.broadcast();
- app::heartbeat::critHeartbeat.checkIn();
- app::heartbeat::critHeartbeat.broadcastFaults();
- app::crit_stack_monitor.check();
-}
-static void mainStateRunOnEntry() {}
-static void mainStateRunOnTick1Hz() {}
-static void mainStateRunOnExit() {}
-
-namespace app::critstates
-{
-const State main_state{
- .name = "MAIN",
- .run_on_entry = mainStateRunOnEntry,
- .run_on_tick_1Hz = mainStateRunOnTick1Hz,
- .run_on_tick_100Hz = mainStateRunOnTick100Hz,
- .run_on_exit = mainStateRunOnExit,
-};
-}
diff --git a/firmware/quintuna/CRIT/src/app/app_mainState.h b/firmware/quintuna/CRIT/src/app/app_mainState.h
deleted file mode 100644
index cb79192d25..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_mainState.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma once
-
-#include "app_stateMachine.h"
-
-namespace app::critstates
-{
-extern const State main_state;
-}
diff --git a/firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.cpp b/firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.cpp
deleted file mode 100644
index c99bdc7d72..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "app_stackMonitorConfig.h"
-#include "io_stackMonitorConfig.h"
-extern "C"
-{
-#include "app_canTx.h"
-}
-
-namespace app
-{
-const StackMonitor<5> crit_stack_monitor{
- { stack_monitor_config{ task_1_hz_stack_monitor, 0.7f, app_canTx_CRIT_StackWaterMarkHighTask1HzLevel_set,
- app_canTx_CRIT_Warning_StackWaterMarkHighTask1Hz_set },
- stack_monitor_config{ task_100_hz_stack_monitor, 0.7f, app_canTx_CRIT_StackWaterMarkHighTask100HzLevel_set,
- app_canTx_CRIT_Warning_StackWaterMarkHighTask100Hz_set },
- stack_monitor_config{ task_1_khz_stack_monitor, 0.7f, app_canTx_CRIT_StackWaterMarkHighTask1kHzLevel_set,
- app_canTx_CRIT_Warning_StackWaterMarkHighTask1kHz_set },
- stack_monitor_config{ task_canrx_stack_monitor, 0.7f, app_canTx_CRIT_StackWaterMarkHighTaskCanRxLevel_set,
- app_canTx_CRIT_Warning_StackWaterMarkHighTaskCanTx_set },
- stack_monitor_config{ task_cantx_stack_monitor, 0.7f, app_canTx_CRIT_StackWaterMarkHighTaskCanTxLevel_set,
- app_canTx_CRIT_Warning_StackWaterMarkHighTaskCanRx_set } }
-};
-} // namespace app
diff --git a/firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.h b/firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.h
deleted file mode 100644
index fbea0292ae..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_stackMonitorConfig.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-#include "app_stackMonitor.h"
-
-namespace app
-{
-extern const StackMonitor<5> crit_stack_monitor;
-}
diff --git a/firmware/quintuna/CRIT/src/app/app_switches.cpp b/firmware/quintuna/CRIT/src/app/app_switches.cpp
deleted file mode 100644
index 10f01160a7..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_switches.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "app_switches.h"
-#include "io_switches.h"
-extern "C"
-{
-#include "app_canTx.h"
-}
-
-namespace app::switches
-{
-void broadcast()
-{
- app_canTx_CRIT_StartSwitch_set(io::switches::start_switch.isClosed() ? SWITCH_ON : SWITCH_OFF);
- app_canTx_CRIT_RegenSwitch_set(io::switches::regen_switch.isClosed() ? SWITCH_ON : SWITCH_OFF);
- app_canTx_CRIT_TorqueVecSwitch_set(io::switches::torquevec_switch.isClosed() ? SWITCH_ON : SWITCH_OFF);
-}
-} // namespace app::switches
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/app/app_switches.h b/firmware/quintuna/CRIT/src/app/app_switches.h
deleted file mode 100644
index deeeef0e0e..0000000000
--- a/firmware/quintuna/CRIT/src/app/app_switches.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-namespace app::switches
-{
-void broadcast();
-}
diff --git a/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc b/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc
index 8dc3107fe2..e4db63d873 100644
--- a/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc
+++ b/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc
@@ -116,8 +116,8 @@ Mcu.PinsNb=52
Mcu.ThirdPartyNb=0
Mcu.UserConstants=TASK_100HZ_STACK_SIZE,512;TASK_CANRX_STACK_SIZE,512;TASK_CANTX_STACK_SIZE,512;TIM3_PRESCALER,8;TIM12_PWM_MINIMUM_FREQUENCY,1;IWDG_RESET_FREQUENCY,5;ADC_FREQUENCY,1000;TIMx_FREQUENCY,96000000;TIM12_PRESCALER,(TIMx_FREQUENCY / TIM12_AUTO_RELOAD_REG / TIM12_PWM_MINIMUM_FREQUENCY);TASK_1HZ_STACK_SIZE,512;TASK_1KHZ_STACK_SIZE,512;TIM12_AUTO_RELOAD_REG,0xFFFF;IWDG_PRESCALER,4;LSI_FREQUENCY,32000
Mcu.UserName=STM32F412RGTx
-MxCube.Version=6.9.2
-MxDb.Version=DB.6.0.92
+MxCube.Version=6.12.0
+MxDb.Version=DB.6.0.120
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
@@ -338,7 +338,7 @@ ProjectManager.CustomerFirmwarePackage=
ProjectManager.DefaultFWLocation=true
ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32F412RGTx
-ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.27.1
+ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.28.1
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=0x00
diff --git a/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc.md5 b/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc.md5
index a0f72d319c..e601c2c60e 100644
--- a/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc.md5
+++ b/firmware/quintuna/CRIT/src/cubemx/CRIT.ioc.md5
@@ -1 +1 @@
-76bd7d624d63308a0bafc6a5d77702a4
\ No newline at end of file
+9b0ccd709a373a33bcbde42c72d6979d
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/cubemx/Inc/main.h b/firmware/quintuna/CRIT/src/cubemx/Inc/main.h
index 32d3294d2a..41649b08d2 100644
--- a/firmware/quintuna/CRIT/src/cubemx/Inc/main.h
+++ b/firmware/quintuna/CRIT/src/cubemx/Inc/main.h
@@ -30,8 +30,8 @@ extern "C"
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
- /* Private includes ----------------------------------------------------------*/
- /* USER CODE BEGIN Includes */
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
#include "cmsis_os.h"
/* USER CODE END Includes */
diff --git a/firmware/quintuna/CRIT/src/cubemx/Inc/stm32f4xx_hal_conf.h b/firmware/quintuna/CRIT/src/cubemx/Inc/stm32f4xx_hal_conf.h
index 4b4dc0e410..3f4977bd50 100644
--- a/firmware/quintuna/CRIT/src/cubemx/Inc/stm32f4xx_hal_conf.h
+++ b/firmware/quintuna/CRIT/src/cubemx/Inc/stm32f4xx_hal_conf.h
@@ -215,7 +215,7 @@ extern "C"
#define MAC_ADDR5 0U
/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE /* buffer size for receive */
+#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
diff --git a/firmware/quintuna/CRIT/src/cubemx/Src/main.c b/firmware/quintuna/CRIT/src/cubemx/Src/main.c
index 2246f259a3..c9fda3ba9d 100644
--- a/firmware/quintuna/CRIT/src/cubemx/Src/main.c
+++ b/firmware/quintuna/CRIT/src/cubemx/Src/main.c
@@ -226,6 +226,7 @@ int main(void)
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
+
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
diff --git a/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_msp.c b/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_msp.c
index f0a886362a..d85a18e975 100644
--- a/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_msp.c
+++ b/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_msp.c
@@ -1,3 +1,4 @@
+
/* USER CODE BEGIN Header */
/**
******************************************************************************
@@ -20,7 +21,6 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
-
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
diff --git a/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_timebase_tim.c b/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_timebase_tim.c
index be3c277012..54044da3b8 100644
--- a/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_timebase_tim.c
+++ b/firmware/quintuna/CRIT/src/cubemx/Src/stm32f4xx_hal_timebase_tim.c
@@ -49,10 +49,8 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
/* Enable TIM6 clock */
__HAL_RCC_TIM6_CLK_ENABLE();
-
/* Get clock configuration */
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
-
/* Get APB1 prescaler */
uwAPB1Prescaler = clkconfig.APB1CLKDivider;
/* Compute TIM6 clock */
diff --git a/firmware/quintuna/CRIT/src/hw/hw_adcs.cpp b/firmware/quintuna/CRIT/src/hw/hw_adcs.cpp
deleted file mode 100644
index 01ab5b9a9d..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_adcs.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "hw_adcs.h"
-#include "main.h"
-
-namespace hw::adc
-{
-const AdcChip adc1{ &hadc1 };
-const Adc regen_3v3_adc{ adc1.getChannel(ADC1_IN14_REGEN) };
-} // namespace hw::adc
-
-void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
-{
- UNUSED(hadc);
- hw::adc::adc1.update_callback();
-}
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/hw/hw_adcs.h b/firmware/quintuna/CRIT/src/hw/hw_adcs.h
deleted file mode 100644
index 7075b76f5e..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_adcs.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-#include "hw_adc.h"
-
-namespace hw::adc
-{
-// In STM32 terminology, each ADC pin corresponds to an ADC channel (See:
-// ADCEx_channels). If there are multiple ADC channels being measured, the ADC
-// measures them based on "rank" (See: ADCEx_regular_rank). The rank starts
-// counting at 1, and the lower the rank, the higher the measurement priority.
-//
-// For example, suppose we are measuring ADC channel 2, 4, and 7, which have
-// rank 3, 1, and 2 respectively. The ADC will measure the channel 4, then
-// channel 7, and finally channel 2. This order is important because it
-// determines the order in which the DMA writes data to our raw_adc_values
-// buffer.
-//
-// The following enum is used to index into raw_adc_values, which means it must
-// be ordered in ascending ranks. If we were writing an enum for the earlier
-// example, it would look like:
-//
-// enum
-// {
-// CHANNEL_4, // Rank 1
-// CHANNEL_7, // Rank 2
-// CHANNEL_2, // Rank 3
-// NUM_ADC_CHANNELS,
-// };
-enum AdcChannel
-{
- ADC1_IN14_REGEN,
- NUM_ADC_CHANNELS
-};
-
-extern const AdcChip adc1;
-extern const Adc regen_3v3_adc;
-} // namespace hw::adc
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/hw/hw_cans.cpp b/firmware/quintuna/CRIT/src/hw/hw_cans.cpp
deleted file mode 100644
index b990c91845..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_cans.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "main.h"
-#include "hw_cans.h"
-#include "io_canMsgQueues.h"
-
-namespace hw::can
-{
-const CanBus can1{ &hcan1, [](const CanMsg *canMsg)
- {
- if (!io_canRx_filterMessageId(canMsg->std_id))
- return;
- io::can1queue.pushRxMsgToQueue(canMsg);
- } };
-} // namespace hw::can
-
-extern "C" void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
-{
- UNUSED(hcan);
- hw::can::can1.receive(CAN_RX_FIFO0);
-}
-
-extern "C" void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan)
-{
- UNUSED(hcan);
- hw::can::can1.receive(CAN_RX_FIFO1);
-}
diff --git a/firmware/quintuna/CRIT/src/hw/hw_cans.h b/firmware/quintuna/CRIT/src/hw/hw_cans.h
deleted file mode 100644
index 6b8f73cb21..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_cans.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-#include "hw_can.h"
-
-namespace hw::can
-{
-extern const CanBus can1;
-} // namespace hw::can
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/hw/hw_gpios.cpp b/firmware/quintuna/CRIT/src/hw/hw_gpios.cpp
deleted file mode 100644
index d96e666960..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_gpios.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "hw_Gpios.h"
-#include "main.h"
-#include "app_utils.h"
-
-namespace hw::gpio
-{
-const Gpio start_switch_gpio{ START_SIG_GPIO_Port, START_SIG_Pin };
-const Gpio regen_switch_gpio{ REGEN_SIG_GPIO_Port, REGEN_SIG_Pin };
-const Gpio torquevec_switch_gpio{ TORQUE_VECTORING_SIG_GPIO_Port, TORQUE_VECTORING_SIG_Pin };
-
-const Gpio imd_r_pin{ IMD_R_GPIO_Port, IMD_R_Pin };
-const Gpio bspd_r_pin{ BSPD_R_GPIO_Port, BSPD_R_Pin };
-const Gpio ams_r_pin{ AMS_R_GPIO_Port, AMS_R_Pin };
-
-const Gpio start_led_pin{ START_LED_GPIO_Port, START_LED_Pin };
-const Gpio regen_led_pin{ REGEN_LED_GPIO_Port, REGEN_LED_Pin };
-const Gpio torquevec_led_pin{ TORQUE_VECTORING_LED_GPIO_Port, TORQUE_VECTORING_LED_Pin };
-
-const Gpio debug_led_pin{ LED_GPIO_Port, LED_Pin };
-
-const Gpio shdn_r_pin{ SHDN_R_GPIO_Port, SHDN_R_Pin };
-const Gpio shdn_g_pin{ SHDN_G_GPIO_Port, SHDN_G_Pin };
-const Gpio shdn_b_pin_fake{ 0, MAX_8_BITS_VALUE };
-
-const Gpio vc_r_pin{ VC_R_GPIO_Port, VC_R_Pin };
-const Gpio vc_g_pin{ VC_G_GPIO_Port, VC_G_Pin };
-const Gpio vc_b_pin{ VC_B_GPIO_Port, VC_B_Pin };
-
-const Gpio bms_r_pin{ BMS_R_GPIO_Port, BMS_R_Pin };
-const Gpio bms_g_pin{ BMS_G_GPIO_Port, BMS_G_Pin };
-const Gpio bms_b_pin{ BMS_B_GPIO_Port, BMS_B_Pin };
-
-const Gpio fsm_r_pin{ FSM_R_GPIO_Port, FSM_R_Pin };
-const Gpio fsm_g_pin{ FSM_G_GPIO_Port, FSM_G_Pin };
-const Gpio fsm_b_pin{ FSM_B_GPIO_Port, FSM_B_Pin };
-
-const Gpio rsm_r_pin{ RSM_R_GPIO_Port, RSM_R_Pin };
-const Gpio rsm_g_pin{ RSM_G_GPIO_Port, RSM_G_Pin };
-const Gpio rsm_b_pin{ RSM_B_GPIO_Port, RSM_B_Pin };
-
-const Gpio aux_r_pin{ AUX_DB_R_GPIO_Port, AUX_DB_R_Pin };
-const Gpio aux_g_pin{ AUX_DB_G_GPIO_Port, AUX_DB_G_Pin };
-const Gpio aux_b_pin{ AUX_DB_B_GPIO_Port, AUX_DB_B_Pin };
-
-const Gpio crit_r_pin{ CRIT_DB_R_GPIO_Port, CRIT_DB_R_Pin };
-const Gpio crit_g_pin{ CRIT_DB_G_GPIO_Port, CRIT_DB_G_Pin };
-const Gpio crit_b_pin{ CRIT_DB_B_GPIO_Port, CRIT_DB_B_Pin };
-
-const Gpio n_drive_mode_0_pin{ NDRIVE_MODE_0b_GPIO_Port, NDRIVE_MODE_0b_Pin };
-const Gpio n_drive_mode_1_pin{ NDRIVE_MODE_1b_GPIO_Port, NDRIVE_MODE_1b_Pin };
-const Gpio n_drive_mode_2_pin{ NDRIVE_MODE_2b_GPIO_Port, NDRIVE_MODE_2b_Pin };
-const Gpio n_drive_mode_3_pin{ NDRIVE_MODE_3b_GPIO_Port, NDRIVE_MODE_3b_Pin };
-
-const Gpio cockpit_estop_sen_pin{ SHDN_SEN_GPIO_Port, SHDN_SEN_Pin };
-const Gpio inertia_sen_pin{ INERTIA_SEN_GPIO_Port, INERTIA_SEN_Pin };
-const Gpio n_program_pin{ NPROGRAM_3V3_GPIO_Port, NPROGRAM_3V3_Pin };
-const Gpio n_chimera_pin{ NCHIMERA_GPIO_Port, NCHIMERA_Pin };
-const Gpio led_pin{ LED_GPIO_Port, LED_Pin };
-} // namespace hw::gpio
diff --git a/firmware/quintuna/CRIT/src/hw/hw_gpios.h b/firmware/quintuna/CRIT/src/hw/hw_gpios.h
deleted file mode 100644
index a25f27b4f5..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_gpios.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "hw_gpio.h"
-
-namespace hw::gpio
-{
-// switches
-extern const Gpio start_switch_gpio;
-extern const Gpio regen_switch_gpio;
-extern const Gpio torquevec_switch_gpio;
-
-// binary leds
-extern const Gpio imd_r_pin;
-extern const Gpio bspd_r_pin;
-extern const Gpio ams_r_pin;
-
-extern const Gpio start_led_pin;
-extern const Gpio regen_led_pin;
-extern const Gpio torquevec_led_pin;
-
-extern const Gpio debug_led_pin;
-
-// rgb leds
-extern const Gpio shdn_r_pin;
-extern const Gpio shdn_g_pin;
-extern const Gpio shdn_b_pin_fake;
-
-extern const Gpio bms_r_pin;
-extern const Gpio bms_g_pin;
-extern const Gpio bms_b_pin;
-
-extern const Gpio fsm_r_pin;
-extern const Gpio fsm_g_pin;
-extern const Gpio fsm_b_pin;
-
-extern const Gpio vc_r_pin;
-extern const Gpio vc_g_pin;
-extern const Gpio vc_b_pin;
-
-extern const Gpio rsm_r_pin;
-extern const Gpio rsm_g_pin;
-extern const Gpio rsm_b_pin;
-
-extern const Gpio aux_r_pin;
-extern const Gpio aux_g_pin;
-extern const Gpio aux_b_pin;
-
-extern const Gpio crit_r_pin;
-extern const Gpio crit_g_pin;
-extern const Gpio crit_b_pin;
-
-// drive mode pins
-extern const Gpio n_drive_mode_0_pin;
-extern const Gpio n_drive_mode_1_pin;
-extern const Gpio n_drive_mode_2_pin;
-extern const Gpio n_drive_mode_3_pin;
-
-// shutdown sensors
-extern const Gpio cockpit_estop_sen_pin;
-extern const Gpio inertia_sen_pin;
-extern const Gpio n_program_pin;
-extern const Gpio n_chimera_pin;
-extern const Gpio led_pin;
-} // namespace hw::gpio
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/hw/hw_sysviewDescConfig.cpp b/firmware/quintuna/CRIT/src/hw/hw_sysviewDescConfig.c
similarity index 72%
rename from firmware/quintuna/CRIT/src/hw/hw_sysviewDescConfig.cpp
rename to firmware/quintuna/CRIT/src/hw/hw_sysviewDescConfig.c
index d5d6fb4183..704b0be438 100644
--- a/firmware/quintuna/CRIT/src/hw/hw_sysviewDescConfig.cpp
+++ b/firmware/quintuna/CRIT/src/hw/hw_sysviewDescConfig.c
@@ -1,6 +1,6 @@
#include "SEGGER_SYSVIEW.h"
-extern "C" void hw_sysviewConfig_sendSystemDesc(void)
+void hw_sysviewConfig_sendSystemDesc(void)
{
SEGGER_SYSVIEW_SendSysDesc("N=CRIT,D=Cortex-M4,O=FreeRTOS");
SEGGER_SYSVIEW_SendSysDesc("I#15=SysTick");
diff --git a/firmware/quintuna/CRIT/src/hw/hw_uarts.h b/firmware/quintuna/CRIT/src/hw/hw_uarts.h
deleted file mode 100644
index a78fc99423..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_uarts.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-#include "hw_uart.h"
-#include "main.h"
-
-namespace hw::uart
-{
-const Uart chimera_uart{ &huart2 };
-}
-
-void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
-{
- if (huart == hw::uart::chimera_uart.getHandle())
- {
- io::chimera::msgRxCallback();
- }
-}
diff --git a/firmware/quintuna/CRIT/src/hw/hw_watchdogs.h b/firmware/quintuna/CRIT/src/hw/hw_watchdogs.h
deleted file mode 100644
index 4ced2b9932..0000000000
--- a/firmware/quintuna/CRIT/src/hw/hw_watchdogs.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-#include "hw_watchdog.h"
-
-namespace hw::watchdogConfig
-{
-void refresh_hardware_watchdog()
-{
- HAL_IWDG_Refresh(&hiwdg);
-}
-void timeout_callback(hw::watchdog::WatchdogInstance *watchdog)
-{
- BREAK_IF_DEBUGGER_CONNECTED();
- const uint8_t watchdog_id = watchdog->task_id;
- app_canAlerts_CRIT_Warning_WatchdogTimeout_set(true);
- app_canTx_CRIT_WatchdogTimeoutTaskName_set(static_cast(watchdog_id));
-}
-} // namespace hw::watchdogConfig
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/io/io_canMsgQueues.h b/firmware/quintuna/CRIT/src/io/io_canMsgQueues.h
deleted file mode 100644
index 93448715dd..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_canMsgQueues.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#pragma once
-
-#include "io_canMsgQueue.h"
-#include "hw_utils.h"
-extern "C"
-{
-#include "app_canTx.h"
-#include "app_canAlerts.h"
-#include "io_canRx.h"
-}
-
-namespace io
-{
-namespace can1
-{
- static void TxQueueOverflowCallback(uint32_t overflow_count)
- {
- app_canTx_CRIT_TxOverflowCount_set(overflow_count);
- app_canAlerts_CRIT_Warning_TxOverflow_set(true);
- // BREAK_IF_DEBUGGER_CONNECTED()
- }
-
- static void RxQueueOverflowCallback(uint32_t overflow_count)
- {
- app_canTx_CRIT_RxOverflowCount_set(overflow_count);
- app_canAlerts_CRIT_Warning_RxOverflow_set(true);
- // BREAK_IF_DEBUGGER_CONNECTED()
- }
-
- static void TxQueueOverflowClearCallback()
- {
- app_canAlerts_CRIT_Warning_TxOverflow_set(false);
- }
-
- static void RxQueueOverflowClearCallback()
- {
- app_canAlerts_CRIT_Warning_RxOverflow_set(false);
- }
-} // namespace can1
-
-static CanMsgQueue can1queue{ "can1", can1::TxQueueOverflowCallback, can1::RxQueueOverflowCallback,
- can1::TxQueueOverflowClearCallback, can1::RxQueueOverflowClearCallback };
-} // namespace io
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/io/io_chimeraConfig.h b/firmware/quintuna/CRIT/src/io/io_chimeraConfig.h
deleted file mode 100644
index c4d3bb65ec..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_chimeraConfig.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#pragma once
-#include "io_chimera.h"
-
-#include "hw_gpios.h"
-#include "hw_adcs.h"
-#include "CRIT.pb.h"
-
-const hw::Gpio *id_to_gpio(uint32_t net_name)
-{
- switch (static_cast(net_name))
- {
- CASERETURN(CRIT_GpioNetName_TORQUE_VECTORING_LED, &hw::gpio::torquevec_led_pin);
- CASERETURN(CRIT_GpioNetName_START_LED, &hw::gpio::start_led_pin);
- CASERETURN(CRIT_GpioNetName_REGEN_LED, &hw::gpio::regen_led_pin);
- CASERETURN(CRIT_GpioNetName_AUX_DB_R, &hw::gpio::aux_r_pin);
- CASERETURN(CRIT_GpioNetName_CRIT_DB_R, &hw::gpio::crit_r_pin);
- CASERETURN(CRIT_GpioNetName_CRIT_DB_G, &hw::gpio::crit_g_pin);
- CASERETURN(CRIT_GpioNetName_CRIT_DB_B, &hw::gpio::crit_b_pin);
- CASERETURN(CRIT_GpioNetName_AUX_DB_G, &hw::gpio::aux_g_pin);
- CASERETURN(CRIT_GpioNetName_AUX_DB_B, &hw::gpio::aux_b_pin);
- CASERETURN(CRIT_GpioNetName_BSPD_R, &hw::gpio::bspd_r_pin);
- CASERETURN(CRIT_GpioNetName_SHDN_R, &hw::gpio::shdn_r_pin);
- CASERETURN(CRIT_GpioNetName_RSM_B, &hw::gpio::rsm_b_pin);
- CASERETURN(CRIT_GpioNetName_VC_R, &hw::gpio::vc_r_pin);
- CASERETURN(CRIT_GpioNetName_VC_B, &hw::gpio::vc_b_pin);
- CASERETURN(CRIT_GpioNetName_FSM_R, &hw::gpio::fsm_r_pin);
- CASERETURN(CRIT_GpioNetName_BMS_R, &hw::gpio::bms_r_pin);
- CASERETURN(CRIT_GpioNetName_BMS_G, &hw::gpio::bms_g_pin);
- CASERETURN(CRIT_GpioNetName_BMS_B, &hw::gpio::bms_b_pin);
- CASERETURN(CRIT_GpioNetName_AMS_R, &hw::gpio::ams_r_pin);
- CASERETURN(CRIT_GpioNetName_NDRIVE_MODE_1b, &hw::gpio::n_drive_mode_1_pin);
- CASERETURN(CRIT_GpioNetName_IMD_R, &hw::gpio::imd_r_pin);
- CASERETURN(CRIT_GpioNetName_INERTIA_SEN, &hw::gpio::inertia_sen_pin);
- CASERETURN(CRIT_GpioNetName_FSM_G, &hw::gpio::fsm_g_pin);
- CASERETURN(CRIT_GpioNetName_FSM_B, &hw::gpio::fsm_b_pin);
- CASERETURN(CRIT_GpioNetName_RSM_R, &hw::gpio::rsm_r_pin);
- CASERETURN(CRIT_GpioNetName_RSM_G, &hw::gpio::rsm_g_pin);
- CASERETURN(CRIT_GpioNetName_VC_G, &hw::gpio::vc_g_pin);
- CASERETURN(CRIT_GpioNetName_SHDN_G, &hw::gpio::shdn_g_pin);
- CASERETURN(CRIT_GpioNetName_NDRIVE_MODE_2b, &hw::gpio::n_drive_mode_2_pin);
- CASERETURN(CRIT_GpioNetName_NDRIVE_MODE_3b, &hw::gpio::n_drive_mode_3_pin);
- CASERETURN(CRIT_GpioNetName_NDRIVE_MODE_0b, &hw::gpio::n_drive_mode_0_pin);
- CASERETURN(CRIT_GpioNetName_TORQUE_VECTORING_SIG, &hw::gpio::torquevec_switch_gpio);
- CASERETURN(CRIT_GpioNetName_REGEN_SIG, &hw::gpio::regen_switch_gpio);
- CASERETURN(CRIT_GpioNetName_START_SIG, &hw::gpio::start_switch_gpio);
- CASERETURN(CRIT_GpioNetName_SDHN_SEN, &hw::gpio::cockpit_estop_sen_pin);
- CASERETURN(CRIT_GpioNetName_NPROGRAM_3V3, &hw::gpio::n_program_pin);
- CASERETURN(CRIT_GpioNetName_NCHIMERA, &hw::gpio::n_chimera_pin);
- CASERETURN(CRIT_GpioNetName_LED, &hw::gpio::led_pin);
- default:
- assert(false);
- return NULL;
- }
-}
-
-const hw::Adc *id_to_adc(uint32_t net_name)
-{
- switch (static_cast(net_name))
- {
- CASERETURN(CRIT_AdcNetName_REGEN_3V3, &hw::adc::regen_3v3_adc);
- default:
- assert(false);
- return NULL;
- }
-}
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/io/io_critHeartbeatNodes.h b/firmware/quintuna/CRIT/src/io/io_critHeartbeatNodes.h
deleted file mode 100644
index 54474dd561..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_critHeartbeatNodes.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "io_heartbeatNode.h"
-extern "C"
-{
-#include "app_canRx.h"
-#include "app_canAlerts.h"
-}
-
-namespace io::heartbeat
-{
-static node bms{ app_canRx_BMS_Heartbeat_get, [] { app_canRx_BMS_Heartbeat_update(false); },
- app_canAlerts_CRIT_Fault_MissingBMSHeartbeat_get, app_canAlerts_CRIT_Fault_MissingBMSHeartbeat_set };
-static node vc{ app_canRx_VC_Heartbeat_get, [] { app_canRx_VC_Heartbeat_update(false); },
- app_canAlerts_CRIT_Fault_MissingVCHeartbeat_get, app_canAlerts_CRIT_Fault_MissingVCHeartbeat_set };
-static node rsm{ app_canRx_RSM_Heartbeat_get, [] { app_canRx_RSM_Heartbeat_update(false); },
- app_canAlerts_CRIT_Fault_MissingRSMHeartbeat_get, app_canAlerts_CRIT_Fault_MissingRSMHeartbeat_set };
-static node fsm{ app_canRx_FSM_Heartbeat_get, [] { app_canRx_FSM_Heartbeat_update(false); },
- app_canAlerts_CRIT_Fault_MissingFSMHeartbeat_get, app_canAlerts_CRIT_Fault_MissingFSMHeartbeat_set };
-} // namespace io::heartbeat
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/io/io_critShdn.h b/firmware/quintuna/CRIT/src/io/io_critShdn.h
deleted file mode 100644
index 2a73b46498..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_critShdn.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-
-extern "C"
-{
-#include "app_canTx.h"
-}
-#include "io_shdnLoopNode.h"
-#include "hw_gpios.h"
-
-namespace io::shdn
-{
-const node cockpit_estop_node{ hw::gpio::cockpit_estop_sen_pin, app_canTx_CRIT_CockpitEStopOKStatus_set };
-const node inertia_sen_node{ hw::gpio::inertia_sen_pin, app_canTx_CRIT_InertiaSenOKStatus_set };
-} // namespace io::shdn
diff --git a/firmware/quintuna/CRIT/src/io/io_driveMode.cpp b/firmware/quintuna/CRIT/src/io/io_driveMode.cpp
deleted file mode 100644
index f51cc704d6..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_driveMode.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "io_driveMode.h"
-#include "hw_gpios.h"
-
-namespace io::driveMode
-{
-uint16_t readPins()
-{
- return (uint16_t)((uint16_t)(hw::gpio::n_drive_mode_0_pin.readPin()) +
- ((uint16_t)(hw::gpio::n_drive_mode_1_pin.readPin()) << 1) +
- ((uint16_t)(hw::gpio::n_drive_mode_2_pin.readPin()) << 2) +
- ((uint16_t)(hw::gpio::n_drive_mode_3_pin.readPin()) << 3));
-}
-} // namespace io::driveMode
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/io/io_driveMode.h b/firmware/quintuna/CRIT/src/io/io_driveMode.h
deleted file mode 100644
index 89937c00a3..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_driveMode.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-#include
-
-/**
- * Readings drive modes from the pins.
- */
-namespace io::driveMode
-{
-uint16_t readPins();
-}
diff --git a/firmware/quintuna/CRIT/src/io/io_leds.h b/firmware/quintuna/CRIT/src/io/io_leds.h
deleted file mode 100644
index 905cc98ff4..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_leds.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-#include "io_led.h"
-#include "hw_gpios.h"
-
-namespace io::leds
-{
-const io::binary_led imd_led{ hw::gpio::imd_r_pin };
-const io::binary_led bspd_led{ hw::gpio::bspd_r_pin };
-const io::binary_led ams_led{ hw::gpio::ams_r_pin };
-const io::binary_led start_led{ hw::gpio::start_led_pin };
-const io::binary_led regen_led{ hw::gpio::regen_led_pin };
-const io::binary_led torquevec_led{ hw::gpio::torquevec_led_pin };
-const io::binary_led debug_led{ hw::gpio::debug_led_pin };
-
-const io::led shutdown_status_led{ hw::gpio::shdn_r_pin, hw::gpio::shdn_g_pin, hw::gpio::shdn_b_pin_fake };
-
-const io::led bms_status_led{ hw::gpio::bms_r_pin, hw::gpio::bms_g_pin, hw::gpio::bms_b_pin };
-const io::led fsm_status_led{ hw::gpio::fsm_r_pin, hw::gpio::fsm_g_pin, hw::gpio::fsm_b_pin };
-const io::led vc_status_led{ hw::gpio::vc_r_pin, hw::gpio::vc_g_pin, hw::gpio::vc_b_pin };
-const io::led rsm_status_led{ hw::gpio::rsm_r_pin, hw::gpio::rsm_g_pin, hw::gpio::rsm_b_pin };
-const io::led aux_status_led{ hw::gpio::aux_r_pin, hw::gpio::aux_g_pin, hw::gpio::aux_b_pin };
-const io::led crit_status_led{ hw::gpio::crit_r_pin, hw::gpio::crit_g_pin, hw::gpio::crit_b_pin };
-} // namespace io::leds
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/io/io_stackMonitorConfig.h b/firmware/quintuna/CRIT/src/io/io_stackMonitorConfig.h
deleted file mode 100644
index 619991ea01..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_stackMonitorConfig.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma once
-#include "main.h"
-
-inline io::StackMonitor task_1_hz_stack_monitor{ &Task1HzHandle, Task1Hz_attributes.stack_size };
-inline io::StackMonitor task_100_hz_stack_monitor{ &Task100HzHandle, Task100Hz_attributes.stack_size };
-inline io::StackMonitor task_1_khz_stack_monitor{ &Task1kHzHandle, Task1kHz_attributes.stack_size };
-inline io::StackMonitor task_canrx_stack_monitor{ &TaskCanRxHandle, TaskCanRx_attributes.stack_size };
-inline io::StackMonitor task_cantx_stack_monitor{ &TaskCanTxHandle, TaskCanTx_attributes.stack_size };
\ No newline at end of file
diff --git a/firmware/quintuna/CRIT/src/io/io_switches.h b/firmware/quintuna/CRIT/src/io/io_switches.h
deleted file mode 100644
index 7bc63d9418..0000000000
--- a/firmware/quintuna/CRIT/src/io/io_switches.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-#include "io_switch.h"
-#include "hw_gpios.h"
-
-namespace io::switches
-{
-const static io::Switch start_switch{ hw::gpio::start_switch_gpio };
-const static io::Switch regen_switch{ hw::gpio::regen_switch_gpio };
-const static io::Switch torquevec_switch{ hw::gpio::torquevec_switch_gpio };
-} // namespace io::switches
diff --git a/firmware/quintuna/CRIT/src/tasks.cpp b/firmware/quintuna/CRIT/src/tasks.c
similarity index 52%
rename from firmware/quintuna/CRIT/src/tasks.cpp
rename to firmware/quintuna/CRIT/src/tasks.c
index 962b2f657a..35bfe2d318 100644
--- a/firmware/quintuna/CRIT/src/tasks.cpp
+++ b/firmware/quintuna/CRIT/src/tasks.c
@@ -2,37 +2,26 @@
#include "cmsis_os.h"
#include "shared.pb.h"
-// app
-#include "app_mainState.h"
-
// io
#include "io_log.h"
#include "io_jsoncan.h"
-#include "io_canMsgQueues.h"
-#include "io_chimeraConfig.h"
// hw
#include "hw_utils.h"
-#include "hw_bootup.h"
#include "hw_hardFaultHandler.h"
-#include "hw_cans.h"
-#include "hw_adcs.h"
-#include "hw_uarts.h"
-#include "hw_watchdogs.h"
// jsoncan stuff
-extern "C"
-{
#include "app_commitInfo.h"
#include "app_canRx.h"
#include "app_canTx.h"
#include "io_canTx.h"
#include "io_canRx.h"
-}
-void tasks_preInit()
+void tasks_preInit() {}
+
+static void canTransmit(const JsonCanMsg *msg)
{
- hw::bootup::enableInterruptsForApp();
+ UNUSED(msg);
}
void tasks_init()
@@ -46,87 +35,50 @@ void tasks_init()
__HAL_DBGMCU_FREEZE_IWDG();
hw_hardFaultHandler_init();
- hw::adc::adc1.init();
-
- io::chimera::init(
- &hw::uart::chimera_uart, GpioNetName_crit_net_name_tag, AdcNetName_crit_net_name_tag, &hw::gpio::n_chimera_pin);
-
// can
- hw::can::can1.init();
- io_canTx_init(
- [](const JsonCanMsg *msg)
- {
- hw::can::CanMsg tx_msg{};
- io::jsoncan::copyToCanMsg(msg, &tx_msg);
- io::can1queue.pushTxMsgToQueue(&tx_msg);
- }); // TODO this needs to be more sophisticated for multiple busses
+ io_canTx_init(canTransmit); // TODO this needs to be more sophisticated for multiple busses
io_canTx_enableMode(CAN_MODE_DEFAULT, true);
- io::can1queue.init();
app_canTx_init();
app_canRx_init();
// broadcast commit info
app_canTx_CRIT_Hash_set(GIT_COMMIT_HASH);
app_canTx_CRIT_Clean_set(GIT_COMMIT_CLEAN);
-
- app::StateMachine::init(&app::critstates::main_state);
}
void tasks_runCanTx()
{
- io::chimera::sleepTaskIfEnabled();
-
// Setup tasks.
for (;;)
{
- hw::can::CanMsg tx_msg = io::can1queue.popTxMsgFromQueue();
- if (const bool transmit_status = hw::can::can1.transmit(&tx_msg); !transmit_status)
- {
- // idk do something
- }
}
}
void tasks_runCanRx()
{
- io::chimera::sleepTaskIfEnabled();
-
// Setup tasks.
for (;;)
{
- hw::can::CanMsg rx_msg = io::can1queue.popRxMsgFromQueue();
-
JsonCanMsg jsoncan_rx_msg;
- io::jsoncan::copyFromCanMsg(&rx_msg, &jsoncan_rx_msg);
io_canRx_updateRxTableWithMessage(&jsoncan_rx_msg);
}
}
void tasks_run1Hz()
{
- io::chimera::sleepTaskIfEnabled();
-
// Setup tasks.
static const TickType_t period_ms = 1000U;
- hw::watchdog::WatchdogInstance run1HzWatchdog{ RTOS_TASK_1HZ, period_ms };
- hw::watchdog::monitor::registerWatchdogInstance(&run1HzWatchdog);
-
static uint32_t start_ticks = 0;
start_ticks = osKernelGetTickCount();
for (;;)
{
// hw_stackWaterMarkConfig_check();
- app::StateMachine::tick1Hz();
const bool debug_mode_enabled = app_canRx_Debug_EnableDebugMode_get();
io_canTx_enableMode(CAN_MODE_DEBUG, debug_mode_enabled);
io_canTx_enqueue1HzMsgs();
- // Watchdog check-in must be the last function called before putting the
- // task to sleep.
- run1HzWatchdog.checkIn();
-
start_ticks += period_ms;
osDelayUntil(start_ticks);
}
@@ -134,25 +86,15 @@ void tasks_run1Hz()
void tasks_run100Hz()
{
- io::chimera::sleepTaskIfEnabled();
-
// Setup tasks.
- static const TickType_t period_ms = 10;
- hw::watchdog::WatchdogInstance run100HzWatchdog{ RTOS_TASK_100HZ, period_ms };
- hw::watchdog::monitor::registerWatchdogInstance(&run100HzWatchdog);
+ static const TickType_t period_ms = 10;
static uint32_t start_ticks = 0;
start_ticks = osKernelGetTickCount();
for (;;)
{
- app::StateMachine::tick100Hz();
io_canTx_enqueue100HzMsgs();
-
- // Watchdog check-in must be the last function called before putting the
- // task to sleep.
- run100HzWatchdog.checkIn();
-
start_ticks += period_ms;
osDelayUntil(start_ticks);
}
@@ -160,14 +102,9 @@ void tasks_run100Hz()
void tasks_run1kHz()
{
- io::chimera::sleepTaskIfEnabled();
-
// Setup tasks.
static const TickType_t period_ms = 1;
- hw::watchdog::WatchdogInstance run1kHzWatchdog{ RTOS_TASK_1KHZ, period_ms };
- hw::watchdog::monitor::registerWatchdogInstance(&run1kHzWatchdog);
-
static uint32_t start_ticks = 0;
start_ticks = osKernelGetTickCount();
@@ -175,8 +112,6 @@ void tasks_run1kHz()
for (;;)
{
// Check in for timeouts for all RTOS tasks
- hw::watchdog::monitor::checkForTimeouts();
-
const uint32_t task_start_ms = TICK_TO_MS(osKernelGetTickCount());
io_canTx_enqueueOtherPeriodicMsgs(task_start_ms);
@@ -185,7 +120,6 @@ void tasks_run1kHz()
// equal to the period ms
if ((TICK_TO_MS(osKernelGetTickCount()) - task_start_ms) <= period_ms)
{
- run1kHzWatchdog.checkIn();
}
start_ticks += period_ms;
diff --git a/firmware/quintuna/CRIT/src/tasks.h b/firmware/quintuna/CRIT/src/tasks.h
index 82ed75cff4..86483591ef 100644
--- a/firmware/quintuna/CRIT/src/tasks.h
+++ b/firmware/quintuna/CRIT/src/tasks.h
@@ -1,20 +1,9 @@
#pragma once
-#ifdef __cplusplus
-#define EXTERNC extern "C"
-#define EXTERNCNORET extern "C" [[noreturn]]
-#else
-#define EXTERNC
-#define EXTERNCNORET _Noreturn
-#endif
-
-EXTERNC void tasks_preInit();
-EXTERNC void tasks_init();
-EXTERNCNORET void tasks_run1Hz();
-EXTERNCNORET void tasks_run100Hz();
-EXTERNCNORET void tasks_run1kHz();
-EXTERNCNORET void tasks_runCanTx();
-EXTERNCNORET void tasks_runCanRx();
-
-#undef EXTERNC
-#undef EXTERNCNORET
\ No newline at end of file
+void tasks_preInit();
+void tasks_init();
+_Noreturn void tasks_run1Hz();
+_Noreturn void tasks_run100Hz();
+_Noreturn void tasks_run1kHz();
+_Noreturn void tasks_runCanTx();
+_Noreturn void tasks_runCanRx();
\ No newline at end of file
diff --git a/firmware/quintuna/RSM/CMakeLists.txt b/firmware/quintuna/RSM/CMakeLists.txt
index 2504b11102..069fe4688f 100644
--- a/firmware/quintuna/RSM/CMakeLists.txt
+++ b/firmware/quintuna/RSM/CMakeLists.txt
@@ -1,5 +1,5 @@
message("")
-message("⚙️ Configuring [BOARD] (Quintuna)")
+message("⚙️ Configuring RSM (Quintuna)")
set(ARM_CORE "cm4")
set(LINKER_SCRIPT "${LINKER_DIR}/stm32f412rgtx/stm32f412rgtx_app.ld")
@@ -90,17 +90,15 @@ if ("${TARGET}" STREQUAL "binary")
# JSONCAN
# JSONCAN
- jsoncan_embedded_library(RSM quintuna "${CMAKE_CURRENT_BINARY_DIR}" ${ARM_CORE})
+ jsoncan_embedded_library(RSM quintuna "${CMAKE_CURRENT_BINARY_DIR}")
# CommitInfo
commit_info_library(
"quintuna_RSM_app.elf"
"quintuna_RSM_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quintuna_RSM_jsoncan" PRIVATE "quintuna_RSM_stm32cube")
target_link_libraries("quintuna_RSM_app.elf" PRIVATE "quintuna_RSM_stm32cube" "quintuna_RSM_jsoncan" "quintuna_RSM_commit_info" "debug_modules")
target_link_libraries("quintuna_RSM_boot.elf" PRIVATE "quintuna_RSM_commit_info")
diff --git a/firmware/quintuna/RSM/boot/cubemx/Inc/stm32f4xx_hal_conf.h b/firmware/quintuna/RSM/boot/cubemx/Inc/stm32f4xx_hal_conf.h
index 94b320d3cb..9dd18a75e2 100644
--- a/firmware/quintuna/RSM/boot/cubemx/Inc/stm32f4xx_hal_conf.h
+++ b/firmware/quintuna/RSM/boot/cubemx/Inc/stm32f4xx_hal_conf.h
@@ -215,7 +215,7 @@ extern "C"
#define MAC_ADDR5 0U
/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE /* buffer size for receive */
+#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
diff --git a/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc b/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc
index 5857d77555..3efc1cad6e 100644
--- a/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc
+++ b/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc
@@ -52,8 +52,8 @@ Mcu.PinsNb=16
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F412RGTx
-MxCube.Version=6.9.2
-MxDb.Version=DB.6.0.92
+MxCube.Version=6.12.0
+MxDb.Version=DB.6.0.120
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
@@ -124,7 +124,7 @@ ProjectManager.CustomerFirmwarePackage=
ProjectManager.DefaultFWLocation=true
ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32F412RGTx
-ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.27.1
+ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.28.1
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=0x00
diff --git a/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc.md5 b/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc.md5
index 3fb7958d79..46b63e8519 100644
--- a/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc.md5
+++ b/firmware/quintuna/RSM/boot/cubemx/RSM_boot.ioc.md5
@@ -1 +1 @@
-fda8fd7482f9ef8cf624b015350848a4
\ No newline at end of file
+519448abaa6d142e85e8682663562b52
\ No newline at end of file
diff --git a/firmware/quintuna/RSM/boot/cubemx/Src/main.c b/firmware/quintuna/RSM/boot/cubemx/Src/main.c
index 38b6010e55..e7237510bf 100644
--- a/firmware/quintuna/RSM/boot/cubemx/Src/main.c
+++ b/firmware/quintuna/RSM/boot/cubemx/Src/main.c
@@ -179,6 +179,7 @@ int main(void)
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
+
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
diff --git a/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_msp.c b/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_msp.c
index 5c8584b1af..ba633f0e89 100644
--- a/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_msp.c
+++ b/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_msp.c
@@ -1,3 +1,4 @@
+
/* USER CODE BEGIN Header */
/**
******************************************************************************
@@ -20,7 +21,6 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
-
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
diff --git a/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c b/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c
index be3c277012..54044da3b8 100644
--- a/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c
+++ b/firmware/quintuna/RSM/boot/cubemx/Src/stm32f4xx_hal_timebase_tim.c
@@ -49,10 +49,8 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
/* Enable TIM6 clock */
__HAL_RCC_TIM6_CLK_ENABLE();
-
/* Get clock configuration */
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
-
/* Get APB1 prescaler */
uwAPB1Prescaler = clkconfig.APB1CLKDivider;
/* Compute TIM6 clock */
diff --git a/firmware/quintuna/VC/CMakeLists.txt b/firmware/quintuna/VC/CMakeLists.txt
index 2fc33da51b..b99c53f4de 100644
--- a/firmware/quintuna/VC/CMakeLists.txt
+++ b/firmware/quintuna/VC/CMakeLists.txt
@@ -93,17 +93,15 @@ if ("${TARGET}" STREQUAL "binary")
)
# JSONCAN
- jsoncan_embedded_library(VC quintuna "${CMAKE_CURRENT_BINARY_DIR}" ${ARM_CORE})
+ jsoncan_embedded_library(VC quintuna "${CMAKE_CURRENT_BINARY_DIR}")
# CommitInfo
commit_info_library(
"quintuna_VC_app.elf"
"quintuna_VC_commit_info"
"${CMAKE_CURRENT_BINARY_DIR}/app"
- "${ARM_CORE}"
)
- target_link_libraries("quintuna_VC_jsoncan" PRIVATE "quintuna_VC_stm32cube")
target_link_libraries("quintuna_VC_app.elf" PRIVATE "quintuna_VC_stm32cube" "quintuna_VC_jsoncan" "quintuna_VC_commit_info" "debug_modules")
target_link_libraries("quintuna_VC_boot.elf" PRIVATE "quintuna_VC_commit_info")
@@ -114,6 +112,5 @@ if ("${TARGET}" STREQUAL "binary")
"quintuna_VC_boot.hex"
"${CMAKE_CURRENT_BINARY_DIR}/quintuna_VC_boot.hex"
)
-
elseif ("${TARGET}" STREQUAL "test")
endif ()
diff --git a/firmware/quintuna/VC/boot/cubemx/Inc/FreeRTOSConfig.h b/firmware/quintuna/VC/boot/cubemx/Inc/FreeRTOSConfig.h
new file mode 100644
index 0000000000..201289b8e9
--- /dev/null
+++ b/firmware/quintuna/VC/boot/cubemx/Inc/FreeRTOSConfig.h
@@ -0,0 +1,181 @@
+/* USER CODE BEGIN Header */
+/*
+ * FreeRTOS Kernel V10.3.1
+ * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved.
+ *
+ * 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.
+ *
+ * http://www.FreeRTOS.org
+ * http://aws.amazon.com/freertos
+ *
+ * 1 tab == 4 spaces!
+ */
+/* USER CODE END Header */
+
+#ifndef FREERTOS_CONFIG_H
+#define FREERTOS_CONFIG_H
+
+/*-----------------------------------------------------------
+ * Application specific definitions.
+ *
+ * These definitions should be adjusted for your particular hardware and
+ * application requirements.
+ *
+ * These parameters and more are described within the 'configuration' section of the
+ * FreeRTOS API documentation available on the FreeRTOS.org web site.
+ *
+ * See http://www.freertos.org/a00110.html
+ *----------------------------------------------------------*/
+
+/* USER CODE BEGIN Includes */
+/* Section where include file can be added */
+/* USER CODE END Includes */
+
+/* Ensure definitions are only used by the compiler, and not by the assembler. */
+#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
+#include
+extern uint32_t SystemCoreClock;
+#endif
+#ifndef CMSIS_device_header
+#define CMSIS_device_header "stm32h7xx.h"
+#endif /* CMSIS_device_header */
+
+#define configENABLE_FPU 0
+#define configENABLE_MPU 0
+
+#define configUSE_PREEMPTION 1
+#define configSUPPORT_STATIC_ALLOCATION 1
+#define configSUPPORT_DYNAMIC_ALLOCATION 1
+#define configUSE_IDLE_HOOK 0
+#define configUSE_TICK_HOOK 0
+#define configCPU_CLOCK_HZ (SystemCoreClock)
+#define configTICK_RATE_HZ ((TickType_t)1000)
+#define configMAX_PRIORITIES (56)
+#define configMINIMAL_STACK_SIZE ((uint16_t)128)
+#define configTOTAL_HEAP_SIZE ((size_t)15360)
+#define configMAX_TASK_NAME_LEN (16)
+#define configUSE_TRACE_FACILITY 1
+#define configUSE_16_BIT_TICKS 0
+#define configUSE_MUTEXES 1
+#define configQUEUE_REGISTRY_SIZE 8
+#define configUSE_RECURSIVE_MUTEXES 1
+#define configUSE_COUNTING_SEMAPHORES 1
+#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
+/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */
+/* Defaults to size_t for backward compatibility, but can be changed
+ if lengths will always be less than the number of bytes in a size_t. */
+#define configMESSAGE_BUFFER_LENGTH_TYPE size_t
+/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */
+
+/* Co-routine definitions. */
+#define configUSE_CO_ROUTINES 0
+#define configMAX_CO_ROUTINE_PRIORITIES (2)
+
+/* Software timer definitions. */
+#define configUSE_TIMERS 1
+#define configTIMER_TASK_PRIORITY (2)
+#define configTIMER_QUEUE_LENGTH 10
+#define configTIMER_TASK_STACK_DEPTH 256
+
+/* The following flag must be enabled only when using newlib */
+#define configUSE_NEWLIB_REENTRANT 1
+
+/* CMSIS-RTOS V2 flags */
+#define configUSE_OS2_THREAD_SUSPEND_RESUME 1
+#define configUSE_OS2_THREAD_ENUMERATE 1
+#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1
+#define configUSE_OS2_THREAD_FLAGS 1
+#define configUSE_OS2_TIMER 1
+#define configUSE_OS2_MUTEX 1
+
+/* Set the following definitions to 1 to include the API function, or zero
+to exclude the API function. */
+#define INCLUDE_vTaskPrioritySet 1
+#define INCLUDE_uxTaskPriorityGet 1
+#define INCLUDE_vTaskDelete 1
+#define INCLUDE_vTaskCleanUpResources 0
+#define INCLUDE_vTaskSuspend 1
+#define INCLUDE_vTaskDelayUntil 1
+#define INCLUDE_vTaskDelay 1
+#define INCLUDE_xTaskGetSchedulerState 1
+#define INCLUDE_xTimerPendFunctionCall 1
+#define INCLUDE_xQueueGetMutexHolder 1
+#define INCLUDE_uxTaskGetStackHighWaterMark 1
+#define INCLUDE_xTaskGetCurrentTaskHandle 1
+#define INCLUDE_eTaskGetState 1
+
+/*
+ * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used
+ * by the application thus the correct define need to be enabled below
+ */
+#define USE_FreeRTOS_HEAP_4
+
+/* Cortex-M specific definitions. */
+#ifdef __NVIC_PRIO_BITS
+/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
+#define configPRIO_BITS __NVIC_PRIO_BITS
+#else
+#define configPRIO_BITS 4
+#endif
+
+/* The lowest interrupt priority that can be used in a call to a "set priority"
+function. */
+#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
+
+/* The highest interrupt priority that can be used by any interrupt service
+routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
+INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
+PRIORITY THAN THIS! (higher priorities are lower numeric values. */
+#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
+
+/* Interrupt priorities used by the kernel port layer itself. These are generic
+to all Cortex-M ports, and do not rely on any particular library functions. */
+#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
+/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
+See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
+#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
+
+/* Normal assert() semantics without relying on the provision of an assert.h
+header file. */
+/* USER CODE BEGIN 1 */
+#define configASSERT(x) \
+ if ((x) == 0) \
+ { \
+ taskDISABLE_INTERRUPTS(); \
+ for (;;) \
+ ; \
+ }
+/* USER CODE END 1 */
+
+/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
+standard names. */
+#define vPortSVCHandler SVC_Handler
+#define xPortPendSVHandler PendSV_Handler
+
+/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from
+ * cmsis_os2.c */
+
+#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 0
+
+/* USER CODE BEGIN Defines */
+/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
+#include "sysviewFreeRTOSConfigs.h"
+/* USER CODE END Defines */
+
+#endif /* FREERTOS_CONFIG_H */
diff --git a/firmware/quintuna/VC/boot/cubemx/Inc/main.h b/firmware/quintuna/VC/boot/cubemx/Inc/main.h
index 6fe60cc779..bd29762573 100644
--- a/firmware/quintuna/VC/boot/cubemx/Inc/main.h
+++ b/firmware/quintuna/VC/boot/cubemx/Inc/main.h
@@ -53,11 +53,45 @@ extern "C"
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
- /* USER CODE BEGIN EFP */
-
- /* USER CODE END EFP */
-
- /* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+#define INV_R_PWR_EN_Pin GPIO_PIN_2
+#define INV_R_PWR_EN_GPIO_Port GPIOE
+#define INV_R_PROGRA_Pin GPIO_PIN_3
+#define INV_R_PROGRA_GPIO_Port GPIOE
+#define INV_L_PROGR_Pin GPIO_PIN_4
+#define INV_L_PROGR_GPIO_Port GPIOE
+#define SHDN_PWR_EN_Pin GPIO_PIN_6
+#define SHDN_PWR_EN_GPIO_Port GPIOE
+#define FR_STBY3_Pin GPIO_PIN_13
+#define FR_STBY3_GPIO_Port GPIOC
+#define LV_PWR_EN_Pin GPIO_PIN_14
+#define LV_PWR_EN_GPIO_Port GPIOC
+#define BUZZER_PWR_EN_Pin GPIO_PIN_0
+#define BUZZER_PWR_EN_GPIO_Port GPIOA
+#define LED_Pin GPIO_PIN_3
+#define LED_GPIO_Port GPIOA
+#define nPCM_EN_Pin GPIO_PIN_12
+#define nPCM_EN_GPIO_Port GPIOB
+#define PUMP_PWR_E_Pin GPIO_PIN_10
+#define PUMP_PWR_E_GPIO_Port GPIOD
+#define _900K_GPI_Pin GPIO_PIN_13
+#define _900K_GPI_GPIO_Port GPIOD
+#define FR_STBY2_Pin GPIO_PIN_7
+#define FR_STBY2_GPIO_Port GPIOC
+#define TELEM_PWR_EN_Pin GPIO_PIN_15
+#define TELEM_PWR_EN_GPIO_Port GPIOA
+#define AUX_PWR_EN_Pin GPIO_PIN_1
+#define AUX_PWR_EN_GPIO_Port GPIOD
+#define nBOOT_EN_Pin GPIO_PIN_5
+#define nBOOT_EN_GPIO_Port GPIOB
+#define INV_L_PWR_EN_Pin GPIO_PIN_0
+#define INV_L_PWR_EN_GPIO_Port GPIOE
+#define FR_STBY3E1_Pin GPIO_PIN_1
+#define FR_STBY3E1_GPIO_Port GPIOE
/* USER CODE BEGIN Private defines */
diff --git a/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_hal_conf.h b/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_hal_conf.h
index 90ee9705b6..eee6a8bd23 100644
--- a/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_hal_conf.h
+++ b/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_hal_conf.h
@@ -36,12 +36,12 @@ extern "C"
#define HAL_MODULE_ENABLED
/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_FDCAN_MODULE_ENABLED */
+#define HAL_FDCAN_MODULE_ENABLED
/* #define HAL_FMAC_MODULE_ENABLED */
/* #define HAL_CEC_MODULE_ENABLED */
/* #define HAL_COMP_MODULE_ENABLED */
/* #define HAL_CORDIC_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
+#define HAL_CRC_MODULE_ENABLED
/* #define HAL_CRYP_MODULE_ENABLED */
/* #define HAL_DAC_MODULE_ENABLED */
/* #define HAL_DCMI_MODULE_ENABLED */
@@ -60,13 +60,13 @@ extern "C"
/* #define HAL_JPEG_MODULE_ENABLED */
/* #define HAL_OPAMP_MODULE_ENABLED */
/* #define HAL_OSPI_MODULE_ENABLED */
-/* #define HAL_OSPI_MODULE_ENABLED */
+/* #define HAL_XSPI_MODULE_ENABLED */
/* #define HAL_I2S_MODULE_ENABLED */
/* #define HAL_SMBUS_MODULE_ENABLED */
/* #define HAL_IWDG_MODULE_ENABLED */
/* #define HAL_LPTIM_MODULE_ENABLED */
/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_QSPI_MODULE_ENABLED */
+/* #define HAL_XSPI_MODULE_ENABLED */
/* #define HAL_RAMECC_MODULE_ENABLED */
/* #define HAL_RNG_MODULE_ENABLED */
/* #define HAL_RTC_MODULE_ENABLED */
@@ -76,7 +76,7 @@ extern "C"
/* #define HAL_SPDIFRX_MODULE_ENABLED */
/* #define HAL_SPI_MODULE_ENABLED */
/* #define HAL_SWPMI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
+#define HAL_TIM_MODULE_ENABLED
/* #define HAL_UART_MODULE_ENABLED */
/* #define HAL_USART_MODULE_ENABLED */
/* #define HAL_IRDA_MODULE_ENABLED */
@@ -108,8 +108,8 @@ extern "C"
* (when HSE is used as system clock source, directly or through the PLL).
*/
#if !defined(HSE_VALUE)
-#define HSE_VALUE (25000000UL) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */
-#endif /* HSE_VALUE */
+#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */
+#endif /* HSE_VALUE */
#if !defined(HSE_STARTUP_TIMEOUT)
#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */
diff --git a/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_it.h b/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_it.h
index e9b3710dbc..e3659d6010 100644
--- a/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_it.h
+++ b/firmware/quintuna/VC/boot/cubemx/Inc/stm32h7xx_it.h
@@ -52,10 +52,10 @@ extern "C"
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
- void SVC_Handler(void);
void DebugMon_Handler(void);
- void PendSV_Handler(void);
- void SysTick_Handler(void);
+ void FDCAN1_IT0_IRQHandler(void);
+ void FDCAN1_IT1_IRQHandler(void);
+ void TIM6_DAC_IRQHandler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
diff --git a/firmware/quintuna/VC/boot/cubemx/Src/freertos.c b/firmware/quintuna/VC/boot/cubemx/Src/freertos.c
new file mode 100644
index 0000000000..cebc8425fa
--- /dev/null
+++ b/firmware/quintuna/VC/boot/cubemx/Src/freertos.c
@@ -0,0 +1,58 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : freertos.c
+ * Description : Code for freertos applications
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "FreeRTOS.h"
+#include "task.h"
+#include "main.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Variables */
+
+/* USER CODE END Variables */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN FunctionPrototypes */
+
+/* USER CODE END FunctionPrototypes */
+
+/* Private application code --------------------------------------------------*/
+/* USER CODE BEGIN Application */
+
+/* USER CODE END Application */
diff --git a/firmware/quintuna/VC/boot/cubemx/Src/main.c b/firmware/quintuna/VC/boot/cubemx/Src/main.c
index 9c4bae9c13..570e6fe9be 100644
--- a/firmware/quintuna/VC/boot/cubemx/Src/main.c
+++ b/firmware/quintuna/VC/boot/cubemx/Src/main.c
@@ -18,6 +18,7 @@
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
+#include "cmsis_os.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -25,6 +26,7 @@
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
+typedef StaticTask_t osStaticThreadDef_t;
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
@@ -41,12 +43,59 @@
/* Private variables ---------------------------------------------------------*/
+CRC_HandleTypeDef hcrc;
+
+FDCAN_HandleTypeDef hfdcan1;
+
+/* Definitions for interfaceTask */
+osThreadId_t interfaceTaskHandle;
+uint32_t interfaceTaskBuffer[512];
+osStaticThreadDef_t interfaceTaskControlBlock;
+const osThreadAttr_t interfaceTask_attributes = {
+ .name = "interfaceTask",
+ .cb_mem = &interfaceTaskControlBlock,
+ .cb_size = sizeof(interfaceTaskControlBlock),
+ .stack_mem = &interfaceTaskBuffer[0],
+ .stack_size = sizeof(interfaceTaskBuffer),
+ .priority = (osPriority_t)osPriorityAboveNormal,
+};
+/* Definitions for tickTask */
+osThreadId_t tickTaskHandle;
+uint32_t tickTaskBuffer[512];
+osStaticThreadDef_t tickTaskControlBlock;
+const osThreadAttr_t tickTask_attributes = {
+ .name = "tickTask",
+ .cb_mem = &tickTaskControlBlock,
+ .cb_size = sizeof(tickTaskControlBlock),
+ .stack_mem = &tickTaskBuffer[0],
+ .stack_size = sizeof(tickTaskBuffer),
+ .priority = (osPriority_t)osPriorityNormal,
+};
+/* Definitions for canTxTask */
+osThreadId_t canTxTaskHandle;
+uint32_t canTxTaskBuffer[512];
+osStaticThreadDef_t canTxTaskControlBlock;
+const osThreadAttr_t canTxTask_attributes = {
+ .name = "canTxTask",
+ .cb_mem = &canTxTaskControlBlock,
+ .cb_size = sizeof(canTxTaskControlBlock),
+ .stack_mem = &canTxTaskBuffer[0],
+ .stack_size = sizeof(canTxTaskBuffer),
+ .priority = (osPriority_t)osPriorityBelowNormal,
+};
/* USER CODE BEGIN PV */
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
-void SystemClock_Config(void);
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_CRC_Init(void);
+static void MX_FDCAN1_Init(void);
+void runInterfaceTask(void *argument);
+void runTickTask(void *argument);
+void runCanTxTask(void *argument);
+
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
@@ -83,10 +132,55 @@ int main(void)
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_CRC_Init();
+ MX_FDCAN1_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+ /* Init scheduler */
+ osKernelInitialize();
+
+ /* USER CODE BEGIN RTOS_MUTEX */
+ /* add mutexes, ... */
+ /* USER CODE END RTOS_MUTEX */
+
+ /* USER CODE BEGIN RTOS_SEMAPHORES */
+ /* add semaphores, ... */
+ /* USER CODE END RTOS_SEMAPHORES */
+
+ /* USER CODE BEGIN RTOS_TIMERS */
+ /* start timers, add new ones, ... */
+ /* USER CODE END RTOS_TIMERS */
+
+ /* USER CODE BEGIN RTOS_QUEUES */
+ /* add queues, ... */
+ /* USER CODE END RTOS_QUEUES */
+
+ /* Create the thread(s) */
+ /* creation of interfaceTask */
+ interfaceTaskHandle = osThreadNew(runInterfaceTask, NULL, &interfaceTask_attributes);
+
+ /* creation of tickTask */
+ tickTaskHandle = osThreadNew(runTickTask, NULL, &tickTask_attributes);
+
+ /* creation of canTxTask */
+ canTxTaskHandle = osThreadNew(runCanTxTask, NULL, &canTxTask_attributes);
+
+ /* USER CODE BEGIN RTOS_THREADS */
+ /* add threads, ... */
+ /* USER CODE END RTOS_THREADS */
+
+ /* USER CODE BEGIN RTOS_EVENTS */
+ /* add events, ... */
+ /* USER CODE END RTOS_EVENTS */
+
+ /* Start scheduler */
+ osKernelStart();
+
+ /* We should never get here as control is now taken by the scheduler */
+
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
@@ -122,10 +216,18 @@ void SystemClock_Config(void)
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
- RCC_OscInitStruct.HSIState = RCC_HSI_DIV1;
- RCC_OscInitStruct.HSICalibrationValue = 64;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
+ RCC_OscInitStruct.PLL.PLLM = 1;
+ RCC_OscInitStruct.PLL.PLLN = 24;
+ RCC_OscInitStruct.PLL.PLLP = 1;
+ RCC_OscInitStruct.PLL.PLLQ = 4;
+ RCC_OscInitStruct.PLL.PLLR = 2;
+ RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_3;
+ RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
+ RCC_OscInitStruct.PLL.PLLFRACN = 0;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
@@ -135,13 +237,13 @@ void SystemClock_Config(void)
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 |
RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_D3PCLK1 | RCC_CLOCKTYPE_D1PCLK1;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
- RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV1;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV1;
- RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV1;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV2;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
+ RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
+ RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
{
@@ -149,10 +251,250 @@ void SystemClock_Config(void)
}
}
+/**
+ * @brief CRC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_CRC_Init(void)
+{
+ /* USER CODE BEGIN CRC_Init 0 */
+
+ /* USER CODE END CRC_Init 0 */
+
+ /* USER CODE BEGIN CRC_Init 1 */
+
+ /* USER CODE END CRC_Init 1 */
+ hcrc.Instance = CRC;
+ hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
+ hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
+ hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
+ hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
+ hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_WORDS;
+ if (HAL_CRC_Init(&hcrc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN CRC_Init 2 */
+
+ /* USER CODE END CRC_Init 2 */
+}
+
+/**
+ * @brief FDCAN1 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_FDCAN1_Init(void)
+{
+ /* USER CODE BEGIN FDCAN1_Init 0 */
+
+ /* USER CODE END FDCAN1_Init 0 */
+
+ /* USER CODE BEGIN FDCAN1_Init 1 */
+
+ /* USER CODE END FDCAN1_Init 1 */
+ hfdcan1.Instance = FDCAN1;
+ hfdcan1.Init.FrameFormat = FDCAN_FRAME_CLASSIC;
+ hfdcan1.Init.Mode = FDCAN_MODE_NORMAL;
+ hfdcan1.Init.AutoRetransmission = ENABLE;
+ hfdcan1.Init.TransmitPause = DISABLE;
+ hfdcan1.Init.ProtocolException = DISABLE;
+ hfdcan1.Init.NominalPrescaler = 6;
+ hfdcan1.Init.NominalSyncJumpWidth = 4;
+ hfdcan1.Init.NominalTimeSeg1 = 13;
+ hfdcan1.Init.NominalTimeSeg2 = 2;
+ hfdcan1.Init.DataPrescaler = 1;
+ hfdcan1.Init.DataSyncJumpWidth = 1;
+ hfdcan1.Init.DataTimeSeg1 = 1;
+ hfdcan1.Init.DataTimeSeg2 = 1;
+ hfdcan1.Init.MessageRAMOffset = 0;
+ hfdcan1.Init.StdFiltersNbr = 1;
+ hfdcan1.Init.ExtFiltersNbr = 0;
+ hfdcan1.Init.RxFifo0ElmtsNbr = 1;
+ hfdcan1.Init.RxFifo0ElmtSize = FDCAN_DATA_BYTES_8;
+ hfdcan1.Init.RxFifo1ElmtsNbr = 0;
+ hfdcan1.Init.RxFifo1ElmtSize = FDCAN_DATA_BYTES_8;
+ hfdcan1.Init.RxBuffersNbr = 0;
+ hfdcan1.Init.RxBufferSize = FDCAN_DATA_BYTES_8;
+ hfdcan1.Init.TxEventsNbr = 0;
+ hfdcan1.Init.TxBuffersNbr = 0;
+ hfdcan1.Init.TxFifoQueueElmtsNbr = 1;
+ hfdcan1.Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
+ hfdcan1.Init.TxElmtSize = FDCAN_DATA_BYTES_8;
+ if (HAL_FDCAN_Init(&hfdcan1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN FDCAN1_Init 2 */
+
+ /* USER CODE END FDCAN1_Init 2 */
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = { 0 };
+ /* USER CODE BEGIN MX_GPIO_Init_1 */
+ /* USER CODE END MX_GPIO_Init_1 */
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOE_CLK_ENABLE();
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOH_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(
+ GPIOE,
+ INV_R_PWR_EN_Pin | INV_R_PROGRA_Pin | INV_L_PROGR_Pin | SHDN_PWR_EN_Pin | INV_L_PWR_EN_Pin | FR_STBY3E1_Pin,
+ GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOC, FR_STBY3_Pin | LV_PWR_EN_Pin | FR_STBY2_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOA, BUZZER_PWR_EN_Pin | LED_Pin | TELEM_PWR_EN_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(nPCM_EN_GPIO_Port, nPCM_EN_Pin, GPIO_PIN_SET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOD, PUMP_PWR_E_Pin | _900K_GPI_Pin | AUX_PWR_EN_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pins : INV_R_PWR_EN_Pin INV_R_PROGRA_Pin INV_L_PROGR_Pin SHDN_PWR_EN_Pin
+ INV_L_PWR_EN_Pin FR_STBY3E1_Pin */
+ GPIO_InitStruct.Pin =
+ INV_R_PWR_EN_Pin | INV_R_PROGRA_Pin | INV_L_PROGR_Pin | SHDN_PWR_EN_Pin | INV_L_PWR_EN_Pin | FR_STBY3E1_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
+
+ /*Configure GPIO pins : FR_STBY3_Pin LV_PWR_EN_Pin FR_STBY2_Pin */
+ GPIO_InitStruct.Pin = FR_STBY3_Pin | LV_PWR_EN_Pin | FR_STBY2_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+
+ /*Configure GPIO pins : BUZZER_PWR_EN_Pin LED_Pin TELEM_PWR_EN_Pin */
+ GPIO_InitStruct.Pin = BUZZER_PWR_EN_Pin | LED_Pin | TELEM_PWR_EN_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : nPCM_EN_Pin */
+ GPIO_InitStruct.Pin = nPCM_EN_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(nPCM_EN_GPIO_Port, &GPIO_InitStruct);
+
+ /*Configure GPIO pins : PUMP_PWR_E_Pin _900K_GPI_Pin AUX_PWR_EN_Pin */
+ GPIO_InitStruct.Pin = PUMP_PWR_E_Pin | _900K_GPI_Pin | AUX_PWR_EN_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : nBOOT_EN_Pin */
+ GPIO_InitStruct.Pin = nBOOT_EN_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ HAL_GPIO_Init(nBOOT_EN_GPIO_Port, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN MX_GPIO_Init_2 */
+ /* USER CODE END MX_GPIO_Init_2 */
+}
+
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
+/* USER CODE BEGIN Header_runInterfaceTask */
+/**
+ * @brief Function implementing the interfaceTask thread.
+ * @param argument: Not used
+ * @retval None
+ */
+/* USER CODE END Header_runInterfaceTask */
+void runInterfaceTask(void *argument)
+{
+ /* USER CODE BEGIN 5 */
+ /* Infinite loop */
+ for (;;)
+ {
+ osDelay(1);
+ }
+ /* USER CODE END 5 */
+}
+
+/* USER CODE BEGIN Header_runTickTask */
+/**
+ * @brief Function implementing the tickTask thread.
+ * @param argument: Not used
+ * @retval None
+ */
+/* USER CODE END Header_runTickTask */
+void runTickTask(void *argument)
+{
+ /* USER CODE BEGIN runTickTask */
+ /* Infinite loop */
+ for (;;)
+ {
+ osDelay(1);
+ }
+ /* USER CODE END runTickTask */
+}
+
+/* USER CODE BEGIN Header_runCanTxTask */
+/**
+ * @brief Function implementing the canTxTask thread.
+ * @param argument: Not used
+ * @retval None
+ */
+/* USER CODE END Header_runCanTxTask */
+void runCanTxTask(void *argument)
+{
+ /* USER CODE BEGIN runCanTxTask */
+ /* Infinite loop */
+ for (;;)
+ {
+ osDelay(1);
+ }
+ /* USER CODE END runCanTxTask */
+}
+
+/**
+ * @brief Period elapsed callback in non blocking mode
+ * @note This function is called when TIM6 interrupt took place, inside
+ * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
+ * a global variable "uwTick" used as application time base.
+ * @param htim : TIM handle
+ * @retval None
+ */
+void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
+{
+ /* USER CODE BEGIN Callback 0 */
+
+ /* USER CODE END Callback 0 */
+ if (htim->Instance == TIM6)
+ {
+ HAL_IncTick();
+ }
+ /* USER CODE BEGIN Callback 1 */
+
+ /* USER CODE END Callback 1 */
+}
+
/**
* @brief This function is executed in case of error occurrence.
* @retval None
diff --git a/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_msp.c b/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_msp.c
index e950a3c785..4612b9ad8d 100644
--- a/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_msp.c
+++ b/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_msp.c
@@ -1,3 +1,4 @@
+
/* USER CODE BEGIN Header */
/**
******************************************************************************
@@ -20,7 +21,6 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
-
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -70,12 +70,138 @@ void HAL_MspInit(void)
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* System interrupt init*/
+ /* PendSV_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
+/**
+ * @brief CRC MSP Initialization
+ * This function configures the hardware resources used in this example
+ * @param hcrc: CRC handle pointer
+ * @retval None
+ */
+void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc)
+{
+ if (hcrc->Instance == CRC)
+ {
+ /* USER CODE BEGIN CRC_MspInit 0 */
+
+ /* USER CODE END CRC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_CRC_CLK_ENABLE();
+ /* USER CODE BEGIN CRC_MspInit 1 */
+
+ /* USER CODE END CRC_MspInit 1 */
+ }
+}
+
+/**
+ * @brief CRC MSP De-Initialization
+ * This function freeze the hardware resources used in this example
+ * @param hcrc: CRC handle pointer
+ * @retval None
+ */
+void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc)
+{
+ if (hcrc->Instance == CRC)
+ {
+ /* USER CODE BEGIN CRC_MspDeInit 0 */
+
+ /* USER CODE END CRC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_CRC_CLK_DISABLE();
+ /* USER CODE BEGIN CRC_MspDeInit 1 */
+
+ /* USER CODE END CRC_MspDeInit 1 */
+ }
+}
+
+/**
+ * @brief FDCAN MSP Initialization
+ * This function configures the hardware resources used in this example
+ * @param hfdcan: FDCAN handle pointer
+ * @retval None
+ */
+void HAL_FDCAN_MspInit(FDCAN_HandleTypeDef *hfdcan)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = { 0 };
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ if (hfdcan->Instance == FDCAN1)
+ {
+ /* USER CODE BEGIN FDCAN1_MspInit 0 */
+
+ /* USER CODE END FDCAN1_MspInit 0 */
+
+ /** Initializes the peripherals clock
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_FDCAN;
+ PeriphClkInitStruct.FdcanClockSelection = RCC_FDCANCLKSOURCE_PLL;
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ /* Peripheral clock enable */
+ __HAL_RCC_FDCAN_CLK_ENABLE();
+
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**FDCAN1 GPIO Configuration
+ PB8 ------> FDCAN1_RX
+ PB9 ------> FDCAN1_TX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_9;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF9_FDCAN1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* FDCAN1 interrupt Init */
+ HAL_NVIC_SetPriority(FDCAN1_IT0_IRQn, 5, 0);
+ HAL_NVIC_EnableIRQ(FDCAN1_IT0_IRQn);
+ HAL_NVIC_SetPriority(FDCAN1_IT1_IRQn, 5, 0);
+ HAL_NVIC_EnableIRQ(FDCAN1_IT1_IRQn);
+ /* USER CODE BEGIN FDCAN1_MspInit 1 */
+
+ /* USER CODE END FDCAN1_MspInit 1 */
+ }
+}
+
+/**
+ * @brief FDCAN MSP De-Initialization
+ * This function freeze the hardware resources used in this example
+ * @param hfdcan: FDCAN handle pointer
+ * @retval None
+ */
+void HAL_FDCAN_MspDeInit(FDCAN_HandleTypeDef *hfdcan)
+{
+ if (hfdcan->Instance == FDCAN1)
+ {
+ /* USER CODE BEGIN FDCAN1_MspDeInit 0 */
+
+ /* USER CODE END FDCAN1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_FDCAN_CLK_DISABLE();
+
+ /**FDCAN1 GPIO Configuration
+ PB8 ------> FDCAN1_RX
+ PB9 ------> FDCAN1_TX
+ */
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_8 | GPIO_PIN_9);
+
+ /* FDCAN1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(FDCAN1_IT0_IRQn);
+ HAL_NVIC_DisableIRQ(FDCAN1_IT1_IRQn);
+ /* USER CODE BEGIN FDCAN1_MspDeInit 1 */
+
+ /* USER CODE END FDCAN1_MspDeInit 1 */
+ }
+}
+
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
diff --git a/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_timebase_tim.c b/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_timebase_tim.c
new file mode 100644
index 0000000000..4c1227a0cc
--- /dev/null
+++ b/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_hal_timebase_tim.c
@@ -0,0 +1,128 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32h7xx_hal_timebase_tim.c
+ * @brief HAL time base based on the hardware TIM.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32h7xx_hal.h"
+#include "stm32h7xx_hal_tim.h"
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+TIM_HandleTypeDef htim6;
+/* Private function prototypes -----------------------------------------------*/
+/* Private functions ---------------------------------------------------------*/
+
+/**
+ * @brief This function configures the TIM6 as a time base source.
+ * The time source is configured to have 1ms time base with a dedicated
+ * Tick interrupt priority.
+ * @note This function is called automatically at the beginning of program after
+ * reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
+ * @param TickPriority: Tick interrupt priority.
+ * @retval HAL status
+ */
+HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
+{
+ RCC_ClkInitTypeDef clkconfig;
+ uint32_t uwTimclock, uwAPB1Prescaler;
+
+ uint32_t uwPrescalerValue;
+ uint32_t pFLatency;
+ /*Configure the TIM6 IRQ priority */
+ if (TickPriority < (1UL << __NVIC_PRIO_BITS))
+ {
+ HAL_NVIC_SetPriority(TIM6_DAC_IRQn, TickPriority, 0);
+
+ /* Enable the TIM6 global Interrupt */
+ HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
+ uwTickPrio = TickPriority;
+ }
+ else
+ {
+ return HAL_ERROR;
+ }
+
+ /* Enable TIM6 clock */
+ __HAL_RCC_TIM6_CLK_ENABLE();
+ /* Get clock configuration */
+ HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
+ /* Get APB1 prescaler */
+ uwAPB1Prescaler = clkconfig.APB1CLKDivider;
+ /* Compute TIM6 clock */
+ if (uwAPB1Prescaler == RCC_HCLK_DIV1)
+ {
+ uwTimclock = HAL_RCC_GetPCLK1Freq();
+ }
+ else
+ {
+ uwTimclock = 2UL * HAL_RCC_GetPCLK1Freq();
+ }
+
+ /* Compute the prescaler value to have TIM6 counter clock equal to 1MHz */
+ uwPrescalerValue = (uint32_t)((uwTimclock / 1000000U) - 1U);
+
+ /* Initialize TIM6 */
+ htim6.Instance = TIM6;
+
+ /* Initialize TIMx peripheral as follow:
+
+ + Period = [(TIM6CLK/1000) - 1]. to have a (1/1000) s time base.
+ + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
+ + ClockDivision = 0
+ + Counter direction = Up
+ */
+ htim6.Init.Period = (1000000U / 1000U) - 1U;
+ htim6.Init.Prescaler = uwPrescalerValue;
+ htim6.Init.ClockDivision = 0;
+ htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
+
+ if (HAL_TIM_Base_Init(&htim6) == HAL_OK)
+ {
+ /* Start the TIM time Base generation in interrupt mode */
+ return HAL_TIM_Base_Start_IT(&htim6);
+ }
+
+ /* Return function status */
+ return HAL_ERROR;
+}
+
+/**
+ * @brief Suspend Tick increment.
+ * @note Disable the tick increment by disabling TIM6 update interrupt.
+ * @param None
+ * @retval None
+ */
+void HAL_SuspendTick(void)
+{
+ /* Disable TIM6 update Interrupt */
+ __HAL_TIM_DISABLE_IT(&htim6, TIM_IT_UPDATE);
+}
+
+/**
+ * @brief Resume Tick increment.
+ * @note Enable the tick increment by Enabling TIM6 update interrupt.
+ * @param None
+ * @retval None
+ */
+void HAL_ResumeTick(void)
+{
+ /* Enable TIM6 Update interrupt */
+ __HAL_TIM_ENABLE_IT(&htim6, TIM_IT_UPDATE);
+}
diff --git a/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_it.c b/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_it.c
index 9a02274f17..d5aba36fe2 100644
--- a/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_it.c
+++ b/firmware/quintuna/VC/boot/cubemx/Src/stm32h7xx_it.c
@@ -55,6 +55,8 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
+extern FDCAN_HandleTypeDef hfdcan1;
+extern TIM_HandleTypeDef htim6;
/* USER CODE BEGIN EV */
@@ -138,19 +140,6 @@ void UsageFault_Handler(void)
}
}
-/**
- * @brief This function handles System service call via SWI instruction.
- */
-void SVC_Handler(void)
-{
- /* USER CODE BEGIN SVCall_IRQn 0 */
-
- /* USER CODE END SVCall_IRQn 0 */
- /* USER CODE BEGIN SVCall_IRQn 1 */
-
- /* USER CODE END SVCall_IRQn 1 */
-}
-
/**
* @brief This function handles Debug monitor.
*/
@@ -164,39 +153,54 @@ void DebugMon_Handler(void)
/* USER CODE END DebugMonitor_IRQn 1 */
}
+/******************************************************************************/
+/* STM32H7xx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32h7xx.s). */
+/******************************************************************************/
+
/**
- * @brief This function handles Pendable request for system service.
+ * @brief This function handles FDCAN1 interrupt 0.
*/
-void PendSV_Handler(void)
+void FDCAN1_IT0_IRQHandler(void)
{
- /* USER CODE BEGIN PendSV_IRQn 0 */
+ /* USER CODE BEGIN FDCAN1_IT0_IRQn 0 */
- /* USER CODE END PendSV_IRQn 0 */
- /* USER CODE BEGIN PendSV_IRQn 1 */
+ /* USER CODE END FDCAN1_IT0_IRQn 0 */
+ HAL_FDCAN_IRQHandler(&hfdcan1);
+ /* USER CODE BEGIN FDCAN1_IT0_IRQn 1 */
- /* USER CODE END PendSV_IRQn 1 */
+ /* USER CODE END FDCAN1_IT0_IRQn 1 */
}
/**
- * @brief This function handles System tick timer.
+ * @brief This function handles FDCAN1 interrupt 1.
*/
-void SysTick_Handler(void)
+void FDCAN1_IT1_IRQHandler(void)
{
- /* USER CODE BEGIN SysTick_IRQn 0 */
+ /* USER CODE BEGIN FDCAN1_IT1_IRQn 0 */
- /* USER CODE END SysTick_IRQn 0 */
- HAL_IncTick();
- /* USER CODE BEGIN SysTick_IRQn 1 */
+ /* USER CODE END FDCAN1_IT1_IRQn 0 */
+ HAL_FDCAN_IRQHandler(&hfdcan1);
+ /* USER CODE BEGIN FDCAN1_IT1_IRQn 1 */
- /* USER CODE END SysTick_IRQn 1 */
+ /* USER CODE END FDCAN1_IT1_IRQn 1 */
}
-/******************************************************************************/
-/* STM32H7xx Peripheral Interrupt Handlers */
-/* Add here the Interrupt Handlers for the used peripherals. */
-/* For the available peripheral interrupt handler names, */
-/* please refer to the startup file (startup_stm32h7xx.s). */
-/******************************************************************************/
+/**
+ * @brief This function handles TIM6 global interrupt, DAC1_CH1 and DAC1_CH2 underrun error interrupts.
+ */
+void TIM6_DAC_IRQHandler(void)
+{
+ /* USER CODE BEGIN TIM6_DAC_IRQn 0 */
+
+ /* USER CODE END TIM6_DAC_IRQn 0 */
+ HAL_TIM_IRQHandler(&htim6);
+ /* USER CODE BEGIN TIM6_DAC_IRQn 1 */
+
+ /* USER CODE END TIM6_DAC_IRQn 1 */
+}
/* USER CODE BEGIN 1 */
diff --git a/firmware/quintuna/VC/boot/cubemx/VC_boot.ioc b/firmware/quintuna/VC/boot/cubemx/VC_boot.ioc
index 49bbf319a5..0d37acbe57 100644
--- a/firmware/quintuna/VC/boot/cubemx/VC_boot.ioc
+++ b/firmware/quintuna/VC/boot/cubemx/VC_boot.ioc
@@ -2,36 +2,171 @@
CAD.formats=
CAD.pinconfig=
CAD.provider=
+CORTEX_M7.CPU_DCache=Disabled
+CORTEX_M7.CPU_ICache=Disabled
+CORTEX_M7.IPParameters=CPU_ICache,CPU_DCache
+CRC.IPParameters=InputDataFormat
+CRC.InputDataFormat=CRC_INPUTDATA_FORMAT_WORDS
+FDCAN1.AutoRetransmission=ENABLE
+FDCAN1.CalculateBaudRateNominal=500000
+FDCAN1.CalculateTimeBitNominal=2000
+FDCAN1.CalculateTimeQuantumNominal=125.0
+FDCAN1.IPParameters=CalculateTimeQuantumNominal,CalculateTimeBitNominal,CalculateBaudRateNominal,AutoRetransmission,StdFiltersNbr,RxFifo1ElmtsNbr,TxFifoQueueElmtsNbr,NominalPrescaler,NominalTimeSeg1,NominalSyncJumpWidth,RxFifo0ElmtsNbr
+FDCAN1.NominalPrescaler=6
+FDCAN1.NominalSyncJumpWidth=4
+FDCAN1.NominalTimeSeg1=13
+FDCAN1.RxFifo0ElmtsNbr=1
+FDCAN1.RxFifo1ElmtsNbr=0
+FDCAN1.StdFiltersNbr=1
+FDCAN1.TxFifoQueueElmtsNbr=1
+FREERTOS.FootprintOK=true
+FREERTOS.IPParameters=Tasks01,configUSE_NEWLIB_REENTRANT,FootprintOK
+FREERTOS.Tasks01=interfaceTask,32,512,runInterfaceTask,Default,NULL,Static,interfaceTaskBuffer,interfaceTaskControlBlock;tickTask,24,512,runTickTask,Default,NULL,Static,tickTaskBuffer,tickTaskControlBlock;canTxTask,16,512,runCanTxTask,Default,NULL,Static,canTxTaskBuffer,canTxTaskControlBlock
+FREERTOS.configUSE_NEWLIB_REENTRANT=1
File.Version=6
-GPIO.groupedBy=
+GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false
Mcu.CPN=STM32H733VGT6
Mcu.Family=STM32H7
Mcu.IP0=CORTEX_M7
-Mcu.IP1=NVIC
-Mcu.IP2=RCC
-Mcu.IP3=SYS
-Mcu.IPNb=4
+Mcu.IP1=CRC
+Mcu.IP2=FDCAN1
+Mcu.IP3=FREERTOS
+Mcu.IP4=NVIC
+Mcu.IP5=RCC
+Mcu.IP6=SYS
+Mcu.IPNb=7
Mcu.Name=STM32H733VGTx
Mcu.Package=LQFP100
-Mcu.Pin0=VP_SYS_VS_Systick
-Mcu.PinsNb=1
+Mcu.Pin0=PE2
+Mcu.Pin1=PE3
+Mcu.Pin10=PB12
+Mcu.Pin11=PD10
+Mcu.Pin12=PD13
+Mcu.Pin13=PC7
+Mcu.Pin14=PA15(JTDI)
+Mcu.Pin15=PD1
+Mcu.Pin16=PB5
+Mcu.Pin17=PB8
+Mcu.Pin18=PB9
+Mcu.Pin19=PE0
+Mcu.Pin2=PE4
+Mcu.Pin20=PE1
+Mcu.Pin21=VP_CRC_VS_CRC
+Mcu.Pin22=VP_FREERTOS_VS_CMSIS_V2
+Mcu.Pin23=VP_SYS_VS_tim6
+Mcu.Pin3=PE6
+Mcu.Pin4=PC13
+Mcu.Pin5=PC14-OSC32_IN
+Mcu.Pin6=PH0-OSC_IN
+Mcu.Pin7=PH1-OSC_OUT
+Mcu.Pin8=PA0
+Mcu.Pin9=PA3
+Mcu.PinsNb=24
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32H733VGTx
-MxCube.Version=6.9.2
-MxDb.Version=DB.6.0.92
-NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+MxCube.Version=6.12.0
+MxDb.Version=DB.6.0.120
+NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.FDCAN1_IT0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
+NVIC.FDCAN1_IT1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.ForceEnableDMAVector=true
-NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
-NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
-NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
+NVIC.SavedPendsvIrqHandlerGenerated=true
+NVIC.SavedSvcallIrqHandlerGenerated=true
+NVIC.SavedSystickIrqHandlerGenerated=true
+NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:false
+NVIC.TIM6_DAC_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
+NVIC.TimeBase=TIM6_DAC_IRQn
+NVIC.TimeBaseIP=TIM6
+NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
+PA0.GPIOParameters=GPIO_Label
+PA0.GPIO_Label=BUZZER_PWR_EN
+PA0.Locked=true
+PA0.Signal=GPIO_Output
+PA15(JTDI).GPIOParameters=GPIO_Label
+PA15(JTDI).GPIO_Label=TELEM_PWR_EN
+PA15(JTDI).Locked=true
+PA15(JTDI).Signal=GPIO_Output
+PA3.GPIOParameters=GPIO_Label
+PA3.GPIO_Label=LED
+PA3.Locked=true
+PA3.Signal=GPIO_Output
+PB12.GPIOParameters=PinState,GPIO_Label
+PB12.GPIO_Label=nPCM_EN
+PB12.Locked=true
+PB12.PinState=GPIO_PIN_SET
+PB12.Signal=GPIO_Output
+PB5.GPIOParameters=GPIO_PuPd,GPIO_Label
+PB5.GPIO_Label=nBOOT_EN
+PB5.GPIO_PuPd=GPIO_PULLUP
+PB5.Locked=true
+PB5.Signal=GPIO_Input
+PB8.Locked=true
+PB8.Mode=FDCAN_Activate
+PB8.Signal=FDCAN1_RX
+PB9.Locked=true
+PB9.Mode=FDCAN_Activate
+PB9.Signal=FDCAN1_TX
+PC13.GPIOParameters=GPIO_Label
+PC13.GPIO_Label=FR_STBY3
+PC13.Locked=true
+PC13.Signal=GPIO_Output
+PC14-OSC32_IN.GPIOParameters=GPIO_Label
+PC14-OSC32_IN.GPIO_Label=LV_PWR_EN
+PC14-OSC32_IN.Locked=true
+PC14-OSC32_IN.Signal=GPIO_Output
+PC7.GPIOParameters=GPIO_Label
+PC7.GPIO_Label=FR_STBY2
+PC7.Locked=true
+PC7.Signal=GPIO_Output
+PD1.GPIOParameters=GPIO_Label
+PD1.GPIO_Label=AUX_PWR_EN
+PD1.Locked=true
+PD1.Signal=GPIO_Output
+PD10.GPIOParameters=GPIO_Label
+PD10.GPIO_Label=PUMP_PWR_E
+PD10.Locked=true
+PD10.Signal=GPIO_Output
+PD13.GPIOParameters=GPIO_Label
+PD13.GPIO_Label=_900K_GPI
+PD13.Locked=true
+PD13.Signal=GPIO_Output
+PE0.GPIOParameters=GPIO_Label
+PE0.GPIO_Label=INV_L_PWR_EN
+PE0.Locked=true
+PE0.Signal=GPIO_Output
+PE1.GPIOParameters=GPIO_Label
+PE1.GPIO_Label=FR_STBY3
+PE1.Locked=true
+PE1.Signal=GPIO_Output
+PE2.GPIOParameters=GPIO_Label
+PE2.GPIO_Label=INV_R_PWR_EN
+PE2.Locked=true
+PE2.Signal=GPIO_Output
+PE3.GPIOParameters=GPIO_Label
+PE3.GPIO_Label=INV_R_PROGRA
+PE3.Locked=true
+PE3.Signal=GPIO_Output
+PE4.GPIOParameters=GPIO_Label
+PE4.GPIO_Label=INV_L_PROGR
+PE4.Locked=true
+PE4.Signal=GPIO_Output
+PE6.GPIOParameters=GPIO_Label
+PE6.GPIO_Label=SHDN_PWR_EN
+PE6.Locked=true
+PE6.Signal=GPIO_Output
+PH0-OSC_IN.Mode=HSE-External-Oscillator
+PH0-OSC_IN.Signal=RCC_OSC_IN
+PH1-OSC_OUT.Mode=HSE-External-Oscillator
+PH1-OSC_OUT.Signal=RCC_OSC_OUT
PinOutPanel.RotationAngle=0
ProjectManager.AskForMigrate=true
ProjectManager.BackupPrevious=false
@@ -45,89 +180,110 @@ ProjectManager.DeviceId=STM32H733VGTx
ProjectManager.FirmwarePackage=STM32Cube FW_H7 V1.11.2
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x00
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
-ProjectManager.LibraryCopy=0
+ProjectManager.LibraryCopy=1
ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
-ProjectManager.PreviousToolchain=
+ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=VC_boot.ioc
ProjectManager.ProjectName=VC_boot
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400
-ProjectManager.TargetToolchain=EWARM V8.50
+ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
-ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
-RCC.ADCFreq_Value=129000000
-RCC.AHB12Freq_Value=64000000
-RCC.AHB4Freq_Value=64000000
-RCC.APB1Freq_Value=64000000
-RCC.APB2Freq_Value=64000000
-RCC.APB3Freq_Value=64000000
-RCC.APB4Freq_Value=64000000
-RCC.AXIClockFreq_Value=64000000
+ProjectManager.UnderRoot=true
+ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_CRC_Init-CRC-false-HAL-true,4-MX_FDCAN1_Init-FDCAN1-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
+RCC.ADCFreq_Value=16125000
+RCC.AHB12Freq_Value=48000000
+RCC.AHB4Freq_Value=48000000
+RCC.APB1Freq_Value=24000000
+RCC.APB2Freq_Value=24000000
+RCC.APB3Freq_Value=24000000
+RCC.APB4Freq_Value=24000000
+RCC.AXIClockFreq_Value=48000000
RCC.CECFreq_Value=32000
RCC.CKPERFreq_Value=64000000
-RCC.CortexFreq_Value=64000000
-RCC.CpuClockFreq_Value=64000000
-RCC.D1CPREFreq_Value=64000000
-RCC.DFSDMACLkFreq_Value=129000000
-RCC.DFSDMFreq_Value=64000000
-RCC.DIVP1Freq_Value=129000000
-RCC.DIVP2Freq_Value=129000000
-RCC.DIVP3Freq_Value=129000000
-RCC.DIVQ1Freq_Value=129000000
-RCC.DIVQ2Freq_Value=129000000
-RCC.DIVQ3Freq_Value=129000000
-RCC.DIVR1Freq_Value=129000000
-RCC.DIVR2Freq_Value=129000000
-RCC.DIVR3Freq_Value=129000000
-RCC.FDCANFreq_Value=129000000
-RCC.FMCFreq_Value=64000000
+RCC.CortexFreq_Value=96000000
+RCC.CpuClockFreq_Value=96000000
+RCC.D1CPRE=RCC_SYSCLK_DIV2
+RCC.D1CPREFreq_Value=96000000
+RCC.D1PPRE=RCC_APB3_DIV2
+RCC.D2PPRE1=RCC_APB1_DIV2
+RCC.D2PPRE2=RCC_APB2_DIV2
+RCC.D3PPRE=RCC_APB4_DIV2
+RCC.DFSDMACLkFreq_Value=48000000
+RCC.DFSDMFreq_Value=24000000
+RCC.DIVM1=1
+RCC.DIVN1=24
+RCC.DIVP1=1
+RCC.DIVP1Freq_Value=192000000
+RCC.DIVP2Freq_Value=16125000
+RCC.DIVP3Freq_Value=16125000
+RCC.DIVQ1=4
+RCC.DIVQ1Freq_Value=48000000
+RCC.DIVQ2Freq_Value=16125000
+RCC.DIVQ3Freq_Value=16125000
+RCC.DIVR1Freq_Value=96000000
+RCC.DIVR2Freq_Value=16125000
+RCC.DIVR3Freq_Value=16125000
+RCC.FDCANFreq_Value=48000000
+RCC.FMCFreq_Value=48000000
RCC.FamilyName=M
-RCC.HCLK3ClockFreq_Value=64000000
-RCC.HCLKFreq_Value=64000000
-RCC.I2C123Freq_Value=64000000
-RCC.I2C4Freq_Value=64000000
-RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
-RCC.LPTIM1Freq_Value=64000000
-RCC.LPTIM2Freq_Value=64000000
-RCC.LPTIM345Freq_Value=64000000
-RCC.LPUART1Freq_Value=64000000
-RCC.LTDCFreq_Value=129000000
+RCC.HCLK3ClockFreq_Value=48000000
+RCC.HCLKFreq_Value=48000000
+RCC.HPRE=RCC_HCLK_DIV2
+RCC.HSE_VALUE=8000000
+RCC.I2C123Freq_Value=24000000
+RCC.I2C4Freq_Value=24000000
+RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPRE,D1CPREFreq_Value,D1PPRE,D2PPRE1,D2PPRE2,D3PPRE,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVN1,DIVP1,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,HPRE,HSE_VALUE,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL3FRACN,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
+RCC.LPTIM1Freq_Value=24000000
+RCC.LPTIM2Freq_Value=24000000
+RCC.LPTIM345Freq_Value=24000000
+RCC.LPUART1Freq_Value=24000000
+RCC.LTDCFreq_Value=16125000
RCC.MCO1PinFreq_Value=64000000
-RCC.MCO2PinFreq_Value=64000000
-RCC.QSPIFreq_Value=64000000
+RCC.MCO2PinFreq_Value=192000000
+RCC.PLL2FRACN=0
+RCC.PLL3FRACN=0
+RCC.PLLFRACN=0
+RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
+RCC.QSPIFreq_Value=48000000
RCC.RNGFreq_Value=48000000
RCC.RTCFreq_Value=32000
-RCC.SAI1Freq_Value=129000000
-RCC.SAI4AFreq_Value=129000000
-RCC.SAI4BFreq_Value=129000000
-RCC.SDMMCFreq_Value=129000000
-RCC.SPDIFRXFreq_Value=129000000
-RCC.SPI123Freq_Value=129000000
-RCC.SPI45Freq_Value=64000000
-RCC.SPI6Freq_Value=64000000
-RCC.SWPMI1Freq_Value=64000000
-RCC.SYSCLKFreq_VALUE=64000000
-RCC.Tim1OutputFreq_Value=64000000
-RCC.Tim2OutputFreq_Value=64000000
+RCC.SAI1Freq_Value=48000000
+RCC.SAI4AFreq_Value=48000000
+RCC.SAI4BFreq_Value=48000000
+RCC.SDMMCFreq_Value=48000000
+RCC.SPDIFRXFreq_Value=48000000
+RCC.SPI123Freq_Value=48000000
+RCC.SPI45Freq_Value=24000000
+RCC.SPI6Freq_Value=24000000
+RCC.SWPMI1Freq_Value=24000000
+RCC.SYSCLKFreq_VALUE=192000000
+RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
+RCC.Tim1OutputFreq_Value=48000000
+RCC.Tim2OutputFreq_Value=48000000
RCC.TraceFreq_Value=64000000
-RCC.USART16Freq_Value=64000000
-RCC.USART234578Freq_Value=64000000
-RCC.USBFreq_Value=129000000
-RCC.VCO1OutputFreq_Value=258000000
-RCC.VCO2OutputFreq_Value=258000000
-RCC.VCO3OutputFreq_Value=258000000
-RCC.VCOInput1Freq_Value=2000000
-RCC.VCOInput2Freq_Value=2000000
-RCC.VCOInput3Freq_Value=2000000
-VP_SYS_VS_Systick.Mode=SysTick
-VP_SYS_VS_Systick.Signal=SYS_VS_Systick
+RCC.USART16Freq_Value=24000000
+RCC.USART234578Freq_Value=24000000
+RCC.USBFreq_Value=48000000
+RCC.VCO1OutputFreq_Value=192000000
+RCC.VCO2OutputFreq_Value=32250000
+RCC.VCO3OutputFreq_Value=32250000
+RCC.VCOInput1Freq_Value=8000000
+RCC.VCOInput2Freq_Value=250000
+RCC.VCOInput3Freq_Value=250000
+VP_CRC_VS_CRC.Mode=CRC_Activate
+VP_CRC_VS_CRC.Signal=CRC_VS_CRC
+VP_FREERTOS_VS_CMSIS_V2.Mode=CMSIS_V2
+VP_FREERTOS_VS_CMSIS_V2.Signal=FREERTOS_VS_CMSIS_V2
+VP_SYS_VS_tim6.Mode=TIM6
+VP_SYS_VS_tim6.Signal=SYS_VS_tim6
board=custom
+rtos.0.ip=FREERTOS
diff --git a/firmware/quintuna/VC/boot/cubemx/VC_boot.ioc.md5 b/firmware/quintuna/VC/boot/cubemx/VC_boot.ioc.md5
new file mode 100644
index 0000000000..dc5dfcea9c
--- /dev/null
+++ b/firmware/quintuna/VC/boot/cubemx/VC_boot.ioc.md5
@@ -0,0 +1 @@
+8dceab0d1f7a2f4b6ac439623236de49
\ No newline at end of file
diff --git a/firmware/quintuna/VC/src/cubemx/Inc/FreeRTOSConfig.h b/firmware/quintuna/VC/src/cubemx/Inc/FreeRTOSConfig.h
index f55d23c423..632cfb2262 100644
--- a/firmware/quintuna/VC/src/cubemx/Inc/FreeRTOSConfig.h
+++ b/firmware/quintuna/VC/src/cubemx/Inc/FreeRTOSConfig.h
@@ -173,6 +173,7 @@ standard names. */
/* USER CODE BEGIN Defines */
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
+#include "sysviewFreeRTOSConfigs.h"
/* USER CODE END Defines */
#endif /* FREERTOS_CONFIG_H */
diff --git a/firmware/shared/srcpp/app/app_heartbeatMonitor.h b/firmware/shared/srcpp/app/app_heartbeatMonitor.hpp
similarity index 97%
rename from firmware/shared/srcpp/app/app_heartbeatMonitor.h
rename to firmware/shared/srcpp/app/app_heartbeatMonitor.hpp
index 10b66877ef..80d8d160cd 100644
--- a/firmware/shared/srcpp/app/app_heartbeatMonitor.h
+++ b/firmware/shared/srcpp/app/app_heartbeatMonitor.hpp
@@ -1,8 +1,9 @@
#pragma once
-#include "io_heartbeatNode.h"
-#include "app_timer.h"
+#include "io_heartbeatNode.hpp"
+#include "app_timer.hpp"
#include
+#include
namespace app::heartbeat
{
diff --git a/firmware/shared/srcpp/app/app_shdnLoop.h b/firmware/shared/srcpp/app/app_shdnLoop.hpp
similarity index 94%
rename from firmware/shared/srcpp/app/app_shdnLoop.h
rename to firmware/shared/srcpp/app/app_shdnLoop.hpp
index 1cbd4c4d6c..8497d14159 100644
--- a/firmware/shared/srcpp/app/app_shdnLoop.h
+++ b/firmware/shared/srcpp/app/app_shdnLoop.hpp
@@ -1,6 +1,6 @@
#pragma once
#include
-#include "io_shdnLoopNode.h"
+#include "io_shdnLoopNode.hpp"
namespace app::shdn
{
diff --git a/firmware/shared/srcpp/app/app_stackMonitor.h b/firmware/shared/srcpp/app/app_stackMonitor.hpp
similarity index 97%
rename from firmware/shared/srcpp/app/app_stackMonitor.h
rename to firmware/shared/srcpp/app/app_stackMonitor.hpp
index 8523c88f52..2ae4506293 100644
--- a/firmware/shared/srcpp/app/app_stackMonitor.h
+++ b/firmware/shared/srcpp/app/app_stackMonitor.hpp
@@ -1,7 +1,7 @@
#pragma once
#include
#include
-#include "io_stackMonitor.h"
+#include "io_stackMonitor.hpp"
namespace app
{
diff --git a/firmware/shared/srcpp/app/app_stateMachine.cpp b/firmware/shared/srcpp/app/app_stateMachine.cpp
index d82882faa8..c2bf35058a 100644
--- a/firmware/shared/srcpp/app/app_stateMachine.cpp
+++ b/firmware/shared/srcpp/app/app_stateMachine.cpp
@@ -1,4 +1,4 @@
-#include "app_stateMachine.h"
+#include "app_stateMachine.hpp"
#ifdef __arm__
#include
diff --git a/firmware/shared/srcpp/app/app_stateMachine.h b/firmware/shared/srcpp/app/app_stateMachine.hpp
similarity index 100%
rename from firmware/shared/srcpp/app/app_stateMachine.h
rename to firmware/shared/srcpp/app/app_stateMachine.hpp
diff --git a/firmware/shared/srcpp/app/app_timer.cpp b/firmware/shared/srcpp/app/app_timer.cpp
index 7bd5a1a207..1c74397bb1 100644
--- a/firmware/shared/srcpp/app/app_timer.cpp
+++ b/firmware/shared/srcpp/app/app_timer.cpp
@@ -1,5 +1,5 @@
-#include "app_timer.h"
-#include "io_time.h"
+#include "app_timer.hpp"
+#include "io_time.hpp"
namespace app
{
diff --git a/firmware/shared/srcpp/app/app_timer.h b/firmware/shared/srcpp/app/app_timer.hpp
similarity index 100%
rename from firmware/shared/srcpp/app/app_timer.h
rename to firmware/shared/srcpp/app/app_timer.hpp
diff --git a/firmware/shared/srcpp/app/app_utils.h b/firmware/shared/srcpp/app/app_utils.hpp
similarity index 100%
rename from firmware/shared/srcpp/app/app_utils.h
rename to firmware/shared/srcpp/app/app_utils.hpp
diff --git a/firmware/shared/srcpp/hw/hw_adc.h b/firmware/shared/srcpp/hw/hw_adc.hpp
similarity index 99%
rename from firmware/shared/srcpp/hw/hw_adc.h
rename to firmware/shared/srcpp/hw/hw_adc.hpp
index df46a60137..cd09cc0af8 100644
--- a/firmware/shared/srcpp/hw/hw_adc.h
+++ b/firmware/shared/srcpp/hw/hw_adc.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "app_utils.h"
+#include "app_utils.hpp"
#include
#ifdef TARGET_EMBEDDED
diff --git a/firmware/shared/srcpp/hw/hw_assert.cpp b/firmware/shared/srcpp/hw/hw_assert.cpp
index e0bcfe6ff4..e7a577d601 100644
--- a/firmware/shared/srcpp/hw/hw_assert.cpp
+++ b/firmware/shared/srcpp/hw/hw_assert.cpp
@@ -1,7 +1,7 @@
#include
-#include "app_utils.h"
-#include "hw_utils.h"
-#include "io_log.h"
+#include "app_utils.hpp"
+#include "hw_utils.hpp"
+#include "io_log.hpp"
static char buffer[100];
diff --git a/firmware/shared/srcpp/hw/hw_bootup.cpp b/firmware/shared/srcpp/hw/hw_bootup.cpp
index e550fadcca..b0fc836295 100644
--- a/firmware/shared/srcpp/hw/hw_bootup.cpp
+++ b/firmware/shared/srcpp/hw/hw_bootup.cpp
@@ -1,5 +1,5 @@
-#include "hw_bootup.h"
-#include "hw_hal.h"
+#include "hw_bootup.hpp"
+#include "hw_hal.hpp"
#include "FreeRTOS.h"
// Defined in linker script.
diff --git a/firmware/shared/srcpp/hw/hw_bootup.h b/firmware/shared/srcpp/hw/hw_bootup.hpp
similarity index 100%
rename from firmware/shared/srcpp/hw/hw_bootup.h
rename to firmware/shared/srcpp/hw/hw_bootup.hpp
diff --git a/firmware/shared/srcpp/hw/hw_can.cpp b/firmware/shared/srcpp/hw/hw_can.cpp
index df172cab9d..7d30b232a2 100644
--- a/firmware/shared/srcpp/hw/hw_can.cpp
+++ b/firmware/shared/srcpp/hw/hw_can.cpp
@@ -1,5 +1,5 @@
-#include "hw_can.h"
-#include "io_log.h"
+#include "hw_can.hpp"
+#include "io_log.hpp"
#include
// The following filter IDs/masks must be used with 16-bit Filter Scale
diff --git a/firmware/shared/srcpp/hw/hw_can.h b/firmware/shared/srcpp/hw/hw_can.hpp
similarity index 98%
rename from firmware/shared/srcpp/hw/hw_can.h
rename to firmware/shared/srcpp/hw/hw_can.hpp
index f83e6a4537..b6f3b053aa 100644
--- a/firmware/shared/srcpp/hw/hw_can.h
+++ b/firmware/shared/srcpp/hw/hw_can.hpp
@@ -2,7 +2,7 @@
#include
#ifdef TARGET_EMBEDDED
-#include "hw_hal.h"
+#include "hw_hal.hpp"
#endif
namespace hw::can
diff --git a/firmware/shared/srcpp/hw/hw_error.cpp b/firmware/shared/srcpp/hw/hw_error.cpp
index bf741aebea..e6cabff8d8 100644
--- a/firmware/shared/srcpp/hw/hw_error.cpp
+++ b/firmware/shared/srcpp/hw/hw_error.cpp
@@ -1,6 +1,6 @@
-#include "io_log.h"
-#include "hw_error.h"
-#include "hw_utils.h"
+#include "io_log.hpp"
+#include "hw_error.hpp"
+#include "hw_utils.hpp"
#include
static char buffer[100];
diff --git a/firmware/shared/srcpp/hw/hw_error.h b/firmware/shared/srcpp/hw/hw_error.hpp
similarity index 100%
rename from firmware/shared/srcpp/hw/hw_error.h
rename to firmware/shared/srcpp/hw/hw_error.hpp
diff --git a/firmware/shared/srcpp/hw/hw_gpio.cpp b/firmware/shared/srcpp/hw/hw_gpio.cpp
index 04bba29a57..ef05d89b23 100644
--- a/firmware/shared/srcpp/hw/hw_gpio.cpp
+++ b/firmware/shared/srcpp/hw/hw_gpio.cpp
@@ -1,4 +1,4 @@
-#include "hw_gpio.h"
+#include "hw_gpio.hpp"
void hw::Gpio::writePin(bool value) const
{
diff --git a/firmware/shared/srcpp/hw/hw_gpio.h b/firmware/shared/srcpp/hw/hw_gpio.hpp
similarity index 95%
rename from firmware/shared/srcpp/hw/hw_gpio.h
rename to firmware/shared/srcpp/hw/hw_gpio.hpp
index 071d546602..9bd874540b 100644
--- a/firmware/shared/srcpp/hw/hw_gpio.h
+++ b/firmware/shared/srcpp/hw/hw_gpio.hpp
@@ -2,7 +2,7 @@
#ifdef TARGET_EMBEDDED
extern "C"
{
-#include "hw_hal.h"
+#include "hw_hal.hpp"
}
#endif
diff --git a/firmware/shared/srcpp/hw/hw_hal.h b/firmware/shared/srcpp/hw/hw_hal.hpp
similarity index 100%
rename from firmware/shared/srcpp/hw/hw_hal.h
rename to firmware/shared/srcpp/hw/hw_hal.hpp
diff --git a/firmware/shared/srcpp/hw/hw_hardFaultHandler.cpp b/firmware/shared/srcpp/hw/hw_hardFaultHandler.cpp
index f6251512a5..0f7a763247 100644
--- a/firmware/shared/srcpp/hw/hw_hardFaultHandler.cpp
+++ b/firmware/shared/srcpp/hw/hw_hardFaultHandler.cpp
@@ -1,6 +1,6 @@
-#include "hw_hardFaultHandler.h"
-#include "hw_hal.h"
-#include "hw_utils.h"
+#include "hw_hardFaultHandler.hpp"
+#include "hw_hal.hpp"
+#include "hw_utils.hpp"
void hw_hardFaultHandler_init(void)
{
diff --git a/firmware/shared/srcpp/hw/hw_hardFaultHandler.h b/firmware/shared/srcpp/hw/hw_hardFaultHandler.hpp
similarity index 100%
rename from firmware/shared/srcpp/hw/hw_hardFaultHandler.h
rename to firmware/shared/srcpp/hw/hw_hardFaultHandler.hpp
diff --git a/firmware/shared/srcpp/hw/hw_uart.cpp b/firmware/shared/srcpp/hw/hw_uart.cpp
index 7b2a05ebfd..c15632dc12 100644
--- a/firmware/shared/srcpp/hw/hw_uart.cpp
+++ b/firmware/shared/srcpp/hw/hw_uart.cpp
@@ -1,4 +1,4 @@
-#include "hw_uart.h"
+#include "hw_uart.hpp"
namespace hw
{
diff --git a/firmware/shared/srcpp/hw/hw_uart.h b/firmware/shared/srcpp/hw/hw_uart.hpp
similarity index 99%
rename from firmware/shared/srcpp/hw/hw_uart.h
rename to firmware/shared/srcpp/hw/hw_uart.hpp
index 736f1abfc5..f778e61275 100644
--- a/firmware/shared/srcpp/hw/hw_uart.h
+++ b/firmware/shared/srcpp/hw/hw_uart.hpp
@@ -3,7 +3,7 @@
#include
#ifdef TARGET_EMBEDDED
-#include "hw_hal.h"
+#include "hw_hal.hpp"
#endif
// HAL UART type documentation pg 1161:
diff --git a/firmware/shared/srcpp/hw/hw_utils.h b/firmware/shared/srcpp/hw/hw_utils.hpp
similarity index 94%
rename from firmware/shared/srcpp/hw/hw_utils.h
rename to firmware/shared/srcpp/hw/hw_utils.hpp
index 176c4813e1..00cb0fa5a4 100644
--- a/firmware/shared/srcpp/hw/hw_utils.h
+++ b/firmware/shared/srcpp/hw/hw_utils.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "hw_hal.h"
+#include "hw_hal.hpp"
#define TICK_TO_MS(tick) ((tick) * portTICK_PERIOD_MS)
diff --git a/firmware/shared/srcpp/hw/hw_watchdog.cpp b/firmware/shared/srcpp/hw/hw_watchdog.cpp
index d53ad7bc6b..063aa4c750 100644
--- a/firmware/shared/srcpp/hw/hw_watchdog.cpp
+++ b/firmware/shared/srcpp/hw/hw_watchdog.cpp
@@ -1,5 +1,5 @@
-#include "hw_watchdog.h"
-#include "io_log.h"
+#include "hw_watchdog.hpp"
+#include "io_log.hpp"
#include "cmsis_os.h"
#include
diff --git a/firmware/shared/srcpp/hw/hw_watchdog.h b/firmware/shared/srcpp/hw/hw_watchdog.hpp
similarity index 100%
rename from firmware/shared/srcpp/hw/hw_watchdog.h
rename to firmware/shared/srcpp/hw/hw_watchdog.hpp
diff --git a/firmware/shared/srcpp/io/io_canMsgQueue.cpp b/firmware/shared/srcpp/io/io_canMsgQueue.cpp
index 5e1552375c..95b487cbbf 100644
--- a/firmware/shared/srcpp/io/io_canMsgQueue.cpp
+++ b/firmware/shared/srcpp/io/io_canMsgQueue.cpp
@@ -1,7 +1,7 @@
-#include "io_canMsgQueue.h"
+#include "io_canMsgQueue.hpp"
#include
-#include "io_log.h"
+#include "io_log.hpp"
namespace io
{
diff --git a/firmware/shared/srcpp/io/io_canMsgQueue.h b/firmware/shared/srcpp/io/io_canMsgQueue.hpp
similarity index 99%
rename from firmware/shared/srcpp/io/io_canMsgQueue.h
rename to firmware/shared/srcpp/io/io_canMsgQueue.hpp
index 55a04f238f..325ef9a5c1 100644
--- a/firmware/shared/srcpp/io/io_canMsgQueue.h
+++ b/firmware/shared/srcpp/io/io_canMsgQueue.hpp
@@ -2,7 +2,7 @@
#include
#include
-#include "hw_can.h"
+#include "hw_can.hpp"
#include "cmsis_os.h"
/**
diff --git a/firmware/shared/srcpp/io/io_chimera.cpp b/firmware/shared/srcpp/io/io_chimera.cpp
index cc013ee9d4..8bfcc492e7 100644
--- a/firmware/shared/srcpp/io/io_chimera.cpp
+++ b/firmware/shared/srcpp/io/io_chimera.cpp
@@ -1,4 +1,4 @@
-#include "io_chimera.h"
+#include "io_chimera.hpp"
#include
#include
@@ -10,7 +10,7 @@
#include "cmsis_os.h"
-#include "hw_adc.h"
+#include "hw_adc.hpp"
extern const hw::Gpio *id_to_gpio(uint32_t net_name);
extern const hw::Adc *id_to_adc(uint32_t net_name);
diff --git a/firmware/shared/srcpp/io/io_chimera.h b/firmware/shared/srcpp/io/io_chimera.hpp
similarity index 86%
rename from firmware/shared/srcpp/io/io_chimera.h
rename to firmware/shared/srcpp/io/io_chimera.hpp
index 15699bb911..145da2ac57 100644
--- a/firmware/shared/srcpp/io/io_chimera.h
+++ b/firmware/shared/srcpp/io/io_chimera.hpp
@@ -1,7 +1,7 @@
#pragma once
-#include "hw_uart.h"
-#include "hw_gpio.h"
+#include "hw_uart.hpp"
+#include "hw_gpio.hpp"
#define CASERETURN(A, B) \
case A: \
diff --git a/firmware/shared/srcpp/io/io_heartbeatNode.cpp b/firmware/shared/srcpp/io/io_heartbeatNode.cpp
index 9b2adb4d4b..8fda1f2337 100644
--- a/firmware/shared/srcpp/io/io_heartbeatNode.cpp
+++ b/firmware/shared/srcpp/io/io_heartbeatNode.cpp
@@ -1 +1 @@
-#include "io_heartbeatNode.h"
\ No newline at end of file
+#include "io_heartbeatNode.hpp"
\ No newline at end of file
diff --git a/firmware/shared/srcpp/io/io_heartbeatNode.h b/firmware/shared/srcpp/io/io_heartbeatNode.hpp
similarity index 98%
rename from firmware/shared/srcpp/io/io_heartbeatNode.h
rename to firmware/shared/srcpp/io/io_heartbeatNode.hpp
index 9ee5332c9b..12a0477f1f 100644
--- a/firmware/shared/srcpp/io/io_heartbeatNode.h
+++ b/firmware/shared/srcpp/io/io_heartbeatNode.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "app_timer.h"
+#include "app_timer.hpp"
namespace io::heartbeat
{
diff --git a/firmware/shared/srcpp/io/io_jsoncan.cpp b/firmware/shared/srcpp/io/io_jsoncan.cpp
index 6610d304eb..1e34d66e49 100644
--- a/firmware/shared/srcpp/io/io_jsoncan.cpp
+++ b/firmware/shared/srcpp/io/io_jsoncan.cpp
@@ -1,5 +1,5 @@
-#include "io_jsoncan.h"
-#include "hw_can.h"
+#include "io_jsoncan.hpp"
+#include "hw_can.hpp"
#include
namespace io::jsoncan
diff --git a/firmware/shared/srcpp/io/io_jsoncan.h b/firmware/shared/srcpp/io/io_jsoncan.hpp
similarity index 96%
rename from firmware/shared/srcpp/io/io_jsoncan.h
rename to firmware/shared/srcpp/io/io_jsoncan.hpp
index 325e98b105..71650a8cc8 100644
--- a/firmware/shared/srcpp/io/io_jsoncan.h
+++ b/firmware/shared/srcpp/io/io_jsoncan.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "io_canMsgQueue.h"
+#include "io_canMsgQueue.hpp"
extern "C"
{
diff --git a/firmware/shared/srcpp/io/io_led.cpp b/firmware/shared/srcpp/io/io_led.cpp
index 911f357a3c..96fe95bba2 100644
--- a/firmware/shared/srcpp/io/io_led.cpp
+++ b/firmware/shared/srcpp/io/io_led.cpp
@@ -1,4 +1,4 @@
-#include "io_led.h"
+#include "io_led.hpp"
void io::binary_led::set(bool state) const
{
diff --git a/firmware/shared/srcpp/io/io_led.h b/firmware/shared/srcpp/io/io_led.hpp
similarity index 96%
rename from firmware/shared/srcpp/io/io_led.h
rename to firmware/shared/srcpp/io/io_led.hpp
index 5cc8abd252..0bc0cda70c 100644
--- a/firmware/shared/srcpp/io/io_led.h
+++ b/firmware/shared/srcpp/io/io_led.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "hw_gpio.h"
+#include "hw_gpio.hpp"
namespace io
{
diff --git a/firmware/shared/srcpp/io/io_log.cpp b/firmware/shared/srcpp/io/io_log.cpp
index 963edf06fa..fb6913da98 100644
--- a/firmware/shared/srcpp/io/io_log.cpp
+++ b/firmware/shared/srcpp/io/io_log.cpp
@@ -1,4 +1,4 @@
-#include "io_log.h"
+#include "io_log.hpp"
extern "C"
{
#include "app_canAlerts.h"
diff --git a/firmware/shared/srcpp/io/io_log.h b/firmware/shared/srcpp/io/io_log.hpp
similarity index 98%
rename from firmware/shared/srcpp/io/io_log.h
rename to firmware/shared/srcpp/io/io_log.hpp
index d98262dc6d..92f878382b 100644
--- a/firmware/shared/srcpp/io/io_log.h
+++ b/firmware/shared/srcpp/io/io_log.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "app_utils.h"
+#include "app_utils.hpp"
/*
This logging module users SEGGER Real-Time Transfer (RTT) for printf-style debugging.
diff --git a/firmware/shared/srcpp/io/io_shdnLoopNode.cpp b/firmware/shared/srcpp/io/io_shdnLoopNode.cpp
index 7cedbbdfec..5774e7ada4 100644
--- a/firmware/shared/srcpp/io/io_shdnLoopNode.cpp
+++ b/firmware/shared/srcpp/io/io_shdnLoopNode.cpp
@@ -1,4 +1,4 @@
-#include "io_shdnLoopNode.h"
+#include "io_shdnLoopNode.hpp"
namespace io::shdn
{
diff --git a/firmware/shared/srcpp/io/io_shdnLoopNode.h b/firmware/shared/srcpp/io/io_shdnLoopNode.hpp
similarity index 94%
rename from firmware/shared/srcpp/io/io_shdnLoopNode.h
rename to firmware/shared/srcpp/io/io_shdnLoopNode.hpp
index 6d23a53c8f..765b7577b0 100644
--- a/firmware/shared/srcpp/io/io_shdnLoopNode.h
+++ b/firmware/shared/srcpp/io/io_shdnLoopNode.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "hw_gpio.h"
+#include "hw_gpio.hpp"
namespace io::shdn
{
diff --git a/firmware/shared/srcpp/io/io_stackMonitor.cpp b/firmware/shared/srcpp/io/io_stackMonitor.cpp
index 2aeaa780b2..ee0a304e05 100644
--- a/firmware/shared/srcpp/io/io_stackMonitor.cpp
+++ b/firmware/shared/srcpp/io/io_stackMonitor.cpp
@@ -1,4 +1,4 @@
-#include "io_stackMonitor.h"
+#include "io_stackMonitor.hpp"
namespace io
{
diff --git a/firmware/shared/srcpp/io/io_stackMonitor.h b/firmware/shared/srcpp/io/io_stackMonitor.hpp
similarity index 96%
rename from firmware/shared/srcpp/io/io_stackMonitor.h
rename to firmware/shared/srcpp/io/io_stackMonitor.hpp
index 8ae8ba4c92..a272f1d6cb 100644
--- a/firmware/shared/srcpp/io/io_stackMonitor.h
+++ b/firmware/shared/srcpp/io/io_stackMonitor.hpp
@@ -1,5 +1,6 @@
#pragma once
#include "cmsis_os.h"
+#include
namespace io
{
diff --git a/firmware/shared/srcpp/io/io_switch.cpp b/firmware/shared/srcpp/io/io_switch.cpp
index 7e4a4c8b46..d1c5629daa 100644
--- a/firmware/shared/srcpp/io/io_switch.cpp
+++ b/firmware/shared/srcpp/io/io_switch.cpp
@@ -1,4 +1,4 @@
-#include "io_switch.h"
+#include "io_switch.hpp"
namespace io
{
diff --git a/firmware/shared/srcpp/io/io_switch.h b/firmware/shared/srcpp/io/io_switch.hpp
similarity index 90%
rename from firmware/shared/srcpp/io/io_switch.h
rename to firmware/shared/srcpp/io/io_switch.hpp
index 273c9ba202..c9314dfc00 100644
--- a/firmware/shared/srcpp/io/io_switch.h
+++ b/firmware/shared/srcpp/io/io_switch.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "hw_gpio.h"
+#include "hw_gpio.hpp"
namespace io
{
diff --git a/firmware/shared/srcpp/io/io_time.cpp b/firmware/shared/srcpp/io/io_time.cpp
index 467cd0db82..35ffc2033a 100644
--- a/firmware/shared/srcpp/io/io_time.cpp
+++ b/firmware/shared/srcpp/io/io_time.cpp
@@ -1,4 +1,4 @@
-#include "io_time.h"
+#include "io_time.hpp"
#include
namespace io::time
diff --git a/firmware/shared/srcpp/io/io_time.h b/firmware/shared/srcpp/io/io_time.hpp
similarity index 100%
rename from firmware/shared/srcpp/io/io_time.h
rename to firmware/shared/srcpp/io/io_time.hpp
diff --git a/firmware/third_party/sysview/SEGGER_SYSVIEW_Conf.h b/firmware/third_party/sysview/SEGGER_SYSVIEW_Conf.h
index 8721a3cd28..102eb5796b 100644
--- a/firmware/third_party/sysview/SEGGER_SYSVIEW_Conf.h
+++ b/firmware/third_party/sysview/SEGGER_SYSVIEW_Conf.h
@@ -76,7 +76,7 @@ Additional information:
#ifdef DEBUG
#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 4096
-#endif #endif #endif
+#endif
#endif // SEGGER_SYSVIEW_CONF_H
diff --git a/scripts/code_generation/commit_info_gen/commit_info.cmake b/scripts/code_generation/commit_info_gen/commit_info.cmake
index 353427e847..94e9f598f7 100644
--- a/scripts/code_generation/commit_info_gen/commit_info.cmake
+++ b/scripts/code_generation/commit_info_gen/commit_info.cmake
@@ -34,6 +34,7 @@ function(commit_info_generate_sources bind_target commit_info_directory)
--output-header ${header_location}
--output-source ${src_location}
WORKING_DIRECTORY ${REPO_ROOT_DIR}
+ PRE_BUILD
)
ENDIF ()
endfunction()
\ No newline at end of file