Skip to content

concordia-fsae/firmware

Repository files navigation

Concordia FSAE Firmware Repo

Documenting the Code

README.md should be stored in each component folder. See below for programming guidelines for this repository.

Component Folder and File Hierarchy

Embedded Components

Name Designator Path Comments
Steering Wheel stw components/steering_wheel/ Steering Wheel Controller
BMS Boss bmsb components/bms_boss/ Battery Management System Boss Controller
BMS Worker bmsw components/bms_worker/ Battery Management System Boss Controller
Bootloader bl components/bootloader/ Embedded Bootloaders for all Controllers
Heartbeat heartbeat components/heartbeat/ Generic Heartbeat Application for all Controllers
Front Vehicle Controller vcfront components/vc/front Vehicle Controller code specific to the Front Controller
Power Distribution Unit vcpdu components/vc/pdu Vehicle Controller code specific to the Power Distribution Unit
Rear Vehicle Controller vcrear components/vc/rear Vehicle Controller code specific to the Rear Controller

Drive Software - Linux

Name Designator Path Comments
Can Bridge can-bridge drive-stack/can-bridge Handles bridging and decoding CAN messages over IPC
Concordia UDS Tool conUDS drive-stack/conUDS Tool to drive UDS sessions with controllers.

Platforms

Platform Designator Comments
CFR24 cfr24 Competition car for 2024
CFR25 cfr25 Competition car for 2025

Sections

  • Each component is broken into 3 main code sources
  1. Source Code
    • The source code is typically located in ./components/$COMPONENT_DESIGNATOR/ for each component
    • Hardware sources to be included ./components/$DESIGNATOR/HW/mcuConfig.yaml unless multiple platforms are supported
    • The source code, while it varies between component, has these typical areas:
      1. ./components/$COMPONENT_DESIGNATOR/build/
        • Contains all object files, binary files, etc...
      2. ./components/$COMPONENT_DESIGNATOR/generated/
        • Contains code generated by scripts and/or programs which is used by the embedded system
      3. ./components/$COMPONENT_DESIGNATOR/HW/
        • Contains all firmware source code and header files which interfaces between System Calls and the Hardware
      4. ./components/$COMPONENT_DESIGNATOR/include/
        • Contains all System and Application header files
      5. ./components/$COMPONENT_DESIGNATOR/lib/
        • Contains any library source code and header files which the System uses
      6. ./components/$COMPONENT_DESIGNATOR/RTOS -Contains all source code and header files relating to the implementation of the System's RTOS
      7. ./components/$COMPONENT_DESIGNATOR/src
        • Contains all System and Application level source code
      8. ./components/$COMPONENT_DESIGNATOR/BUCK
        • Defines the build targets for that component
      9. ./components/shared/: Team libraries, configurations, drivers, firmware, and other...
  2. Embedded System
    • Contains libraries, openocd configurations, and platform code accessible to all devices located in ./embedded/
    • Select important sections:
      1. ./embedded/libs/CMSIS/: Controller independant system level library
        • Used for RTOS and other controller independant systems
      2. ./embedded/platforms/: Supported Hardware and MCU platforms
        • Contains the HAL/LL, startup code, and link script for the STM32 family of devices in ./embedded/platforms/stm32/
  3. Chip Configuration
    • The chip configuration is stored in YAML files in ./embedded/platforms/$CHIP.yaml

Setting Up and Using the Development Environment

Workflows

1. Installation and Set-Up

Buck2

  1. Install buck2, reindeer, and uv on your host system.

2. Buck2 Usage

  1. Build a target with buck2 build //$TARGET_PATH:$TARGET_NAME
    • You can specify a specific local output directory with buck2 build ... --out $SOME_LOCAL_PATH
    • Buck2 (when not specified) outputs the files to some deep folder in buck-out/
  2. Run software locally with buck2 build //$TARGET_PATH:$TARGET_NAME
    • Software must be compatible with your host system

Notes

  • To clean your current directory, run buck2 clean
  • If doing loading/debugging of physical hardware, the ST-LINK or other interface must be plugged in by USB before starting the container. Docker containers do not support dynamic loading of USB peripherals
    • Note: This only works if no bootloader is installed. If a bootloader is installed and you are debugging through JTAG, you should still flash over CAN

About

Firmware Repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published