6. First Steps on Hardware

This section gives a brief walk-through on setting up a debugger connection to a BMS-Master. Aim of this section is to check that all crucial parts of the toolchain work and to recap the process of setting up the toolchain.

Note

In order to be able to develop software for the BMS and deploy it to the embedded target, it is absolutely necessary to have these three components in place:

  • the embedded device itself,

  • a power supply,

  • a debugger.

6.1. Setup

It is assumed, that all required software has been installed. Details on the software installation can be found in Software Installation. Most notable parts of the toolchain are:

  • the Python venv environment,

  • the compiler toolchain,

  • and a debugger.

6.2. Compilation

Details on this step are described in Building the Application. The following steps should pass and result in the application being built.

Note

TI HALCoGen is not available on Linux, and therefore the code generator tool can not run on Linux. Therefore, in order to build on Linux, the build process needs to be run on Windows first, and then the entire directory build/app_embedded/src/app/hal needs to be copied to the Linux machine. These files should be converted to LF. After that Linux builds are possible. This procedure needs to be repeated everytime the HAL configuration files (conf/hcg/app.hcg, conf/hcg/app.dil) are changed.

.\fox.ps1 waf configure build_app_embedded

If any error messages occurs, they have to be investigated before continuing.

6.3. Hardware Setup

For this first setup, it is enough to connect a power supply and a debugger to the BMS-Master. Optionally, a CAN-interface can be connected to the CAN1 connector. To debug or flash the binary file into the hardware, a debugger must also be connected to the BMS-Master. The connection is shown in Fig. 6.1 and the accompanying Table 6.1. More details on the position and type of connectors can be found in Connectors.

|bms-master| connectors

Fig. 6.1 BMS-Master connectors

Table 6.1 BMS-Master connectors description

Connector ID

Functionality

Pinout

J3008

Debugger

Debug Connector

J2009

Supply

Supply

J2000

Smart Power Switch 0 (Contactor 0)

Smart Power Switches

J2002

Smart Power Switch 1 (Contactor 1)

Smart Power Switches

J2003

Smart Power Switch 2 (Contactor 2)

Smart Power Switches

J2004

Smart Power Switch 3 (Contactor 3)

Smart Power Switches

J2006

Smart Power Switch 4 (Contactor 4)

Smart Power Switches

J2007

Smart Power Switch 5 (Contactor 5)

Smart Power Switches

J2008

Smart Power Switch 6 (Contactor 6)

Smart Power Switches

J2010

Smart Power Switch 7 (Contactor 7)

Smart Power Switches

J2033

Interlock

Interlock

J2034

PWM (Insulation Monitoring)

Insulation Monitoring

J2013

RS485

RS485

J2021

CAN 1

CAN1

J2024

CAN 2 (isolated)

CAN2 (isolated)

6.4. Flash/Debug the Application Using the Debugger

Start the TRACE32 software, and click the “Up” button (A) to set the BMS-Master to its “Up” state. After that, click the flash button (B) to flash the foxBMS 2 application.

After the binary is successfully flashed, the user can start the application and debug it using the features of the debugger software. More details on setting up the debugger toolchain can be found in Debugging the Application.