Galanakis, Minos | 41f8597 | 2019-09-30 15:56:40 +0100 | [diff] [blame] | 1 | ################## |
| 2 | Build instructions |
| 3 | ################## |
Anton Komlev | 0dbe8f1 | 2022-06-17 16:48:12 +0100 | [diff] [blame] | 4 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 5 | .. warning:: |
| 6 | The build process was changed a lot in Q3 2023 and included into the release after v1.9. |
| 7 | For building instructions for early versions please refer to the documentation of respective |
| 8 | versions. |
| 9 | |
| 10 | As you know from the :doc:`introduction </introduction/readme>` TF-M implements |
| 11 | :term:`SPE` with a set of secure services. |
| 12 | TF-M application as :term:`NSPE` client uses those services through isolation boundary via |
| 13 | :term:`PSA-FF-M` API. |
| 14 | Both SPE and NSPE are separate binaries and built independently. |
Kevin Peng | 304e268 | 2023-11-06 14:10:50 +0800 | [diff] [blame] | 15 | SPE and NSPE binaries are combined and signed making the final image for downloading onto targets |
| 16 | when building NSPE. |
| 17 | |
| 18 | .. Note:: |
| 19 | This document describes the process of building a single SPE alone. |
| 20 | Refer to :doc:`Building Tests </building/tests_build_instruction>` on how to build TF-M |
| 21 | regression tests and PSA Arch tests to verify TF-M. |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 22 | |
| 23 | TF-M uses `CMake <https://cmake.org/overview/>`__ **v3.15** or higher. |
| 24 | Before starting please make sure you have all required software installed and |
| 25 | configured as explained in the |
Anton Komlev | 3356ba3 | 2022-03-31 22:02:11 +0100 | [diff] [blame] | 26 | :doc:`TF-M getting started </getting_started/tfm_getting_started>`. |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 27 | |
| 28 | .. contents:: Contents |
| 29 | :depth: 2 |
| 30 | :local: |
| 31 | |
| 32 | The additional building materials you can find in the following links:TF-M source folder |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 33 | |
| 34 | .. toctree:: |
| 35 | :maxdepth: 1 |
| 36 | |
Kevin Peng | 304e268 | 2023-11-06 14:10:50 +0800 | [diff] [blame] | 37 | Build Tests <tests_build_instruction> |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 38 | Run TF-M tests and applications <run_tfm_examples_on_arm_platforms> |
Anton Komlev | 0dbe8f1 | 2022-06-17 16:48:12 +0100 | [diff] [blame] | 39 | Building the documentation <documentation_generation> |
| 40 | IAR toolchain <tfm_build_instruction_iar> |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 41 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 42 | .. _Building SPE: |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 43 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 44 | ******************* |
| 45 | Building TF-M (SPE) |
| 46 | ******************* |
| 47 | This build generates the SPE binary and artifacts, necessary for :ref:`Building NSPE`. |
Raef Coles | 1ecb813 | 2020-10-02 15:11:24 +0100 | [diff] [blame] | 48 | |
David Wang | d6fd6af | 2021-06-21 17:17:26 +0800 | [diff] [blame] | 49 | .. _Getting the source-code: |
| 50 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 51 | Getting the source code |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 52 | ======================= |
| 53 | .. code-block:: bash |
| 54 | |
Leonardo Sandoval | d7f72d5 | 2020-07-28 18:02:34 -0500 | [diff] [blame] | 55 | cd <base folder> |
Minos Galanakis | 0f39fa5 | 2020-06-08 16:53:53 +0100 | [diff] [blame] | 56 | git clone https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 57 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 58 | In this documentation, the cloned ``trusted-firmware-m`` repository will be referenced as |
| 59 | ``<TF-M source dir>``. |
| 60 | Additionally, TF-M depends on several external projects, handled by CMake automatically but |
| 61 | you can alter that behaviour using :ref:`Dependency management`. |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 62 | |
Minos Galanakis | ac6b06c | 2020-03-19 12:57:02 +0000 | [diff] [blame] | 63 | .. Note:: |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 64 | |
Minos Galanakis | 3b740a1 | 2020-10-15 11:10:26 +0100 | [diff] [blame] | 65 | - For building with Armclang compiler version 6.10.0+, please follow the note |
Anton Komlev | 3356ba3 | 2022-03-31 22:02:11 +0100 | [diff] [blame] | 66 | in :doc:`TF-M getting started </getting_started/tfm_getting_started>`. |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 67 | - For building with the IAR toolchain, please see the notes in |
Minos Galanakis | 3b740a1 | 2020-10-15 11:10:26 +0100 | [diff] [blame] | 68 | :doc:`IAR software requirements <tfm_build_instruction_iar>` |
Ken Liu | 6792e04 | 2023-11-13 14:48:00 +0800 | [diff] [blame] | 69 | - Please use "/" instead of "\\" for paths when running CMAKE commands under |
| 70 | Windows Command Prompt. |
TTornblom | b9e5ed0 | 2020-02-13 16:53:15 +0100 | [diff] [blame] | 71 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 72 | Configuring |
| 73 | =========== |
| 74 | TF-M has many config options for configuring and fine-tuning. Please check the |
| 75 | :ref:`tf-m_configuration` section for the details. The **base** (default) configuration |
| 76 | contains only essential components such as SPM and HW platform support hence the |
| 77 | only mandatory argument to TF-M build is a platform name, provided via |
| 78 | CMake command-line option ``-DTFM_PLATFORM=<platform name>``, it can be: |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 79 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 80 | - A relative path under ``<TF-M source dir>/platform/ext/target``, for example ``arm/mps2/an521``. |
| 81 | - An absolute path of target platform, mainly used for out-of-tree platform build. |
| 82 | - A basename of the target platform folder, for example ``an521``. |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 83 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 84 | Essential Directories |
| 85 | --------------------- |
| 86 | There are 3 essential directories used by CMake for building TF-M: |
| 87 | |
| 88 | - Source code directory ``<TF-M source dir>`` |
| 89 | - Build directory ``<Build Dir>`` - the location of all intermediate files required to produce |
| 90 | a build target. |
| 91 | - Install directory ``<Artifact Dir>`` - the location of the build output files. |
| 92 | |
| 93 | Note:: |
| 94 | It's recommended to use absolute paths for all directories. Relative paths may not fully work. |
| 95 | |
| 96 | .. _Toolchains: |
| 97 | |
| 98 | Toolchains |
| 99 | ---------- |
| 100 | TF-M supports 3 toolchains for cross-compiling and building the project binaries: |
| 101 | |
| 102 | - GNU - **default** |
| 103 | - ArmClang |
| 104 | - IAR |
| 105 | |
| 106 | Each toolchain has a configuration file for the compiler and linker. |
Kevin Peng | 1872b5d | 2023-11-10 15:13:11 +0800 | [diff] [blame^] | 107 | They are located at the root directory of TF-M. |
| 108 | Use ``TFM_TOOLCHAIN_FILE`` option to provide the absolute path to the preferred toolchain file, |
| 109 | or relative path to working directory. |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 110 | The default **toolchain_GNUARM.cmake** is selected by `config_base.cmake` |
| 111 | file if the option is omitted. |
| 112 | |
| 113 | .. _Build type: |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 114 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 115 | Build type |
| 116 | ---------- |
Dávid Házi | e50f0a9 | 2022-07-06 14:46:01 +0200 | [diff] [blame] | 117 | By default, a MinSizeRel configuration is built. Alternate build types can be |
Chris Brand | 80266ba | 2022-01-05 09:14:52 -0800 | [diff] [blame] | 118 | specified with the ``CMAKE_BUILD_TYPE`` variable. The possible |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 119 | types are: |
| 120 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 121 | - Debug |
| 122 | - RelWithDebInfo |
| 123 | - Release |
| 124 | - MinSizeRel - **default** |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 125 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 126 | Debug symbols are added by default to all builds, but can be removed from |
| 127 | *Release* and *MinSizeRel* builds by setting ``TFM_DEBUG_SYMBOLS`` to `OFF`. |
Sebastian Bøe | b73f176 | 2021-10-28 14:23:13 +0200 | [diff] [blame] | 128 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 129 | *RelWithDebInfo*, *Release* and *MinSizeRel* all have different |
| 130 | optimizations turned on and hence will produce smaller, faster code than |
| 131 | *Debug*. *MinSizeRel* will produce the smallest code and hence is often |
| 132 | a good idea on RAM or flash-constrained systems. |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 133 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 134 | .. _Output files: |
| 135 | |
| 136 | Output files |
| 137 | ------------ |
| 138 | In a successful build, a set of files will be created in the ``<Artifact Dir>``. |
| 139 | By default, it is ``<Build Dir>\api_ns`` subfolder but you can redirect the |
| 140 | output to any location using ``CMAKE_INSTALL_PREFIX`` option. It can be an |
| 141 | absolute path or relative to your current directory. For the contents of the |
| 142 | artifact directory please refer to :ref:`Artifacts structure`. |
| 143 | |
| 144 | Other build parameters |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 145 | ---------------------- |
Anton Komlev | 2cd9153 | 2022-11-17 13:36:55 +0000 | [diff] [blame] | 146 | The full list of default options is in ``config/config_base.cmake`` and |
| 147 | explained in :ref:`tfm_cmake_configuration`. Several important options |
| 148 | are listed below. |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 149 | |
Xinyu Zhang | 5f9ffeb | 2023-03-31 11:09:45 +0800 | [diff] [blame] | 150 | +----------------------------+------------------------------------------+---------------+ |
| 151 | | Parameter | Description | Default value | |
| 152 | +============================+==========================================+===============+ |
| 153 | | BL2 | Build level 2 secure bootloader. | ON | |
| 154 | +----------------------------+------------------------------------------+---------------+ |
Xinyu Zhang | 5f9ffeb | 2023-03-31 11:09:45 +0800 | [diff] [blame] | 155 | | PROJECT_CONFIG_HEADER_FILE | User defined header file for TF-M config | | |
| 156 | +----------------------------+------------------------------------------+---------------+ |
| 157 | | TFM_ISOLATION_LEVEL | Set TFM isolation level. | 1 | |
| 158 | +----------------------------+------------------------------------------+---------------+ |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 159 | | TFM_PROFILE | See :ref:`tf-m_profiles`. | | |
Xinyu Zhang | 5f9ffeb | 2023-03-31 11:09:45 +0800 | [diff] [blame] | 160 | +----------------------------+------------------------------------------+---------------+ |
| 161 | |
| 162 | Project Config Header File |
| 163 | -------------------------- |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 164 | CMake variable ``PROJECT_CONFIG_HEADER_FILE`` can be set by a user the full path to a |
Xinyu Zhang | 5f9ffeb | 2023-03-31 11:09:45 +0800 | [diff] [blame] | 165 | configuration header file, which is used to fine-tune component options. The detailed reference |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 166 | for the project config header file is in :ref:`Header_configuration`. |
Xinyu Zhang | 5f9ffeb | 2023-03-31 11:09:45 +0800 | [diff] [blame] | 167 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 168 | Building binaries |
| 169 | ================= |
Xinyu Zhang | 5f9ffeb | 2023-03-31 11:09:45 +0800 | [diff] [blame] | 170 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 171 | The command below shows a general template for building TF-M as a typical CMake project: |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 172 | |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 173 | .. code-block:: bash |
| 174 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 175 | cmake -S <TF-M source dir> -B <Build Dir> -DTFM_PLATFORM=<platform> |
| 176 | cmake --build <Build Dir> -- install |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 177 | |
| 178 | .. Note:: |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 179 | It is recommended to clean up the build directory before re-build if the config |
| 180 | header file is updated. CMake is unable to automatically recognize the |
| 181 | dependency when the header file is defined as a macro. |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 182 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 183 | Building default configuration for an521 |
| 184 | ---------------------------------------- |
| 185 | |
| 186 | .. code-block:: bash |
| 187 | |
| 188 | cd <TF-M source dir> |
| 189 | cmake -S . -B build -DTFM_PLATFORM=arm/mps2/an521 |
| 190 | cmake --build build -- install |
| 191 | |
| 192 | The command above is intended to do: |
| 193 | - take TF-M sources in the current ``.`` folder |
| 194 | - build SPE in the ``build`` folder |
| 195 | - for **an521** platform |
| 196 | - using GNU toolchain *by default*. Use ``-DTFM_TOOLCHAIN_FILE=<toolchain file>`` |
| 197 | for alternatives as described in :ref:`Toolchains` |
| 198 | - install output files in ``build/api_ns`` folder *by default*. You can specify |
| 199 | a different directory using ``-DCMAKE_INSTALL_PREFIX=<Artifact dir>`` |
| 200 | as described in :ref:`Output files` |
| 201 | |
| 202 | .. Note:: |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 203 | It is recommended to build each different build configuration in a separate |
| 204 | build directory. |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 205 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 206 | CMake can generate code for many native build systems. TF-M is tested with |
| 207 | ``Unix Makefiles`` (default) and ``Ninja``. The ``-G`` option can specify |
| 208 | alternative generators. For example for building with Ninja in the Debug |
| 209 | :ref:`Build type` using ArmClang :ref:`Toolchains` you can use the following: |
Leonardo Sandoval | 49a558c | 2021-02-03 17:04:22 -0600 | [diff] [blame] | 210 | |
| 211 | .. code-block:: bash |
Subhasish Ghosh | bc84930 | 2021-04-08 20:21:20 +0100 | [diff] [blame] | 212 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 213 | cd <TF-M source dir> |
| 214 | cmake -S . -B build -DTFM_PLATFORM=arm/mps2/an521 -GNinja -DTFM_TOOLCHAIN_FILE=toolchain_ARMCLANG.cmake -DCMAKE_BUILD_TYPE=Debug |
| 215 | cmake --build build -- install |
Leonardo Sandoval | 49a558c | 2021-02-03 17:04:22 -0600 | [diff] [blame] | 216 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 217 | .. _Dependency management: |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 218 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 219 | Dependency management |
| 220 | ===================== |
| 221 | |
| 222 | The TF-M build system will fetch all dependencies by default with appropriate |
| 223 | versions and store them inside the build tree. In this case, the build tree |
| 224 | location is ``<build_dir>/lib/ext``. |
| 225 | |
| 226 | If you have local copies already and wish to avoid having the libraries |
| 227 | downloaded every time the build directory is deleted, then the following |
| 228 | variables can be set to the paths to the root directories of the local repos. |
| 229 | This will disable the automatic downloading for that dependencies and speed up |
| 230 | development iterations or allow usage of a dependency version different from the |
| 231 | current one. |
| 232 | Additionally, these path variables can be set in ``localrepos.cmake`` |
| 233 | file which will be included in a build if it exists. |
| 234 | This file is ignored in TF-M git settings. |
| 235 | |
| 236 | The following table lists the commonly used repos. For others, you can refer to ``lib/ext``. |
| 237 | |
| 238 | +----------------+---------------------+-----------------------------------------------------+ |
| 239 | | Dependency | Cmake variable | Git repo URL | |
| 240 | +================+=====================+=====================================================+ |
| 241 | | Mbed Crypto | MBEDCRYPTO_PATH | https://github.com/ARMmbed/mbedtls | |
| 242 | +----------------+---------------------+-----------------------------------------------------+ |
| 243 | | MCUboot | MCUBOOT_PATH | https://github.com/mcu-tools/mcuboot | |
| 244 | +----------------+---------------------+-----------------------------------------------------+ |
| 245 | | QCBOR | QCBOR_PATH | https://github.com/laurencelundblade/QCBOR.git | |
| 246 | +----------------+---------------------+-----------------------------------------------------+ |
| 247 | |
| 248 | The recommended versions of the dependencies are listed in ``config/config_base.cmake``. |
| 249 | |
| 250 | .. Note:: |
| 251 | |
| 252 | - Some repositories might need patches to allow building it as a part of TF-M. |
| 253 | While these patches are being upstreamed they are stored in a |
| 254 | dependency folder under ``lib/ext/``. |
| 255 | In order to use local repositories those patches shall be applied to original source. |
| 256 | An alternative is to copy out the auto-downloaded repos under the ``<build_dir>/lib/ext``. |
| 257 | They have been applied with patches and can be used directly. |
| 258 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 259 | Example: building TF-M with local Mbed Crypto repo |
| 260 | -------------------------------------------------- |
| 261 | |
| 262 | Preparing a local repository consists of 2 steps: cloning and patching. |
| 263 | This is only required to be done once. For dependencies without ``.patch`` |
| 264 | files in their ``lib/ext`` directory the only required step is |
| 265 | cloning the repo and checking out the correct branch. |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 266 | |
| 267 | .. code-block:: bash |
| 268 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 269 | cd <Mbed Crypto base folder> |
| 270 | git clone https://github.com/ARMmbed/mbedtls |
| 271 | cd mbedtls |
| 272 | git checkout <MBEDCRYPTO_VERSION from <TF-M source dir>/config_base.cmake> |
| 273 | git apply <TF-M source dir>/lib/ext/mbedcrypo/*.patch |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 274 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 275 | .. Note:: |
| 276 | |
| 277 | ``<Mbed Crypto base folder>`` does not need to have any fixed position related |
| 278 | to the TF-M repo so alternative method to get prepared dependency repos is to |
| 279 | let TF-M download it once and then copy them out of the ``build/lib/ext`` folder. |
| 280 | |
| 281 | Now build TF-M binaries |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 282 | |
| 283 | .. code-block:: bash |
| 284 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 285 | cd <TF-M source dir> |
| 286 | cmake -S . -B build -DTFM_PLATFORM=arm/mps2/an521 -DMBEDCRYPTO_PATH=<Mbed Crypto base folder>/mbedtls |
| 287 | cmake --build build -- install |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 288 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 289 | .. _Building NSPE: |
| 290 | |
| 291 | *************************** |
| 292 | Building Application (NSPE) |
| 293 | *************************** |
| 294 | |
| 295 | As a result of :ref:`Building SPE` you will get a set of :ref:`Output files` in |
| 296 | ``<Artifact Dir>`` required for building TF-M application. Essentially, SPE |
| 297 | exports a binary and a set of C source files for PSA interface and platform. |
| 298 | Please note that NSPE and SPE are independent projects and can be built using |
| 299 | different toolchains and toolchain options. |
| 300 | |
| 301 | .. _Artifacts structure: |
| 302 | |
| 303 | SPE artifacts structure |
Kevin Peng | 23a583c | 2021-09-08 22:33:33 +0800 | [diff] [blame] | 304 | ======================= |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 305 | |
| 306 | SPE components prepared and installed for NSPE usage in ``<Artifact Dir>`` |
| 307 | will have the following structure: |
| 308 | |
| 309 | .. code-block:: none |
| 310 | |
| 311 | <Artifact Dir> |
| 312 | ├── bin |
| 313 | ├── cmake |
| 314 | ├── config |
| 315 | ├── image_signing |
| 316 | ├── interface |
| 317 | ├── platform |
| 318 | └── CMakeLists.txt |
| 319 | |
| 320 | With certain configurations, additional folders may also be installed. |
| 321 | These folders have the following content: |
| 322 | |
| 323 | - **bin** - binary images of SPE, Bootloader(optional) and combined. |
| 324 | - **cmake** - CMake scripts like SPE configuration and :ref:`NSPE toolchains`. |
| 325 | - **config** - Configuration files |
| 326 | - **image_signing** - binary image signing tool and keys. |
| 327 | - **interface** - PSA interface exposed by SPE. |
| 328 | - **platform** - source code for a selected hardware platform. |
| 329 | - **CMakeLists.txt** - CMake script for the artifacts integration in NSPE. |
| 330 | |
Kevin Peng | 304e268 | 2023-11-06 14:10:50 +0800 | [diff] [blame] | 331 | The content of ``<Artifact Dir>`` is a prepared directory for integration with CMake projects. |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 332 | |
| 333 | .. _NSPE toolchains: |
| 334 | |
| 335 | NSPE toolchains |
| 336 | =============== |
| 337 | |
| 338 | SPE prepares and exports CMake toolchain files for building NSPE in all |
| 339 | supported :ref:`Toolchains` in ``<Artifact Dir>/cmake`` folder. |
| 340 | Toolchain used to build NSPE can be different from what is used to build SPE. |
| 341 | |
Anton Komlev | 4b1c05c | 2023-10-06 20:22:58 +0100 | [diff] [blame] | 342 | Basic SPE integration |
| 343 | ===================== |
Kevin Peng | 304e268 | 2023-11-06 14:10:50 +0800 | [diff] [blame] | 344 | Refer to the |
| 345 | `example <https://git.trustedfirmware.org/TF-M/tf-m-extras.git/tree/examples/tf-m-example-ns-app>`__ |
| 346 | of TF-M applications in **tf-m-extras** repository. |
Raef Coles | 1ecb813 | 2020-10-02 15:11:24 +0100 | [diff] [blame] | 347 | |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 348 | -------------- |
| 349 | |
Xinyu Zhang | 5f9ffeb | 2023-03-31 11:09:45 +0800 | [diff] [blame] | 350 | *Copyright (c) 2017-2023, Arm Limited. All rights reserved.* |
Chris Brand | 80266ba | 2022-01-05 09:14:52 -0800 | [diff] [blame] | 351 | *Copyright (c) 2022, Cypress Semiconductor Corporation. All rights reserved.* |