Skip to content

sufst/sensor-hub-firmware

Repository files navigation

Generic STM32 Sensor Hub Firmware (STM32F105RBT)

First time repository setup

  1. Clone the repository
git clone https://github.com/sufst/sensor-hub-firmware
  1. Install uv if you don't have it already
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 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
  1. Download python dependencies
uv sync
  1. Check the build works
uv run build-all

Files should be generated in Generated/default and build/default_release.

Configuring and flashing a board

For a new board:

  1. Copy Configs/default.csv to Configs/<board_name>.csv

  2. 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)
  3. Run the build

uv run build Configs/<board_name>.csv

(or alternatively uv run build-all to build all boards)

  1. Flash to the board Use STM32CubeProgrammer on the generated .elf in build/<board_name>_release/sensor-hub-<board_name>.elf

  2. Update the DBC definition in sufst/can-defs (see below)

Using the generated DBC

  1. Import Generated/<board_name>/<ecu_name>.dbc into the desired can definition (e.g. sufst/can-defs)

  2. Profit 🤑 (maybe test it first)

Troubleshooting

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

And to install ninja:

sudo apt install ninja-build

About

This is the repository for the sensor-hub firmware

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors