Advanced building procedures
You can customize the basic building procedures in a variety of ways, depending on the configuration of your project.
Advanced compiler settings
The application has full control over the build process.
Using Zephyr’s configuration options is the standard way of controlling how the system is built.
These options can be found under Zephyr’s menuconfig Build and Link Features > Compiler Options.
For example, to turn off optimizations, select CONFIG_NO_OPTIMIZATIONS
.
Compiler options not controlled by the Zephyr build system can be controlled through the CONFIG_COMPILER_OPT
Kconfig option.
Common sample components for development
Code found in the samples/common
are not intended to be used independently, but in addition to other compatible samples for development purposes.
For example, the file path samples/common/mcumgr_bt_ota_dfu
contains the source for the CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU
Kconfig option.
This Kconfig option can be used with specific Nordic Semiconductor devices to enable MCUmgr to perform firmware over-the-air (FOTA) updates using Bluetooth® Low Energy.
To learn more about how to use the CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU
Kconfig option, see the respective device guides for nRF52 Series and the nRF5340 DK.
Optional build parameters
The parameters and options passed in the command line always take precedence over west config
settings.
Here are some of the possible options you can use:
You can provide custom CMake options to the build command.
You can pass
--no-sysbuild
towest build
to build without Sysbuild. (In the nRF Connect SDK, building with sysbuild is enabled by default.)You can include the directory_name parameter to build from a directory other than the current directory.
You can specify a destination_directory_name parameter to choose where the build files are generated. If not specified, the build files are automatically generated in
build/zephyr/
.You can start menuconfig with the west command to configure your application.
You can reuse an existing build directory for building another application for another board or board target by passing
-p=auto
towest build
.You can run unit tests with the west command with the
-t run
parameter from the unit test directory.You can use the
--domain
parameter to build for a single domain. This parameter can also be used for programming and debugging multiple domains.
For more information on other optional build parameters, run the west build -h
help text command.