CMSIS-Build
Version 0.10.0 (beta)
Tools, software frameworks, and work flows for productivity with CMSIS based projects
|
cbuild.sh implements the build flow by chaining the utilities cbuildgen, 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 or replaced by a custom implementation (for example a Python script).
The build flow of the cbuild.sh script is:
packlist
to list the URLs of missing software packs.make
to generate make files or cmake
to generate a CMakeLists.txt file (if --cmake
is specified).--cmake
).<BuildSystem>
.It is called from the Bash command line with the following syntax:
Where:
cbuild.sh
is the name of the script.
<ProjectFile>
specifies the project file in CMSIS project format.
Operation
Option | Description |
---|---|
--toolchain=<Toolchain> | Specifies the selected toolchain for projects that support multiple compilers. |
--outdir=<OutDir> | Specifies the output directory (for log files, binaries, and map files). |
--intdir=<IntDir> | Specifies the directory for intermediate files (such as generated make files, list of missing packs (cpinstall ), command files, object files, and dependency files). |
<MakefileTarget> | Specifies the <target> option for Make. |
--quiet | Suppresses output messages except build invocations. |
--merge | Updates configuration files with the ccmerge: Config File Updater utility. Note: not supported when used with --cmake . |
--update=<CprjFile> | Generates <CprjFile> with fixed versions for reproducing the current build. |
--help | Opens this documentation. |
--log=<LogFile> | Saves output messages in a log file. |
--jobs=<N> | Specifies the number of job slots for Make parallel execution. Minimum 1. |
--cmake[=<BuildSystem>] | Generates CMakeLists.txt file [and invokes CMake with the specified <BuildSystem> ]. |
Make based build
$ cbuild.sh Simulation.cprj (cbuild.sh): Build Invocation 0.10.0 (C) 2020 ARM Simulation.cprj validates (cbuildgen): Build Process Manager 0.10.0 (C) 2020 ARM M650: Command completed successfully. (cbuildgen): Build Process Manager 0.10.0 (C) 2020 ARM M652: Generated makefile for project build: 'C:/Examples/Blinky/IntDir/Simulation.mak' [1/7] Compiling C:/Examples/Blinky/RTE/CMSIS/RTX_Config.c [2/7] Compiling C:/Users/danbro01/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/RTOS2/RTX/Source/rtx_lib.c [3/7] Compiling C:/Users/danbro01/AppData/Local/Arm/Packs/Keil/ARM_Compiler/1.6.3/Source/retarget_io.c [4/7] Compiling C:/Examples/Blinky/Blinky.c [5/7] Compiling C:/Examples/Blinky/RTE/Device/ARMCM3/startup_ARMCM3.c [6/7] Compiling C:/Examples/Blinky/RTE/Device/ARMCM3/system_ARMCM3.c [7/7] Linking to C:/Examples/Blinky/OutDir/Blinky_AC6.axf Program Size: Code=7468 RO-data=1264 RW-data=168 ZI-data=9084 cbuild.sh finished successfully!
CMake based build
$ cbuild.sh Blinky.B-L475E-IOT01A.cprj --cmake (cbuild.sh): Build Invocation 0.10.0 (C) 2020 ARM Blinky.B-L475E-IOT01A.cprj validates (cbuildgen): Build Process Manager 0.10.1-nightly+343 (C) 2020 ARM M650: Command completed successfully. (cbuildgen): Build Process Manager 0.10.1-nightly+343 (C) 2020 ARM M652: Generated makefile for project build: 'C:/Blinky/B-L475E-IOT01A/Objects/CMakeLists.txt' -- The C compiler identification is ARMClang 6.15.2 -- Configuring done -- Generating done -- Build files have been written to: C:/Blinky/B-L475E-IOT01A/Objects [1/49] Building C object CMakeFiles\image.dir\C_\Users\user\AppData\Local\Arm\Packs\Keil\B-L475E-IOT01A_BSP\1.0.0\Drivers\B-L475E-IOT01\stm32l475e_iot01.o [2/49] Building C object CMakeFiles\image.dir\C_\Users\user\AppData\Local\Arm\Packs\Keil\B-L475E-IOT01A_BSP\1.0.0\Drivers\Components\lsm6dsl\lsm6dsl.o [3/49] Building C object CMakeFiles\image.dir\C_\Users\user\AppData\Local\Arm\Packs\Keil\B-L475E-IOT01A_BSP\1.0.0\Drivers\B-L475E-IOT01\stm32l475e_iot01_gyro.o ... [47/49] Building C object CMakeFiles\image.dir\C_\Blinky\B-L475E-IOT01A\RTE\Device\STM32L475VGTx\system_stm32l4xx.o [48/49] Building C object CMakeFiles\image.dir\C_\Blinky\B-L475E-IOT01A\RTE\Device\STM32L475VGTx\STCubeGenerated\Src\stm32l4xx_it.o [49/49] Linking C executable image.axf Program Size: Code=20968 RO-data=784 RW-data=328 ZI-data=37412 cbuild.sh finished successfully!
Type | Message | Action |
---|---|---|
ERROR | error: missing required argument <project> .cprj | See usage and correct the argument. |
ERROR | error: project file <project> .cprj does not exist | Check project file. |
ERROR | error: CMSIS_BUILD_ROOT environment variable not set | Set Environment Variables. |
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. |