Skip to content

Latest commit

 

History

History
102 lines (69 loc) · 3.12 KB

File metadata and controls

102 lines (69 loc) · 3.12 KB

Setup / Development Environment

When setting up your development environment,

Method 1: Using the setup script

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 | bash

Method 2: Manually

First, clone the repository:

git clone https://github.com/sufst/vcu
git checkout stag-12 # (or any specific branch you want to work on)

Submodules

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 update

For more information on submodules, see the Git submodules documentation.

Building and Flashing

To build this project and flash code to the microcontroller, you will need the following on your path:

Build with:

make -j -s

Flash with:

make flash

For detailed toolchain setup instructions, see the SUFST Docs Site.

Note: Windows users should run these commands from Git Bash.

VS Code

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 ccdgen

Then, you can generate the compile commands database using the relevant Makefile target:

make -s ccd

Since 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

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 src folder. 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.

Trunk

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)