6. Build Process
This section addresses relevant steps in the build process that are important to know when interacting with it.
6.1. Checking Database Entries
The build process automatically checks instances of database entries if they
are correctly initialized. For correct operation of the database functions
it is vital that each variable representing a database table has its member
header
set to the correct value. For more information on the usage of the
database module please refer to Section 4.7.
In case that the declaration and definition of a variable for a database table
does not match the required pattern, the build process will fail with an
error message that guides into the direction of a fix for the issue.
Listing 6.1 shows an
example where the variable mrc_tableCellVoltages
of type
DATA_BLOCK_CELL_VOLTAGE_s
has been initialized with a wrong header element.
This failure is reported by the build system.
1 C:\Users\vulpes\Documents\foxbms-2\src\app\application\redundancy\redundancy.c:71 uses database variable mrc_tableCellVoltages (type: 'DATA_BLOCK_CELL_VOLTAGE_s') without correct initialization.
2
3 Something like
4
5 DATA_BLOCK_CELL_VOLTAGE_s mrc_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE};
6 or
7 DATA_BLOCK_CELL_VOLTAGE_s mrc_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE_BASE};
8 or
9 DATA_BLOCK_CELL_VOLTAGE_s mrc_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANCY0};
10
11 is required, where the ID is from typedef enum DATA_BLOCK_ID_e.
12 Details: Regex
13 ^[\s]{0,}(?:static[\s]{1,}|extern[\s]{1,})?[\s]{0,}DATA_BLOCK_([A-Z_0-9]{1,})_s[\s]{1,}([A-za-z0-9_]{0,})[\s]{0,}=[\s]{0,}\{[\s]{0,}(\.header\.uniqueId)[\s]{0,}=[\s]{0,}(DATA_BLOCK_ID_)(CELL_VOLTAGE)(_BASE|_REDUNDANCY[0-9]{1,})?[\s]{0,}\}[\s]{0,};[\s]{0,}$
14 did not match on
15 static DATA_BLOCK_CELL_VOLTAGE_s mrc_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_MIN_MAX};
6.2. Building the Analog Front-End Library
In order to easily switch between different AFEs the foxBMS 2 build system implements a mechanic for swapping implementations through a configuration file. The configuration file is described in Section 1.2.
The build system will automatically select the correct driver files depending on the configuration.
6.3. External Libraries
A How-to is found in How to Build A Library and Link it in a foxBMS 2 Project.
6.4. SWI Aliases
The build process automatically generates a list of the SWI-alias and function name mapping. It is found in variant build directory.
It is used as follows:
bld(
features="swi-check",
files=bld.path.ant_glob("src/**/*.c src/**/*.h"),
jump_table_file=bld.path.find_node(
"src/os/freertos/portable/ccs/arm_cortex-r5/portasm.asm"
),
)
For implementation details see f_ti_arm_cgt.get_swi_aliases()
and
f_ti_arm_cgt.print_swi_aliases()
.