CMSIS-Build  Version 0.9.0 (beta)
Tools, software frameworks, and work flows for productivity with CMSIS based projects
 All Pages
Command Line Build

The following bash scripts and command line tools can be used for managing the build of CMSIS Projects from the command line. These scripts can be easily adopted to specific environments and are intended as a minimal reference. CMSIS-Build tools are available for download as an asset of the respective CMSIS Release Version (starting 5.7.0 e/o April 2020).

For command line build with software packs, the following tools and utilities are provided.

Tool / Script Description
cbuild_install.sh Setup of the CMSIS command line build environment
cbuild.sh Start the overall command line build process
cp_init.sh Create an empty directory for storing software packs in CMSIS-Pack format
cbuildgen Create Make files and manage software layers
make GNU Make utility to generate binary images and update configuration files
cp_install.sh Download and install software packs
ccmerge Merge project specific setup to a new version of a configuration file
cbuild_uv.sh Export MDK project targets and run a command line build process
Note
For the above command line build tools and scripts a Bash environment is required. For Windows, install for example git for Windows which includes Git Bash.

The following usage example assumes that the Setup Build Environment is already completed.

Usage Example

Open a Bash console and choose a the directory that contains a project and setup the command line build environment:

$ source /c/cbuild/setup

Create an empty directory for storing software packs (this not required when existing pack directory is re-used):

$ cp_init.sh

Start the build process for a existing project file:

$ cbuild.sh MyProject.cprj

Below is the output that shows a successful build:

(cbuild.sh): Build Invocation 0.9.0 (C) 2020 ARM
MyProject.cprj validates
(cbuildgen): Build Process Manager 0.9.0 (C) 2020
M654: URL 'https://www.keil.com/pack/ARM.CMSIS.5.6.0.pack' was added to the list of missing packages.
M650: Command completed successfully.
(cp_install.sh): Install Packs 0.9.0 (C) 2020 ARM
info: reading file: MyProject.cp_install
dos2unix: converting file MyProject.cp_install to Unix format...
https://www.keil.com/pack/ARM.CMSIS.5.6.0.pack
######################################################################## 100.0%
info: ARM.CMSIS.5.6.0.pack installing into /c/Projects/Packs/ARM/CMSIS/5.6.0
pack installation completed successfully
(cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM
M653: Local config file RTE/Device/ARMCM0/ARMCM0_ac6.sct was not found. Copying default file from package.
M653: Local config file RTE/Device/ARMCM0/startup_ARMCM0.c was not found. Copying default file from package.
M653: Local config file RTE/Device/ARMCM0/system_ARMCM0.c was not found. Copying default file from package.
M651: Generated makefile for merging config files: 'MyProject_cfg.mak'
M652: Generated makefile for project building:'MyProject.mak'
mkdir -p "/c/Projects/MyProject/Objects/RTE/Device/Startup/C Startup"
mkdir -p "/c/Projects/MyProject/Objects/Source"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang"  @"/c/Projects/MyProject/Objects/Source/MyMain.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang"  @"/c/Projects/MyProject/Objects/RTE/Device/Startup/C Startup/startup_ARMCM0.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang"  @"/c/Projects/MyProject/Objects/RTE/Device/Startup/C Startup/system_ARMCM0.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armlink" --via="/c/Projects/MyProject/Objects/MyBinary.axf._ld"
cbuild.sh finished successfully!