/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page CmdLineBuild 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 | |:--------------------------------------------|:----------------------------------------------------------------------------| | \subpage cbuild_install "cbuild_install.sh" | Setup of the CMSIS command line build environment | | \subpage cbuild "cbuild.sh" | Start the overall command line build process | | \subpage cp_init "cp_init.sh" | Create an empty directory for storing software packs in CMSIS-Pack format | | \subpage cbuildgen "cbuildgen" | Create Make files and manage software layers | | \subpage Make "make" | GNU Make utility to generate binary images and update configuration files | | \subpage cp_install "cp_install.sh" | Download and install software packs | | \subpage ccmerge "ccmerge" | Merge project specific setup to a new version of a configuration file | | \subpage cbuild_uv "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 \ref cbuild_install 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: \code $ source /c/cbuild/setup \endcode Create an empty directory for storing software packs (this not required when existing pack directory is re-used): \code $ cp_init.sh \endcode Start the build process for a existing project file: \code $ cbuild.sh MyProject.cprj \endcode Below is the output that shows a successful build: \verbatim (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! \endverbatim */ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page cbuild_install Setup Build Environment The command line build environment for projects that are based on the CMSIS-Pack standard requires: - Required: Bash for script execution. - Optional: \ref libxml "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 - git for Windows includes Git Bash which is easy to download and install. \section cbuild_install2 cbuild_install.sh: Install Build Tools CMSIS-Build tools are available for download as an asset of the respective CMSIS Release Version (starting 5.7.0 e/o April 2020). To install the command line build environment start from the Bash prompt: \code $ ./cbuild_install.sh \endcode 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. \section cbuild_envsetup 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 \code ############### 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 \endcode The file ./cbuild/etc/setup is used to setup environment variables in Bash using the source command: \code $ source ./cbuild/etc/setup \endcode | Variable | Description | |:------------------------|:-----------------------------------------------------------------| |\c $CMSIS_PACK_ROOT | Directory that contains the software packs in CMSIS-Pack format. | |\c $CMSIS_COMPILER_ROOT | Directory that contains the \ref cbuild_compiler_config. | |\c $CMSIS_BUILD_ROOT | Base directory of the CMSIS command line build tools. | |\c $MDK_ROOT | Base directory of the MDK installation (optional). | \section cbuild_compiler_config Compiler Configuration The CMSIS \ref 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 \code # Version: 1.0.0 # Date: 2020-02-11 # This file maps the CMSIS project options to toolchain settings. # # - Applies to toolchain: ARMCC 6.13.1 # ############### EDIT BELOW ############### # Set base directory of toolchain TOOLCHAIN_ROOT:=/C/Keil_v5/ARM/ARMCLANG # Licensing #export ARMLMD_LICENSE_FILE=todo #export ARM_PRODUCT_DEF=$(TOOLCHAIN_ROOT)/../../mappings/gold.elmap ############ DO NOT EDIT BELOW ########### \endcode The toolchain for compilation is defined in project file *.cprj and used by \ref cbuildgen. The \ref 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 \b $CMSIS_BUILD_ROOT environment variable. \section libxml 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 \b /bin directory of each ZIP file to a directory, for example \b C:\\xmllint and add this directory to the Windows PATH environment variable. \note Restart the Git Bash after changing the PATH environment variable. \note When xmllint is not installed, the XML schema verification is skipped by the \ref cbuild "cbuild.sh" script. xmllint is also provided by the xsltproc package that can be installed via Chocolatey: \code > choco install xsltproc \endcode */ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page cp_init cp_init.sh: Setup Pack Directory The \ref cp_init "cp_init.sh" script is used to setup a build environment from scratch. It is called from the \b Bash command line with the following syntax: \code cp_init.sh [] \endcode \b Where: \c cp_init.sh is the name of the script. <\c pack-directory> specifies the directory where software packs should be stored. If not specified, the $CMSIS_PACK_ROOT directory is used. The \b cp_init.sp script downloads the public CMSIS-Pack index file from https://www.keil.com/pack/index/pidx and stores this catalog file in pack directory under ./Web. This file is used by \ref cbuildgen to find the latest version of the public software packs. \section cp_init_example Usage Example \verbatim $ cp_init.sh ./packrepo (cp_init.sh): Setup Pack Directory 0.9.0 (C) 2020 ARM info: reading directory: ./packrepo downloading package index file from ######################################################################## 100.0% pack repository created successfully Please setup environment variable CMSIS_PACK_ROOT to: /c/cbuild/packrepo \endverbatim \section cp_init_errors Error Messages
Type Message Action
ERROR error: no argument passed and CMSIS_PACK_ROOT environment variable not set See usage and correct the argument.
ERROR error: more than one command line argument passed See usage and correct the argument.
ERROR error: directory already exists. Cannot create new pack repository See usage and correct the argument.
ERROR error: index.pidx download failed Check internet connection and server availability.
ERROR error: downloaded file is not an xml file Check downloaded file.
INFO info: no argument passed - using CMSIS_PACK_ROOT environment variable For information only.
INFO pack repository created successfully For information only.
*/ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page cbuild cbuild.sh: Build Invocation The \ref cbuild "cbuild.sh" script starts the build process. It is called from the \b Bash command line with the following syntax: \code $ cbuild.sh .cprj [--toolchain= --output= ] \endcode \b Where: \c cbuild.sh is the name of the script. <\c ProjectFile> specifies the project file in CMSIS project format. Optional: <\c Toolchain> specifies the selected toolchain for projects that support multiple compilers. <\c OutputPath> specifies the output directory. <\c MakefileTarget> specifies the <\c target> option for \ref Make "make". The \ref cbuild script implements the build flow by chaining the utilities \ref cbuildgen "cbuildgen", \ref ccmerge "ccmerge", and Make. It replicates the build steps of CMSIS-Pack aware IDEs and also updates configuration files if necessary. The script can be adopted to project specific requirements. The build flow of the \ref cbuild script is: 1. Call \ref cbuildgen with command \b packlist to list the URLs of missing software packs. 2. Call \ref cp_install to download and install missing software packs. 3. Call \ref cbuildgen with command \b make to generate Make files. 4. Call \ref Make to update configuration files using \ref ccmerge. 5. Call \ref Make to compile the project source code into the binary image. \section cbuild_example Usage Example \verbatim $ cbuild.sh Simulation.cprj (cbuild.sh): Build Invocation 0.9.0 (C) 2020 ARM Simulation.cprj validates (cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM M650: Config command completed successfully. (cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM M651: Generated makefile for merging config files: 'Simulation_cfg.mak' M652: Generated makefile for project build:'Simulation.mak' mkdir -p "/c/Examples/Blinky/Objects/RTE/CMSIS/RTOS2/Keil RTX5/Library" mkdir -p "/c/Examples/Blinky/Objects/RTE/Compiler/IO/STDOUT/ITM" mkdir -p "/c/Examples/Blinky/Objects/RTE/Device/Startup/C Startup" mkdir -p "/c/Examples/Blinky/Objects/Source Files" "/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/CMSIS/RTOS2/Keil RTX5/Library/RTX_Config.o._cc" "/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/CMSIS/RTOS2/Keil RTX5/Library/rtx_lib.o._cc" "/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/Compiler/IO/STDOUT/ITM/retarget_io.o._cc" "/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/Device/Startup/C Startup/startup_ARMCM3.o._cc" "/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/Device/Startup/C Startup/system_ARMCM3.o._cc" "/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/Source Files/Blinky.o._cc" "/C/Keil_v5/ARM/ARMCLANG/bin/armlink" --via="/c/Examples/Blinky/Objects/Blinky.axf._ld" Program Size: Code=7516 RO-data=1264 RW-data=168 ZI-data=9084 cbuild.sh finished successfully! \endverbatim \section cbuild_errors Error Messages
Type Message Action
ERROR error: missing required argument <\c project>.cprj See usage and correct the argument.
ERROR error: CMSIS_BUILD_ROOT environment variable not set Set \ref cbuild_envsetup.
ERROR make ${output}${project}_cfg.mak failed! Check make error messages.
ERROR make ${output}${project}.mak failed! Check make error messages.
INFO cbuild.sh finished successfully! For information only.
*/ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page cbuildgen cbuildgen: Build Process Manager The \ref cbuildgen "cbuildgen" is the core tool for the build process. It is called from the \b Bash command line with the following syntax: \code cbuildgen .cprj [options] \endcode Where: \c cbuildgen is the name of tool. <\c command> specifies the operation of \c cbuildgen (see table below). Only one command is permitted per invocation. <\c ProjectFile> is the name of the project file. The file extension (.cprj) is mandatory. [\c options] are additional parameters that control the operation (see table below). Note: available options are specific for each command. \b Commands
<command> Description Details
packlist List missing packs Check the current list of installed packs in the directory \c $CMSIS_PACK_ROOT. The URLs of missing packs are written to <ProjectFile\>.cp_install file.
make Generate makefile(s) Generates <ProjectFile\>.mak for \ref Make "Make" required to build the project. When used with option --merge it generates also <ProjectFile>_cfg.mak for \ref Make "Make" to update configuration files. This command also generates a ASCII log file <ProjectFile\>.clog recording location and version of the selected toolchain, packs, components and config files. The option --output specifies the destination folder of the generated files. The location of the <ProjectFile\>.cprj is used if --output is not specified.
extract Extract layer from project Creates a sub directory named \c ./Layer/\/ for each layer described in <ProjectFile\>.cprj. These folders contain a layer description file \.clayer and the project and configuration files belonging to the layer. The option --layer=\ selects a specific layer by name. This option can be specified multiple times to select multiple layers.
remove Remove layer from project Updates the <ProjectFile\>.cprj removing the layer description as well as all associated files and components for the layers specified at the command line. The command deletes the associated files from the respecctive project directory. The option --layer=\ selects a specific layer by name and is mandatory. This option can be specified multiple times to remove multiple layers.
compose Create new project Create new <ProjectFile\>.cprj from layer files ([...]\.clayer) as well as copying associated files. One or more clayer files are required.
add Add layer to project Updates the <ProjectFile\>.cprj adding the layer description as well as all associated files and components for the clayer files specified at the command line. The command copies the associated files from the layer directory into the project directory. One or more clayer files are required.
\b Options
[option] Description Details
\--merge Update configuration files When used with the command \c make, it generates also <ProjectFile>_cfg.mak for \ref Make "Make" to update configuration files using \ref ccmerge (used by command: make).
\--toolchain=<compiler> Specify toolchain For projects that can be build with multiple toolchains, it defines the toolchain for the build (used by command: make).
\--output=<directory> Specify output directory Specifies the directory for the generated files *.mak files and the base directory for intermediate output from build. (used by command: make).
\--layer=\ Specify layer name Specifies the name of the layer (used by commands: remove and extract).
\/\.clayer Specify layer file Specifies the directory and filename of the project layer (used by commands: add and compose).
The \ref cbuildgen uses information from the CMSIS project file *.cprj, software packs, and environment variables. - The *.cprj file lists all software packs (optionally with version), configuration files, and user files along with toolchain specific options. - The software packs are used to get source and include files of software components. The location of software packs is defined with the environment variable $CMSIS_PACK_ROOT. - The version of configuration files is specified in project file *.cprj and related software packs are used to update it. - Device information is read from the device family pack (DFP) that defines the device. - Command line options for a toolchain is used from the \.\.mak file, if not present in the project file directory, the $CMSIS_COMPILER_ROOT is used. The \.mak file includes two additional makefiles: - include ${CMSIS_BUILD_ROOT}/etc/Whitespace.mak for handling of white space characters in filenames. - include ${CMSIS_COMPILER_ROOT}/\.\.mak that specifies default options for the toolchain. Note: cbuildgen does not update the *.cprj for commands packlist, make and extract. The merge tool updates the outdated configuration files with new merged data, keeping a copy of the original file. \section cbuild_example Usage Example \verbatim $ cbuildgen packlist Simulation.cprj (cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM M654: URL 'http://www.keil.com/pack/ARM.CMSIS.5.6.0.pack' was added to the list of missing packages. M654: URL 'http://www.keil.com/pack/Keil.ARM_Compiler.1.6.1.pack' was added to the list of missing packages. M650: Command completed successfully. $ cbuildgen make Simulation.cprj (cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM M651: Generated makefile for merging config files: 'Simulation_cfg.mak' M652: Generated makefile for project build:'Simulation.mak' \endverbatim \section cbuildgen_errors Error Messages
Message Number Type Description Action
M200 ERROR Invalid arguments! At least one argument is wrong. See usage and correct the argument.
M201 ERROR Too many arguments! There is more arguments passed than allowed. See usage and correct the command line.
M202 ERROR No CPRJ input file was specified A *.cprj file is not provided as an argument.
M203 ERROR Error reading file(s) ...! The listed file could not be read. Check file content.
M204 ERROR File not found: ...! The listed file was not found.
M205 ERROR $CMSIS_PACK_ROOT environment variable is not defined! The tool requires the environment variable $CMSIS_PACK_ROOT to locate the CMSIS Packs.
M206 ERROR No command was specified! The tool requires a command. See usage information for available commands (e.g. config, make)
M207 ERROR Multiple commands were specified! More than one command was provided in arguments. A single command is required.
M208 ERROR Error copying file ...! The specified file could not be copied and will be missing during build.
M500 ERROR RTE Model reports: MSG Error while preparing data. See message for more details.
M502 ERROR RTE Model reports: \#error NUM: NAME : MSG Additional software components required.
M504 ERROR RTE Model reports: MISSING: – SPACE NAME Add the missing component.
M600 ERROR Package index was not found in 'PATH/.Web Check the package repository.
M601 ERROR Package 'VENDOR.NAME' was not found in package index! Check the package repository.
M602 ERROR Package 'VENDOR.NAME.VER' was not found! Check the package repository.
M603 ERROR No version of package 'VENDOR.NAME' was found! Check the package repository.
M604 ERROR Unresolved package component: 'CMP' Check project description file.
M605 ERROR Wrong CPRJ specification! Check project description file.
M606 ERROR Device 'DEV (VENDOR)' was not found! Check project description file.
M607 ERROR RTE Model construction failed! The CMSIS-Pack engine reports an error message.
M608 ERROR No toolchain configuration file for 'NAME' version 'VER" was found! Check CMSIS_COMPILER_ROOT or add the required toolchain configuration file to the project directory.
M609 ERROR Missing 'NAME' element in CPRJ file! Check project description file.
M610 ERROR Project supports multiple toolchains. Select one with the option --toolchain See usage and correct the argument.
M611 ERROR Selected toolchain is not supported by the project Check project description file or command line arguments.
M630 WARNING Device ... is substituted by device variant ... . Instead of the device specified by the project a variant found for this device is used.
M650 INFO Setup run successfully For information only./td>
M651 INFO Generated makefile for merging config files: ... For information only.
M652 INFO Generated makefile for project build:'%NAME%.mak' For information only.
M653 INFO Local config file ... was not found. Copying default file from package. Please validate whether the config file is intentionally missing. The default config file may be missing project specific settings.
M654 INFO URL ... was added to the list of missing packages. For information only.
M655 INFO CMSIS_COMPILER_ROOT environment variable was not set! For information only.
M656 INFO Package 'VENDOR.NAME.VER' was found in local repository 'PATH'! For information only.
*/ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page ccmerge ccmerge: Config File Updater The \ref ccmerge "ccmerge" tool supports the update process for configuration files that use Configuration Wizard Annotations. The tool takes the configuration file located in the CMSIS Pack (pfile) and merges the configuration information extracted from the configuration file located in the current project (cfile). If the merge succeeds the result is written to 'cfile' after a copy of 'cfile' has been stored as 'cfile.nnnn'. It is called from the \b Bash command line with the following syntax: \b ccmerge has the following command invocation: \code ccmerge -pfile -cfile [-merge] [-details] \endcode \ref ccmerge "ccmerge" helps to update the setup of software components as it merges options from a previous configuration file version to a new version.
Option Description
-pfile <name_of_pack_cfgfile> File path of the configuration file from a pack
-cfile <name_of_current_cfgfile> File path of the current config file in a project
-merge Execute merge: the current 'cfile' will be saved as 'cfile.nnnn' then 'cfile' will be updated and overwritten.
-details Create a log file: the name will be that of 'cfile' with an extension '.mlog' added to 'cfile'. The log file will contain info about merged items and their location or warning and error messages when processing fails.
When -details is specified without -merge, then a .mlog file will be created that shows the differences of the config values but no actual merge takes place. When \ref ccmerge "ccmerge" detects that 'cfile' and 'pfile' are incompatible then an error message is shown and the merge is not executed. \note A filepath name can be specified without surrounding " characters as long as it does not contain any space or other special characters. It must be enclosed by " characters when the filepath name contains one or more spaces or other special characters. \section ccmerge_examples Usage Example \code ccmerge -pfile $CMSIS_PACK_ROOT/ARM/CMSIS/5.6.0/CMSIS/RTOS2/RTX/Config/RTX_Config.h -cfile RTE/CMSIS/RTX_Config.h -merge \endcode \section ccmerge_errors Error Messages
Type Message Action
ERROR -cfile - missing filename See usage and correct the argument.
ERROR -cfile: duplicate specification See usage and correct the argument.
ERROR -pfile - missing filename See usage and correct the argument.
ERROR -pfile: duplicate specification See usage and correct the argument.
ERROR unknown command option See usage and correct the argument.
ERROR Error - cannot open %s file Check input files.
ERROR Error - different types of configuration options Check input files.
ERROR Error: vector.AddCitem() failed - out of memory. Ensure you have enough memory available.
ERROR FATAL-ERROR: Out of Memory Ensure you have enough memory available.
ERROR ccmerge failed, %d Error(s) found. Check log file.
WARNING ccmerge command line warning: duplicate '-%s' ignored See usage and correct the argument.
INFO Note: '-merge' not specified, checking files only. For information only.
INFO Note: no config annotations in pfile For information only.
INFO Note: no config annotations in cfile For information only.
INFO ccmerge completed, 0 Error(s), 0 Warning(s), 'cfile' left unchanged. For information only.
INFO ccmerge completed, %d Error(s), %d Warning(s), %d items merged. For information only.
*/ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page cp_install cp_install.sh: Install Packs The \c cp_install "cp_install.sh" script gets a list of URLs that refer to software packs in CMSIS-Pack format that should be downloaded and installed. It is called from the \b Bash command line with the following syntax: \code cp_install.sh \endcode Where: \c cp_install is the name of the script. <\c pack-list-file> is a text file that contains a URL list. The \c cp_install script reads a text file that contains a URL list of software packs in CMSIS-Pack format. The URL list has the following format: \c \/\.\.\.pack. Below is an example: \code https://www.keil.com/pack/ARM.CMSIS.5.6.0.pack https://www.keil.com/pack/ARM.CMSIS-Driver.2.5.0.pack \endcode For each URL in this list the following operations are performed: 1. Download the related software pack from the URL. 2. Extract the content of the software pack. The following directories are used to store software pack. The naming conventions for directories is based on the CMSIS-Pack specification. | Directory | Description | |:------------------------------------------------------------------|:----------------------------------------------------------------------------------| | ${CMSIS_PACK_ROOT}/.Download | Stores the downloaded software pack | | ${CMSIS_PACK_ROOT}/<vendor>/<packname>/<version> | Extracted content of the software pack (naming accoring CMSIS-Pack specification) | \note The environment variable \c $CMSIS_PACK_ROOT must reference an existing directory with at least the file ./Web/index.pidx. The directory structure can be created with \ref cp_init \section cp_install_example Usage Example \verbatim$ cp_install.sh Simulation.cpinstall (cp_install.sh): Install Packs 0.9.0 (C) 2020 ARM info: reading file: Simulation.cpinstall dos2unix: converting file Simulation.cpinstall to Unix format... http://www.keil.com/pack/ARM.CMSIS.5.6.0.pack ######################################################################## 100.0%#=#=# ######################################################################## 100.0% info: ARM.CMSIS.5.6.0.pack installing into /c/arm/cbuild/packs/ARM/CMSIS/5.6.0 http://www.keil.com/pack/Keil.ARM_Compiler.1.6.1.pack ######################################################################## 100.0%#=#=# ######################################################################## 100.0% info: Keil.ARM_Compiler.1.6.1.pack installing into /c/arm/cbuild/packs/Keil/ARM_Compiler/1.6.1 pack installation completed successfully \endverbatim \section cp_install_errors Error Messages
Type Message Action
ERROR error: missing command line argument See usage and corret argument.
ERROR error: too many command line arguments See usage and corret argument.
ERROR error: $filename does not exist See usage and corret argument.
ERROR error: CMSIS_PACK_ROOT environment variable not set Set \ref cbuild_envsetup.
ERROR error: CMSIS_PACK_ROOT: folder does not contain package index file .Web/index.pidx Check pack repository.
ERROR error: pack download failed for $pack_url Check internet connection and server availability.
ERROR error: downloaded file $packfile is not a zip/pack file Check list of missing packages in cpinstall file.
ERROR error: unzip failed for $packfile Check downloaded package.
INFO info: pack $packfile is already downloaded For information only.
INFO info: $packfile is already installed For information only.
INFO pack installation completed successfully For information only.
*/ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page Make make: GNU Make The \ref Make "make" utility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them. For Windows, the \ref cp_install installs GNU Make version 4.2 compiled for Win32. For full documentation visit: https://www.gnu.org/software/make/manual/make.html#Options-Summary. \ref Make "make" is called from the \b Bash command line with the following syntax: \code make [] [] ... \endcode The \ref cbuild "cbuild.sh" script uses only the following subset of the \ref Make "make" options.
\[\] Short Name Description
-f FILE Specify makefile Run make for the makefile specified by FILE
-j [N] Run parallel jobs. Speed up builds by allowing N jobs at once; infinite jobs with no arg.
-r Run make without built-in rules Disable the implicit rules built into make.
-s Run make in silent mode Don't echo recipes.
[\] Short Name Description
clean Cleanup build Requests to remove intermediate build output files
\section Make_example Usage Example Build a project: \code $ make -j -f MyProject.mak \endcode Cleanup the project build directories: \code $ make -f MyProject.mak clean \endcode */ /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/ /** \page cbuild_uv cbuild_uv.sh: Build MDK project The \c cp_install "cbuild_uv.sh" script calls uVision and exports all targets for a Keil MDK project in the CMSIS project format (*.cprj files). The script then invokes the \ref cbuild "cbuild.sh" script for each exported project target. It is called from the \b Bash command line with the following syntax: \code cbuild_uv.sh .uvprojx \endcode Where: \c cbuild_uv.sh is the name of the script. <\c project-file> is the filename of a uVision project. \note The environment variable \c $MDK_ROOT must refer to the base directory of the Keil MDK installation. \note Some MDK features are not converted as not all build features of µVision are available in command line build process. For example: - User commands pre and post build - \c fcarm code generator - Linker script generation. Instead the linker script generated by MDK is used by cmsis build. \section cbuild_uv_example Usage Example \verbatim $ cbuild_uv.sh FTP_Server.uvprojx (cbuild_uv.sh): Build MDK Project 0.9.0 (C) 2020 ARM uVision has created CPRJ files for the following targets: FTP_Server.Debug.cprj FTP_Server.Release.cprj -------------------------------------------------------------------- calling cbuild.sh for FTP_Server.Debug.cprj -------------------------------------------------------------------- ... -------------------------------------------------------------------- calling cbuild.sh for FTP_Server.Release.cprj -------------------------------------------------------------------- ... builds completed for: FTP_Server.Debug.cprj FTP_Server.Release.cprj total: 2 failed: 0 \endverbatim */