Reading time: | 15 min |
Last updated: | 22 Aug 2023 |
Reading time: |
15 min |
Last updated: |
22 Aug 2023 |
This guide is intended to get you up and running with this tool quickly with the most common settings. For a thorough review of all options, refer to the official documentation.
CMSIS-Build is a component of the CMSIS-Toolbox.
For most users, it is recommended to install the complete toolbox package.
See the CMSIS-Toolbox Install Guide .
CMSIS-Build is a set of tools to enable IDEs and command-line tools to share the same projects.
Historically, IDEs have maintained project information in files which are unique to the IDE. Command line users often use tools such as make and cmake to capture project build information.
CMSIS-Build unifies project information, making it easy to share between IDEs and command line tools. Keil MDK projects can be can be used from the Linux command line.
The instructions below cover how to install, configure, and use CMSIS-Build from the Linux command line. This is useful for developers who prefer Linux and for automated testing driven by scripts on Linux.
CMSIS-Build is developed on GitHub and is part of the Open-CMSIS-Pack project .
Follow the instructions below to install CMSIS-Build on a Linux machine.
The install instructions are for Ubuntu or Debian Linux, and are the same for the Arm and x86_64 architectures.
Use the uname
command to identify your architecture:
uname -m
Output values can be aarch64
or x86_64
CMSIS-Build has the following prerequisites:
Install the prerequisites.
sudo apt update
sudo apt install cmake ninja-build -y
The minimum cmake
version is 3.18
Print the cmake
version:
cmake --version
If the cmake
version from the Linux package manager is less than 3.18 it can be upgraded to a newer version using snap
.
sudo apt remove cmake -y
sudo snap install cmake --classic
Download the latest install file from GitHub. Downloads are provided in the Releases area
The current version is 1.5.0.
wget https://github.com/Open-CMSIS-Pack/devtools/releases/download/tools%2Fbuildmgr%2F1.5.0/cbuild_install.sh
To install, run the downloaded cbuild_install.sh
script.
To interactively answer the questions from the installer run the script and respond to the prompts.
bash ./cbuild_install.sh
The default installation directory is ./cbuild
Change the installation directory as needed.
The default location for storing CMSIS-Packs is $HOME/.cache/arm/packs
All of the compilers are not necessary, just accept the defaults for compilers which are not needed.
At the end of the installer a message is displayed to source the setup file.
The path will be different based on your selections.
source /home/ubuntu/cbuild/etc/setup
The command to source the setup file can be added to .bashrc
or .profile
To change any settings after installation, modify the etc/setup
file.
To adjust compiler settings after installation, modify the .cmake
files in etc
. These files contain paths and other settings for each compiler.
To automate installation a text file with answers can be passed to cbuild_install.sh
The inputs are:
The input file can be created manually with an editor. Each line in the file represents an input to an interactive prompt. Leave a blank line to accept the default for a prompt.
If the input file creation also needs to be automated use the command below and enter the input for each prompt or leave a blank line to accept the default.
cat <<EOF >>cmsis.input
./ctools
$HOME/packs
$HOME/ArmCompilerforEmbedded6.19
EOF
Make sure the directory for the CMSIS Packs exists before running the install.
Run the installer with the input file:
bash ./cbuild_install.sh < cmsis.input
Source the setup file using the location specified in the cmsis.input
file:
source /home/ubuntu/ctools/etc/setup
CMSIS-Build is open source and freely available for use. No licenses need to be set up for use. Compilers, such as Arm Compiler for Embedded, invoked by CMSIS-Build may require a license.
Test CMSIS-Build by building a simple example.
The executables included in CMSIS-Build are cbuild.sh , cbuildgen and cpackget . Refer to the documentation for more details.
Confirm CMSIS-Build is installed correctly by building a Blinky example.
Get the Blinky example for the NXP LPCXpresso55S69 board.
git clone https://github.com/Arm-Examples/Blinky_LPCXpresso55S69_RTX.git
cd Blinky_LPCXpresso55S69_RTX
Build it using cbuild.sh
to confirm CMSIS-Build and the compiler are installed and working.
cbuild.sh Blinky.cprj --packs
The necessary CMSIS Packs will be installed and the project will be compiled.
If all goes well Objects/image.axf
will be produced and no errors will occur.
You are ready to use CMSIS-Build for your projects.
How would you rate the overall quality of this tool quick-install guide?
What is the primary reason for your feedback ?
Thank you. We're grateful for your feedback on how to improve this tool quick-install guide.