1. Repository Structure

All directory names are abbreviated (e.g., conf for configuration) to ensure a compact repository structure and avoid long command lines during build steps.

1.1. Repository root .

The repository is generally structured as shown below:

Table 1.1 Detailed description of the repository root

Directory Name

Long Name

Content Description

.

Repository root

The repository root contains the license information, installation instructions, a link to the changelog, the main build script

cli

Command line interface

CLI tool to interact with the repository

conf

Configuration

Contains all high level configurations

docs

Documentation

Documentation source files

hardware

Hardware

Hardware schematics and layouts

src

Source

Parent directory for all source files for the BMS embedded software

tests

Tests

Tests for embedded sources, the toolchain, and scripts

tools

Tools

Tools needed to build foxBMS 2 binaries and additional tools to work with foxBMS 2

1.2. fox CLI directory cli

The cli directory is structured as shown below:

Table 1.2 Detailed description of the cli directory

Directory Name

Long Name

Content Description

cmd_*

Command_*

Actual implementation of the specific CLI command

com

Communication

Wrapper for different communication interfaces (e.g., CAN)

commands

Commands

Definition of all CLI commands

db

Database

Light weight battery specific database implementation for foxBMS

helpers

Helpers

Helper functions that are used by several parts of the CLI tool

pre_commit_scripts

pre-commit

Scripts that are run as part of the pre-commit framework

1.3. Configuration directory conf

The conf directory is structured as shown below:

Table 1.3 Detailed description of the conf directory

Directory Name

Long Name

Content Description

bms

Battery Management System

Configuration of the BMS (e.g., which AFE is used)

cc

C compiler

Compiler configuration (e.g., compiler flags)

env

Environment

Environment specifications configuration files (e.g., PATH setup)

hcg

TI HALCoGen

TI HALCoGen configuration files for the Hardware Abstraction Layer

tpl

Templates

Template files for source files

unit

Unit tests

Unit test configuration files

1.4. Documentation directory docs

This directory contains the sources of the general documentation generate by Sphinx. It further contains the configuration for the API documentation generated by Doxygen.

1.5. Hardware directory hardware

This directory contains information about the hardware schematics and layouts.

1.6. Source directory src

The src directory is structured as shown below:

Table 1.4 Detailed description of the src directory

Directory Name

Long Name

Content Description

app

Application

Source files for the BMS application

bootloader

Bootloader

Source files of the bootloader

os

Operating System

Source files of the real time operating system

portable

Portable sources

Source for processor specific code

version

Version information

Definition of embedded version information

1.7. Tests directory tests

The tests directory is structured as shown below:

Table 1.5 Detailed description of the tests directory

Directory Name

Long Name

Content Description

can

CAN

Heuristic tests for the correct implementation of DBC file in the code

ccs

Code Composer Studio

Compiler setup for different CCS versions to compile foxBMS with

cli

Command line interface

Unit tests for the fox CLI tool

c-std

C Standard

Test setup for foxBMS’s C standard detection

dbc

CAN Database

Check the validity of the DBC/SYM files

fox-cmds

fox CLI integration tests

Integration tests for the fox CLI tool

os-information

OS information

Information to search the sources for OS relevant includes, names etc.

pkg

Package build unit tests

Unit tests for the Python package build functionalities

unit

Embedded code unit tests

Unit test code for the embedded code

unit-hw

Embedded code unit tests

Unit test code for the embedded code that need to run on the target

variants

Variants

foxBMS build configurations (for testing in e.g., CI)

waf_tools

Waf tools unit tests

Unit tests for custom foxBMS Waf tool

1.8. Tools directory tools

The tools directory is structured as shown below:

Table 1.6 Detailed description of the tools directory

Directory Name

Long Name

Content Description

cmock

CMock

vendored CMock sources

crc

Cyclic redundancy check

Helper script and information for working with CRC-functions

dbc

CAN database

CAN message and signal description

debugger

Debugger

Debugger setups and usage

ide

Editor/IDEs

Setups for editors and Integrated Development Environments

waf_tools

Waf tools

Waf tools that are not part of vendored Waf

waf

Waf

Waf binary