When setting up your development environment,
Run the below command once to install dependencies, clone the repository and initialise submodules
curl -LsSf https://raw.githubusercontent.com/sufst/vcu/refs/heads/main/vcu-setup-script.sh | bashFirst, clone the repository:
git clone https://github.com/sufst/vcu
git checkout stag-12 # (or any specific branch you want to work on)This project depends on middlewares in the src/Middlewares/ folder, some of
which are Git submodules. When first cloning this repo, run the following
commands:
git submodule init
git submodule updateFor more information on submodules, see the Git submodules documentation.
To build this project and flash code to the microcontroller, you will need the following on your path:
- Make
- ARM GNU Embedded Toolchain
- STLink Open Source Toolset
mkdir,rm,tputandecho
Build with:
make -j -sFlash with:
make flashFor detailed toolchain setup instructions, see the SUFST Docs Site.
Note: Windows users should run these commands from Git Bash.
This project is set up to be edited and debugged in VS Code.
The .vscodefolder includes tasks and launch configurations. To improve
Intellisense, it is recommended to use ccdgen.
Make sure it is installed with the following command, which may differ depending on your environment:
python3 -m pip install ccdgenThen, you can generate the compile commands database using the relevant Makefile target:
make -s ccdSince the toolchain is set up to be fully command line based, it is also possible to use other code editors.
Note: Windows users should set Git Bash as the shell in VS Code.
STM32CubeMX is used
to generate boilerplate initialisation code for the microcontroller. These
configurations are stored in src/VCU.ioc which should not be edited manually.
To minimise the chance of merge conflicts, changes to the .ioc should be made
as infrequently as possible as the .ioc format is not well suited to version
control.
Note: CubeMX generates a Makefile in the
srcfolder. This should not be used, there is a custom Makefile in the project root. If CubeMX adds something to the Makefile it generates which is not in the custom Makefile, it should be copied over. This should only happen infrequently when adding a new peripheral or CubeMX managed middlewares.
We use trunk.io for testing which gives us MISRA Compliance. Once installed, you can run trunk check. This is also automatically run via a GitHub action, on every push to GitHub. (see ./.github/workflows/trunk-action.yaml)