CMSIS-Build  
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 among Open-CMSIS-Pack devtools releases.

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).
  • 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

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.

Compiler Configuration

cbuildgen uses toolchain specific .cmake files that map the CMSIS project settings to the toolchain. For each supported toolchain a .cmake file 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/AC6.6.16.0.cmake

# This file maps the CMSIS project options to toolchain settings.
#
# - Applies to toolchain: Arm Compiler 6.16.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 .cmake file in the project directory. If the toolchain specific .cmake file is not present there, it uses the directory where executables are placed.

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