Skip to content

Commit

Permalink
CMake Cleanup (#1328)
Browse files Browse the repository at this point in the history
### Changelist 
<!-- Give a list of the changes covered in this PR. This will help both
you and the reviewer keep this PR within scope. -->
- Consolidate configurations into presets
[FIRM-26](https://ubcformulaelectric.atlassian.net/browse/FIRM-26), and
make CI use those presets
[FIRM-27](https://ubcformulaelectric.atlassian.net/browse/FIRM-27)
- Better CMake logs
- Deploy mode, with optimized binaries, and dev mode with maximized
debug symbols
[FIRM-22](https://ubcformulaelectric.atlassian.net/browse/FIRM-22)
  - Use CMAKE_BUILD_TYPE = deploy and dev to control optimization levels
- Consistent capitalization and formatting of CMake syntax
- Remove Littlefs
[FIRM-25](https://ubcformulaelectric.atlassian.net/browse/FIRM-25)
- Modularization of CMake files, including moving dependencies,
embedded.cmake, new stmlib.cmake, etc.
- Convert from TARGET = deploy, tests to TARGET = binary, tests
- Migrate to Arm, and remove heap_useNewlib
([FIRM-74](https://ubcformulaelectric.atlassian.net/browse/FIRM-74))

### Testing Done
<!-- Outline the testing that was done to demonstrate the changes are
solid. This could be unit tests, integration tests, testing on the car,
etc. Include relevant code snippets, screenshots, etc as needed. -->

### Resolved Tickets
<!-- Link any tickets that this PR resolves. -->


[FIRM-26]:
https://ubcformulaelectric.atlassian.net/browse/FIRM-26?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[FIRM-27]:
https://ubcformulaelectric.atlassian.net/browse/FIRM-27?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[FIRM-22]:
https://ubcformulaelectric.atlassian.net/browse/FIRM-22?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

[FIRM-25]:
https://ubcformulaelectric.atlassian.net/browse/FIRM-25?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

[FIRM-74]:
https://ubcformulaelectric.atlassian.net/browse/FIRM-74?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
Lucien950 authored Sep 26, 2024
1 parent c777ca7 commit 45a4efd
Show file tree
Hide file tree
Showing 80 changed files with 3,585 additions and 3,069 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build_binary/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ runs:
- name: Build
shell: bash
run: |
cmake -B ${{ inputs.build_dir }} -DPLATFORM=firmware -DTARGET=deploy -DHANDLE_DEPS=OFF -DFIX_FORMATTING=OFF
xvfb-run make --directory=${{ inputs.build_dir }} -j`nproc` ${{ inputs.board }}.hex
cmake --preset "FW Deploy CI" -B ${{ inputs.build_dir }}
xvfb-run cmake --build ${{ inputs.build_dir }} --target ${{ inputs.board }}.hex
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
with:
board: ${{ matrix.board }}

test:
test-firmware:
needs: [ clang-format ]
name: Test Firmware
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -153,8 +153,8 @@ jobs:

- name: Build
run: |
cmake -B $BUILD_DIR -DPLATFORM=firmware -DTARGET=test -DHANDLE_DEPS=OFF -DFIX_FORMATTING=OFF
make --directory=$BUILD_DIR -j`nproc` ${{ matrix.car }}_${{ matrix.board }}_test
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target ${{ matrix.car }}_${{ matrix.board }}_test
- name: Run Tests
run: |
Expand Down Expand Up @@ -187,8 +187,8 @@ jobs:

- name: Build
run: |
cmake -B $BUILD_DIR -DPLATFORM=firmware -DTARGET=test -DHANDLE_DEPS=OFF -DFIX_FORMATTING=OFF
make --directory=$BUILD_DIR -j`nproc` shared_test
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target shared_test
- name: Run tests
run: |
Expand Down Expand Up @@ -221,8 +221,8 @@ jobs:

- name: Build
run: |
cmake -B $BUILD_DIR -DPLATFORM=firmware -DTARGET=test -DNO_VENV=ON -DHANDLE_DEPS=OFF -DFIX_FORMATTING=OFF
make --directory=$BUILD_DIR -j`nproc` fakegen_test
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target fakegen_test
- name: Run tests
run: |
Expand Down Expand Up @@ -254,6 +254,6 @@ jobs:

- name: Build and install `logfs`
run: |
cmake -B $BUILD_DIR -DPLATFORM=firmware -DTARGET=test -DNO_VENV=ON -DHANDLE_DEPS=OFF -DFIX_FORMATTING=OFF
make --directory=$BUILD_DIR -j`nproc` install_python_logfs
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target install_python_logfs
pytest -v firmware/logfs/test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
# Python
*.pyc
__pycache__
Pipfile.lock
*.egg-info

# Other files
Expand Down Expand Up @@ -138,6 +137,8 @@ can_bus/**/*.dbc
# CMake build directories
build_fw_deploy
build_fw_deploy_wsl
build_fw_dev
build_fw_dev_wsl
build_fw_test
build_fw_test_wsl

Expand All @@ -150,5 +151,4 @@ environment/bin
CMakeUserPresets.json
build

zadig.exe
/can_bus/**/*.plt
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "firmware/third_party/sbgECom"]
path = firmware/third_party/sbgECom
url = https://github.com/UBCFormulaElectric/sbgECom.git
[submodule "firmware/third_party/SEGGER_SystemView_Src"]
path = firmware/third_party/SEGGER_SystemView_Src
url = https://github.com/UBCFormulaElectric/SEGGER_SystemView_Src.git
[submodule "software/dimos/src/assets"]
path = software/dimos/src/assets
url = https://github.com/UBCFormulaElectric/dimos-assets.git
Expand Down
5 changes: 3 additions & 2 deletions .idea/runConfigurations/Quadruna_BMS.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .idea/runConfigurations/Quadruna_CRIT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .idea/runConfigurations/Quadruna_RSM.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .idea/runConfigurations/Quadruna_VC.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/quadruna_BMS_hex.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/quadruna_CRIT_hex.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/quadruna_FSM_hex.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/quadruna_RSM_hex.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions .vscode/c_cpp_properties.json

This file was deleted.

Loading

0 comments on commit 45a4efd

Please sign in to comment.