- Clone the repository
git clone https://github.com/sufst/sensor-hub-firmware- Install
uvif you don't have it already
curl -LsSf https://astral.sh/uv/install.sh | sh- Install Ninja and the GCC Arm toolchain if you don't have it already
sudo apt install ninja-build gcc-arm-none-eabi binutils-arm-none-eabi- Download python dependencies
uv sync- Check the build works
uv run build-allFiles should be generated in Generated/default and build/default_release.
For a new board:
-
Copy
Configs/default.csvtoConfigs/<board_name>.csv -
Fill it in
Configs/<board_name>.csv(e.g. use Microsoft Excel):- ECU Name
- Message ID bases (analog and digital, base because if more than 1 message is required it's incremented)
- Which ports are enabled/disabled
- for the half size one, it's the first 8
- for the full size it's all 16
- leave ports disabled that aren't connected to anything
- Which ports to treat as analog/digital
- Resistor configuration (capacitor is optional for reference)
-
Run the build
uv run build Configs/<board_name>.csv(or alternatively uv run build-all to build all boards)
-
Flash to the board Use STM32CubeProgrammer on the generated .elf in
build/<board_name>_release/sensor-hub-<board_name>.elf -
Update the DBC definition in sufst/can-defs (see below)
-
Import
Generated/<board_name>/<ecu_name>.dbcinto the desired can definition (e.g. sufst/can-defs) -
Profit 🤑 (maybe test it first)
If you get CMake errors, you might need to install the toolchain, e.g. on Ubuntu:
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabiAnd to install ninja:
sudo apt install ninja-build