3. Software Installation

Warning

Read the documentation carefully and follow every point exactly as described. Otherwise, the configuration workload in later points of the setup or the development will be significantly higher.

Note

For some installation tasks, batch scripts are provided to automate the installation process as much as possible. However, if you do not want to use these scripts, the manual installation process is also described.

Getting started with foxBMS 2 requires getting the sources and installing all required software dependencies. These are the required steps:

  1. getting the foxBMS 2 sources,

  2. installing the software dependencies:

    1. installing Texas Instruments (TI)’s Code Composer Studio (required for compiling)

    2. installing Texas Instruments (TI)’s HALCoGen (required for code generation)

    3. installing Continuum’s Miniconda (furnishes the Python environment used by foxBMS 2),

    4. installing LLVM (required for code formatting)

    5. installing Ruby and the Ceedling package (required for unit testing)

    6. installing GCC (required for unit testing)

    7. installing Cppcheck (required for static program analysis)

    8. installing VS Code (required for developing)

  3. setting up a development environment

These steps are described below in detail.

3.1. Getting the Sources

The sources are available from a git repository at https://github.com/foxBMS/ in https://github.com/foxBMS/foxbms-2. The following example shows how to clone (see Listing 3.1) or download (see Listing 3.2) the foxBMS 2 sources from GitHub .

In the case that you have been supplied with a “library-project” by a partner, please use this archive equivalent to the “cloned foxBMS 2 repository” in the later steps of this manual.

Warning

If your user name contains whitespace (e.g., vulpes vulpes, you MUST clone or download the repository to another path, that does not contain whitespace, e.g., C:\foxbms-2.

Listing 3.1 Cloning the foxBMS 2 repository
C:\Users\vulpes\Documents>git clone https://github.com/foxBMS/foxbms-2
C:\Users\vulpes\Documents>cd foxbms-2
Listing 3.2 Downloading a release
C:\Users\vulpes\Documents>curl -Ss -L -o foxbms-2-v1.1.2.zip https://github.com/foxBMS/foxbms-2/archive/v1.1.2.zip
C:\Users\vulpes\Documents>tar -x -f foxbms-2-v1.1.2.zip
C:\Users\vulpes\Documents>ren foxbms-2-1.1.2 foxbms-2
C:\Users\vulpes\Documents>cd foxbms-2

Note

Both git and curl require a correct proxy setup. This means that the environment variables http_proxy and https_proxy must be set accordingly to your network configuration.

Warning

Do not clone/download foxBMS 2 into a directory structure that includes whitespace.

Bad

C:\bad directory name\Documents\foxbms-2

Good

C:\Users\vulpes\Documents\foxbms-2

Good

C:\foxbms-2

3.2. Software Prerequisites

General Hint

No software installation here should alter the PATH environment variable. When an installer asks during the setup to add something to PATH, always remove that option, wether it is explicitly mentioned in that step or not. The only exception to that rule MAY be VS Code.

3.2.1. Installing Code Composer Studio

Download Code Composer Studio (CCS) version 10.3.1 and run the installer (chose Windows single file installer for CCS IDE). Do not change the default installation directory chosen by the installer and let the installer proceed with the installation into the installation directory (i.e. C:\ti\... for CCS 10.3.1). Select the Hercules™ Safety MCUs option during the installation.

Installing Code Composer Studio may take a while.

3.2.1.1. Installing HALCoGen

Download HALCoGen version 04.07.01 and run the installer. Do not change the default installation directory chosen by the installer and let the installer proceed with the installation into the installation directory (i.e. C:\ti\... for HALCoGen 04.07.01 that means into C:\ti\Hercules\HALCoGen\v04.07.01).

Installing HALCoGen may take a while.

3.2.2. Installing Miniconda and Configuration

Note

If you already have installed miniconda3 in one of the default miniconda3 installation directories (%USERPROFILE%\miniconda3, %LOCALAPPDATA%\Continuum\miniconda3) or C:\miniconda3 you can skip this installation of miniconda3 and go on to conda configuration

  1. Installation of miniconda3

    Automated Installation

    Manual Installation

    For automated installation of miniconda3 according to foxBMS 2 requirements just run:

    Listing 3.3 Running the automated miniconda3-install.bat installer script for miniconda3
    C:\Users\vulpes\Documents\foxbms-2>tools\utils\miniconda3-install.bat
    

    The manual installation of miniconda3 is described in Manual Miniconda Installation.

  2. conda configuration

    Automated Configuration

    Manual Configuration

    For automated configuration of conda according to foxBMS 2 requirements just run:

    Listing 3.4 Running the automated conda-init.bat configuration script
    C:\Users\vulpes\Documents\foxbms-2>tools\utils\conda-init.bat
    

    Note

    If the script returns Maybe you need to add “foxbms” to your channels list. please follow the instructions at Configuration.

    The manual configuration of conda is described in Manual conda Configuration.

3.2.3. Installing LLVM

Automated Installation

Manual Installation

For automated installation of LLVM according to foxBMS 2 requirements just run (the installer will prompt for privileged installation):

Listing 3.5 Running the automated llvm-install.bat installer script for LLVM
C:\Users\vulpes\Documents\foxbms-2>tools\utils\llvm-install.bat

Download LLVM (version 11.0.1 or greater) from github.com/LLVM and run the installer. Let it install it into C:\Program Files\LLVM\11.0.1. Do not add LLVM to PATH.

3.2.4. Installing Ruby and Required Gems

Automated Installation

Manual Installation

For automated installation of Ruby according to foxBMS 2 requirements just run:

Listing 3.6 Running the automated ruby-install.bat installer script for Ruby
C:\Users\vulpes\Documents\foxbms-2>tools\utils\ruby-install.bat

Add --http-proxy=http://user:password@server:port (adapted to your settings) to the installer script if you are behind a proxy.

The manual installation of Ruby is described in Manual Ruby Installation.

3.2.5. Installing GCC

Note

Installing MinWG64 requires 7-Zip to be installed. 7-Zip can be download from https://7-zip.org/ and should be installed in the default directory.

Automated Installation

Manual Installation

For automated installation of MinGW64 according to foxBMS 2 requirements just run:

Listing 3.7 Running the automated mingw64-install.bat installer script for MinGW64
C:\Users\vulpes\Documents\foxbms-2>tools\utils\mingw64-install.bat

The manual installation of MinGW64 is described in Manual MinGW64 Installation.

3.2.6. Installing Cppcheck

Note

The Cppcheck installer does not support installing different versions of Cppcheck. If there is already some Cppcheck version installed into C:\Program Files\Cppcheck\* this installation must be copied to some temporary folder, and then can be copied back into C:\Program Files\Cppcheck\other-cppcheck-version after the installation has finished.

  1. Download Cppcheck version 2.2 from the project’s GitHub release page.

  2. Install Cppcheck into C:\Program Files\Cppcheck\Cppcheck-2.2-x64 by running the installer.

3.2.7. Installing VS Code and Extensions

foxBMS 2 supports developing with Visual Studio Code (hereinafter code).

  1. Download code from the project website at Visual Studio Code.

  2. Install code: foxBMS 2 recommends installing code with the User Installer, which does not require elevated rights.

  3. Optional: Let the installer add code to the PATH variable.

  4. Install extensions: To get the best development experience the following extensions are recommended. code will list these among the recommended extensions after you have run waf configure.

    Table 3.1 VS Code extensions

    Name

    Marketplace Link

    C/C++

    C/C++ extension

    Python

    Python extension

    Assembler

    ASM extension

    Linker script

    Linker script extension

    Code Spell Checker

    Code Spell Checker extension

    YAML

    YAML extension

    TOML

    TOML extension

    Test Explorer

    Test Explorer extension

    Test Explorer Ceedling

    Test Explorer Ceedling extension

All required software is now installed.

3.3. Development Environment Setup

Open a terminal and navigate into the cloned foxBMS 2 repository and install the development environment. The development environment is installed with the following command:

Listing 3.8 Updating the miniconda environment
C:\Users\vulpes\Documents\foxbms-2>tools\utils\conda-update-env.bat

This scripts creates a development environment inside the miniconda installation.

Note

An update of the foxBMS 2 development environment needs to be done
  • the first time a foxBMS 2 project is setup on a computer.

  • each time a new development environment is released. If that is the case it is mentioned in the Changelog.

OPTIONAL: Verify the miniconda environment by running the following script:

Listing 3.9 Verifying the miniconda environment
C:\Users\vulpes\Documents\foxbms-2>tools\utils\cmd\run-python-script.bat tests\env\packages_test.py -f tests\env\conda_env_win32.json

If all the indicated steps have been followed, at this point all the required dependencies have been installed/updated.

3.4. Debugger toolchain setup

For the development of an embedded system both a way of downloading the software into the target and debugging the running software in the target is necessary. Since the setup is highly dependent on the selected toolchain, this manual does not give any details on the installation of such a debugger toolchain. The manuals of the tool vendors are exhaustive on the topic of installation and setup.

More details on the selection and usage of debugger toolchains can be found in Debugging the Application.

3.5. Optional: CAN-Driver installation

One way of communicating with the BMS is through the CAN protocol. The toolchain of foxBMS 2 is targeted on the usage of CAN interfaces of the PCAN series by PEAK System. In order to use these probes, the required driver has to be downloaded from the website of the vendor.

When installing, please make sure that the option for “PCAN-Basic API” is selected, as this is required for the foxBMS 2 GUI application.