CMSIS-Build  Version 0.10.0 (beta)
Tools, software frameworks, and work flows for productivity with CMSIS based projects
 All Pages
Setup Script for the Build Environment

The command line build environment for projects that are based on the CMSIS-Pack standard requires:

  • Required: Bash for script execution.
  • Optional: xmllint for XML schema verification.

With most Linux distributions these tools are already available. The installation for Windows is explained below.

Required for Windows: Bash

Invocation

CMSIS-Build tools are available for download as an asset of the respective CMSIS Release Version (starting with 5.7.0).

To install the command line build environment start from the Bash prompt:

$ ./cbuild_install.sh

This install script queries for:

  • Directory for the installation of the CMSIS command line build tools (default ./cbuild).
  • When Keil MDK is installed, enter the base directory of the MDK installation (default /c/Keil_v5).
  • Directory to store the content of the software packs in CMSIS-Pack format.

Environment Variables

The file ./cbuild/etc/setup configures the CMSIS command line build environment. It contains the following section that should reflect the actual installation.

File: ./cbuild/etc/setup

############### EDIT BELOW ###############
export CMSIS_PACK_ROOT=/C/Users/myname/AppData/Local/Arm/Packs
export CMSIS_COMPILER_ROOT=/C/myname/cbuild
export MDK_ROOT=/C/Keil_v5

The file ./cbuild/etc/setup is used to setup environment variables in Bash using the source command:

$ source ./cbuild/etc/setup


Variable Description
$CMSIS_PACK_ROOT Directory that contains the software packs in CMSIS-Pack format.
$CMSIS_COMPILER_ROOT Directory that contains the Compiler Configuration.
$CMSIS_BUILD_ROOT Base directory of the CMSIS command line build tools.
$MDK_ROOT Base directory of the MDK installation (optional).

Compiler Configuration

cbuildgen uses toolchain specific .mak files that map the CMSIS project settings to the toolchain. For each supported toolchain a .mak files is provided in the directory ./cbuild/etc and specifies the base directory of the toolchain installation(TOOLCHAIN_ROOT). In addition other toolchain specific environment variables may be setup here (e.g. license file and product variant). The user is required to update the these settings after installation to reflect the actual installation.

Example file: ./cbuild/etc/ARMCC.6.13.1.mak

# Version: 0.10.0
# Date: 2020-09-30
# This file maps the CMSIS project options to toolchain settings.
#
# - Applies to toolchain: ARMCC 6.14.0
#
############### EDIT BELOW ###############
# Set base directory of toolchain
TOOLCHAIN_ROOT:=C:/Keil_v5/ARM/ARMCLANG
############ DO NOT EDIT BELOW ###########

The toolchain for compilation is defined in project file *.cprj and used by cbuildgen. cbuildgen first searches for the toolchain specific .mak file in the project directory. If the toolchain specific .mak file is not present there, it uses the directory that is specified by the $CMSIS_BUILD_ROOT environment variable.

libxml (optional for Windows)

For Windows the libxml provides an XML processor that provides the functionality of xmllint.

Note
The installation is optional and not required to run the command line build tools.

Download the following ZIP files:

  • iconv-1.9.2.win32.zip
  • libxml2-2.7.8.win32.zip
  • libxmlsec-1.2.18.win32.zip
  • zlib-1.2.5.win32.zip

Extract the /bin directory of each ZIP file to a directory, for example C:\xmllint and add this directory to the Windows PATH environment variable.

Note
Restart the Git Bash after changing the PATH environment variable.
When xmllint is not installed, the XML schema verification is skipped by the cbuild.sh script.

xmllint is also provided by the xsltproc package that can be installed via Chocolatey:

> choco install xsltproc