foxBMS 2 - 1.12.0 Logo

Introduction

  • 1. Motivation
  • 2. Naming Conventions
  • 3. The foxBMS 2 Platform
  • 4. Use Case

Getting Started

  • 1. Repository Structure
  • 2. Software Installation
  • 3. fox CLI Basics
  • 4. Creating a Workspace
  • 5. First Steps on Hardware

Software Documentation

  • 1. Configuration
  • 2. Building the Application
  • 3. Software Structure
  • 4. Software Modules
  • 5. Unit Tests
  • 6. Build Environment
  • 7. How-to
    • 7.1.1. How to Use the CAN Module
    • 7.1.2. Using the f_Debug CAN Message
    • 7.1.3. f_Debug
    • 7.1.4. f_DebugResponse
    • 7.1.5. How to Use the Diagnosis Module
    • 7.1.6. How to Use the Database Module
    • 7.1.7. How to Use the FTASK Module
    • 7.1.8. How to Use assertions
    • 7.1.9. How to Implement an Analog Front-End Driver
    • 7.1.10. How to Implement a New Temperature Sensor Driver
    • 7.1.11. How to reach STANDBY state
    • 7.1.12. How to recalibrate the SOC
    • 7.1.13. How to reinitialize NVRAM
    • 7.1.14. How to reset deep-discharge flag
    • 7.1.15. How to update the foxBMS 2 application using the bootloader
    • 7.1.16. How to use the Contactor module
    • 7.2.1. How to Write State Machines
    • 7.2.2. How to Use Generated Sources from HALCoGen
    • 7.2.3. How to use Unit Tests
    • 7.2.4. Linux specific Usage
    • 7.2.5. Unit Test Macros
    • 7.2.6. How to Build a Library and Link it in a foxBMS 2 Project
    • 7.2.7. How to Test TCP/IP
    • 7.2.8. How to Implement an Ethernet Port
    • 7.2.9. How to configure SPI for multi string support
  • 8. Linker Script
  • 9. Bootloader

Hardware Documentation

  • 1. Design Resources
  • 2. Connectors
  • 3. BMS-Masters Overview
  • 4. BMS-Slaves Overview
  • 5. BMS-Interfaces Overview

System Documentation

  • 1. System Introduction
  • 2. System Voltage And Current Monitoring
  • 3. BMS Startup
  • 4. Precharging
  • 5. IMD Testing
  • 6. Communication

System Setup

  • 1. System Setup
  • 2. Communication via CAN

Build Process

  • 1. Build Process
  • 2. Entry Point
  • 3. Waf Tools

Tools Documentation

  • 1. fox CLI Usage
  • 2. Debugging the Application
  • 3. TI HALCoGen Tool

Developer Manual

  • 1. Preface
  • 2. Style Guide
  • 3. Software Developer Manual
  • 4. Hardware Developer Manual
  • 5. Developing fox CLI
  • 6. Dependency Management

General Information

  • 1. License
  • 2. Changelog
  • 3. Releases
  • 4. Safety
  • 5. Abbreviations and Definitions
  • 6. Acknowledgements
  • 7. Bibliography
  • 8. Team
foxBMS 2 - 1.12.0
  • 7. How-to
  • 7.2.6. How to Build a Library and Link it in a foxBMS 2 Project
  • View page source

7.2.6. How to Build a Library and Link it in a foxBMS 2 Project

Sometimes source code can not be shared between parties. For these cases the foxBMS 2 project provides a mechanism to ship a minimal development project to the other party. This allows the partner to build a static library. This library and the accompanying headers can then be shared with the partner and be included in the application.

The following example describes the workflow. In this scenario Partner A develops on foxBMS 2 while Partner B should only provide a library to Partner A.

7.2.6.1. Bootstrapping a minimal development Project

  • Partner A bootstraps a minimal development project. This minimal project is named library-project.tar.gz.

    .\fox.ps1 waf configure
    .\fox.ps1 waf bootstrap_library_project
    
    ./fox.sh waf configure
    ./fox.sh waf bootstrap_library_project
    
    ./fox.sh waf configure
    ./fox.sh waf bootstrap_library_project
    
  • Partner A shares the archive library-project.tar.gz with Partner B.

7.2.6.2. Building a Library

  • Partner B installs a TI Code Composer Studio as described in Install TI Code Composer Studio.

  • Partner B installs a Python environment as described in Software Installation.

  • Partner B builds a library by adding sources etc. to the minimal project as needed and builds the library.

  • Partner B extract the archive

  • Partner B builds the library

    .\fox.ps1 waf configure
    .\fox.ps1 waf build
    
    ./fox.sh waf configure
    ./fox.sh waf build
    
    ./fox.sh waf configure
    ./fox.sh waf build
    
  • Partner B shares the library and accompanying headers with Partner A.

7.2.6.3. Including the Library

  • Partner A copies the provided library and headers to a suitable location.

  • Partner A updates the include path for headers and search path for libraries in the build configuration by updating INCLUDES and STLIBPATH.

  • Partner A adds a configuration step that make the library available for linking by using conf.check_cc(stlib=<lib-name>", uselib_store="<reference>").

  • Partner A can now use functions etc. from the library by including the headers and linking against the library by adding <reference> to the use parameter in the build step that requires the library.

  • Partner A configures and builds the application as usual.

    .\fox.ps1 waf configure
    .\fox.ps1 waf build_app_ti_arm_cgt
    
    ./fox.sh waf configure
    ./fox.sh waf build_app_ti_arm_cgt
    
    ./fox.sh waf configure
    ./fox.sh waf build_app_ti_arm_cgt
    
  • If the build is successful, the external library is correctly linked into the foxBMS 2 application.

A working minimal example of a library and its integration into the project can be found in tests/variants/lib-build.

Fork me on GitHub
Previous Next

© Copyright 2010 - 2026, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. All rights reserved. See license section for further information..

Built with Sphinx using a theme provided by Read the Docs.