.. _app_build_output_files: Output build files (image files) ################################ The building process produces each time an :term:`image file`. The image file can refer to an *executable*, a *program*, or an *ELF file*. As one of the last build steps, the linker processes all object files by locating code, data, and symbols in sections in the final ELF file. The linker replaces all symbol references to code and data with addresses. A symbol table that maps addresses to symbol names is created. This table is used by debuggers. When an ELF file is converted to another format, such as HEX or binary, the symbol table is lost. Depending on the application and the SoC, you can use one or several images. The |NCS| build system places output images in the :file:`/zephyr` folder. .. _app_build_output_files_common: Common output build files ************************* The following table lists build files that can be generated as output when building firmware for supported :ref:`build targets `. The table includes files for single-core and multi-core programming scenarios for both |VSC| and command-line building methods. Which files you are going to use depends on the application configuration and not directly on the type of SoC you are using. The following scenarios are possible: * Single-image - Only one firmware image file is generated for a single core. * Multi-image - Two or more firmware image files are generated for a single core. For more details about this scenario, see :ref:`ug_multi_image`. * Multi-core - Two or more firmware image files are generated for two or more cores. +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | File | Description | Programming scenario | +==========================================+=======================================================================================================+===========================================================================================================+ | :file:`zephyr.hex` | Default full image. | * Programming build targets with :ref:`NSPE ` or single-image. | | | In a multi-image build, several :file:`zephyr.hex` files are generated, one for each image. | * Testing DFU procedure with nrfjprog (programming directly to device). | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`merged.hex` | The result of merging all :file:`zephyr.hex` files for all images for a core | * Programming multi-core application. | | | in a multi-image build. Used by Nordic Semiconductor's build targets in single-core | * Testing DFU procedure with nrfjprog (programming directly to device). | | | multi-image builds. In multi-core builds, several :file:`merged_.hex` fields | | | | are generated, where ** indicates the core. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`merged_domains.hex` | The result of merging all :file:`merged.hex` files for all cores or processing environments | * Programming :ref:`SPE-only ` and multi-core build targets. | | | (:file:`merged.hex` for the application core and :file:`merged.hex` or :file:`zephyr.hex` | * Testing DFU procedure with nrfjprog (programming directly to device). | | | for the network core). | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`tfm_s.hex` | Secure firmware image created by the TF-M build system in the background of the Zephyr build. | Programming :ref:`SPE-only ` and multi-core build targets. | | | It is used together with the :file:`zephyr.hex` file, which is intended for the Non-Secure | | | | Processing Environment (NSPE). Located in :file:`build/tfm/bin`. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`app_update.bin` | Application core update file used to create :file:`dfu_application.zip` for multi-core DFU. | DFU process for single-image build targets and the application core | | | Can also be used standalone for a single-image DFU. | of the multi-core build targets. | | | Contains the signed version of the application. | | | | This file is transferred in the real-life update procedure, as opposed to HEX files | | | | that are transferred with nrfjprog when emulating an update procedure. | | | | :ref:`Compatible with MCUboot `. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`app_signed.hex` | HEX file variant of the :file:`app_update.bin` file. | Programming single-image build targets and the application core | | | Can also be used standalone for a single-image DFU. | of the multi-core build targets. | | | Contains the signed version of the application. | | | | :ref:`Compatible with MCUboot `. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`mcuboot_secondary_app_update.bin` | Secondary slot variant of the :file:`app_update.bin` file. | DFU process for single-core build targets. | | | :ref:`Compatible with MCUboot ` in the :doc:`direct-xip mode `. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`mcuboot_secondary_app_signed.hex` | Secondary slot variant of the :file:`app_signed.hex` file. | Programming single-core build targets. | | | :ref:`Compatible with MCUboot ` in the :doc:`direct-xip mode `. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`net_core_app_update.bin` | Network core update file used to create :file:`dfu_application.zip`. | DFU process for the network core of multi-core build targets. | | | This file is transferred in the real-life update procedure, as opposed to HEX files | | | | that are transferred with nrfjprog when emulating an update procedure. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`dfu_application.zip` | Zip file containing both the MCUboot-compatible update image for one or more cores | DFU process for both single-core and multi-core applications. | | | and a manifest describing its contents. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`matter.ota` | :ref:`ug_matter`-specific OTA image that contains a Matter-compliant header | DFU over Matter for both single-core and multi-core applications. | | | and a DFU multi-image package that bundles user-selected firmware images. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ | :file:`.zigbee` | :ref:`ug_zigbee`-specific OTA image that contains the Zigbee application | DFU over Zigbee for both single-core and multi-core applications | | | with the Zigbee OTA header used for providing information about the image to the OTA server. | in the |NCS| v2.0.0 and later. | | | The ** includes manufacturer's code, image type, file version, and comment | | | | (customizable by user, sample name by default). | | | | For example: :file:`127F-0141-01020003-light_switch.zigbee`. | | +------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ .. _app_build_mcuboot_output: MCUboot output build files ************************** .. note:: MCUboot's :doc:`direct-xip mode ` and the related :kconfig:option:`CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT` Kconfig option are currently supported only on the single-core devices such as the nRF52 Series. For more details, see the :ref:`more information ` section of the :ref:`ug_nrf52_developing` page. +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | File | Description | +==================================================================+==========================================================================================================================================================================================================================================================================================+ | :file:`dfu_application.zip` | Contains the following: | | | | | | * The MCUboot-compatible update image for one or more cores when MCUboot is *not* in the :doc:`direct-xip mode ` and a manifest describing its contents (all related :file:`*.bin` files and a :file:`manifest.json` file). | | | * The MCUboot-compatible update image for the primary and secondary slots when MCUboot is in the :doc:`direct-xip mode ` and manifest describing its contents (all related :file:`*.bin` files and a :file:`manifest.json` file). | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`dfu_mcuboot.zip` | Contains two versions of MCUboot linked against different address spaces corresponding to slot0 (s0) and slot1 (s1) and a manifest JSON file describing their MCUboot version number (``MCUBOOT_IMGTOOL_SIGN_VERSION``), :ref:`bootloader` (NSIB) version number (``FW_INFO``), board | | | type. This file can be used by FOTA servers (for example, nRF Cloud) to serve both s0 and s1 to the device. | | | The device can then select the firmware file for the slot that is currently not in use. | | | Created when the options :kconfig:option:`CONFIG_SECURE_BOOT` and :kconfig:option:`CONFIG_BUILD_S1_VARIANT` are set. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`app_update.bin` | Signed variant of the firmware in binary format (as opposed to HEX). | | | It can be uploaded to a server as a FOTA image. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`signed_by_mcuboot_and_b0_s0_image_update.bin` | MCUboot update image for s0 signed by both MCUboot and NSIB. | | | The MCUboot signature is used by MCUboot to verify the integrity of the image before swapping and the NSIB signature is used by NSIB before booting the image. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`signed_by_mcuboot_and_b0_s1_image_update.bin` | MCUboot update image for s1 signed by both MCUboot and NSIB. | | | The MCUboot signature is used by MCUboot to verify the integrity of the image before swapping and the NSIB signature is used by NSIB before booting the image. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`app_to_sign.bin` | Unsigned variant of the firmware in binary format. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`app_signed.hex` | Signed variant of the firmware in the HEX format. | | | This HEX file is linked to the same address as the application. | | | Programming this file to the device will overwrite the existing application. | | | It will not trigger a DFU procedure. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`app_test_update.hex` | Same as :file:`app_signed.hex` except that it contains metadata that instructs MCUboot to test this firmware upon boot. | | | As :file:`app_signed.hex`, this HEX file is linked against the same address as the application. | | | Programming this file to the device will overwrite the existing application. | | | It will not trigger a DFU procedure. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`app_moved_test_update.hex` | Same as :file:`app_test_update.hex` except that it is linked to the address used to store the upgrade candidates. | | | When this file is programmed to the device, MCUboot will trigger the DFU procedure upon reboot. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`signed_by_mcuboot_and_b0_s0_image_moved_test_update.hex` | Moved to MCUboot secondary slot address space. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`signed_by_mcuboot_and_b0_s0_image_test_update.hex` | Directly overwrites s0. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`mcuboot_secondary_app_update.bin` | Secondary slot variant of the :file:`app_update.bin` file intended for use when MCUboot is in the :doc:`direct-xip mode `. | | | Created when the :kconfig:option:`CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT` Kconfig option is enabled. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`mcuboot_secondary_app_signed.hex` | Secondary slot variant of the :file:`app_signed.hex` file intended for use when MCUboot is in the :doc:`direct-xip mode `. | | | Created when the :kconfig:option:`CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT` Kconfig option is enabled. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`mcuboot_secondary_app_test_update.hex` | Secondary slot variant of the :file:`app_test_update.hex` file intended for use when MCUboot is in the :doc:`direct-xip mode `. | | | Created when the :kconfig:option:`CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT` Kconfig option is enabled. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :file:`mcuboot_secondary_app_to_sign.bin` | Secondary slot variant of the :file:`app_to_sign.bin` file intended for use when MCUboot is in the :doc:`direct-xip mode `. | | | Created when the :kconfig:option:`CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT` Kconfig option is enabled. | +------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. _app_build_output_files_other: Other output build files ************************ The following table lists secondary build files that can be generated when building firmware, but are only used to create the final output build files listed in the table above. +-----------------------------------+------------------------------------------------------------------------------------------------------+ | File | Description | +===================================+======================================================================================================+ | :file:`zephyr.elf` | An ELF file for the image that is being built. Can be used for debugging purposes. | +-----------------------------------+------------------------------------------------------------------------------------------------------+ | :file:`zephyr.meta` | A file with the Zephyr and nRF Connect SDK git hashes for the commits used to build the application. | | | If your working tree contains uncommitted changes, the build system adds the suffix ``-dirty`` | | | to the relevant version field. | +-----------------------------------+------------------------------------------------------------------------------------------------------+ | :file:`tfm_s.elf` | An ELF file for the TF-M image that is being built. Can be used for debugging purposes. | +-----------------------------------+------------------------------------------------------------------------------------------------------+ | :file:`manifest.json` | Output artifact that uses information from the :file:`zephyr.meta` output file. | +-----------------------------------+------------------------------------------------------------------------------------------------------+ | :file:`dfu_multi_image.bin` | Multi-image package that contains a CBOR manifest and a set of user-selected update images, | | | such as firmware images for different cores. | | | Used for DFU purposes by :ref:`ug_matter` and :ref:`ug_zigbee` protocols. | +-----------------------------------+------------------------------------------------------------------------------------------------------+ | :file:`signed_by_b0_s0_image.bin` | Intermediate file only signed by NSIB. | +-----------------------------------+------------------------------------------------------------------------------------------------------+ | :file:`signed_by_b0_s1_image.bin` | Intermediate file only signed by NSIB. | +-----------------------------------+------------------------------------------------------------------------------------------------------+