Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 1 | ################## |
| 2 | First Things First |
| 3 | ################## |
| 4 | |
| 5 | ************ |
| 6 | Prerequisite |
| 7 | ************ |
Antonio de Angelis | 465cc7b | 2024-06-27 20:19:01 +0100 | [diff] [blame^] | 8 | Trusted Firmware M provides a reference implementation of the Platform Security |
| 9 | Architecture (PSA) specifications, aligning with PSA Certified guidelines. |
| 10 | It is assumed that the reader is familiar with the specifications that can be |
| 11 | found |
| 12 | `here <https://developer.arm.com/architectures/security-architectures/platform-security-architecture>`__. |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 13 | |
Antonio de Angelis | 465cc7b | 2024-06-27 20:19:01 +0100 | [diff] [blame^] | 14 | The current TF-M implementation on Armv8-M leverages TrustZone for Armv8-M so a |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 15 | good understanding of the v8-M architecture is also necessary. A good place to |
Antonio de Angelis | 465cc7b | 2024-06-27 20:19:01 +0100 | [diff] [blame^] | 16 | get started with Armv8-M is |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 17 | `developer.arm.com <https://developer.arm.com/architectures/cpu-architecture/m-profile>`__. |
| 18 | |
| 19 | ************************** |
| 20 | Build and run instructions |
| 21 | ************************** |
| 22 | Trusted Firmware M source code is available on |
| 23 | `git.trustedfirmware.org <https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/>`__. |
| 24 | |
| 25 | To build & run TF-M: |
| 26 | |
| 27 | - Follow the this guide to set up and check your environment. |
| 28 | - Follow the |
Anton Komlev | 0dbe8f1 | 2022-06-17 16:48:12 +0100 | [diff] [blame] | 29 | :doc:`Build instructions </building/tfm_build_instruction>` |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 30 | to compile and build the TF-M source. |
Anton Komlev | 0dbe8f1 | 2022-06-17 16:48:12 +0100 | [diff] [blame] | 31 | - Follow the :doc:`Run TF-M examples on Arm platforms </building/run_tfm_examples_on_arm_platforms>` |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 32 | for information on running the example. |
| 33 | |
| 34 | To port TF-M to a another system or OS, follow the |
| 35 | :doc:`OS Integration Guide </integration_guide/index>` |
| 36 | |
| 37 | :doc:`Contributing Guidelines </contributing/contributing_process>` contains guidance on how to |
| 38 | contribute to this project. |
| 39 | |
| 40 | ######################### |
| 41 | Set up build environments |
| 42 | ######################### |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 43 | |
| 44 | TF-M officially supports a limited set of build environments and setups. In |
| 45 | this context, official support means that the environments listed below |
| 46 | are actively used by team members and active developers, hence users should |
| 47 | be able to recreate the same configurations by following the instructions |
| 48 | described below. In case of problems, the TF-M team provides support |
| 49 | only for these environments, but building in other environments can still be |
| 50 | possible. |
| 51 | |
| 52 | The following environments are supported: |
| 53 | |
| 54 | .. tabs:: |
| 55 | |
| 56 | .. group-tab:: Linux |
| 57 | |
| 58 | 1. version supported: |
| 59 | |
| 60 | Ubuntu 18.04 x64+ |
| 61 | |
| 62 | 2. install dependencies: |
| 63 | |
| 64 | .. code-block:: bash |
| 65 | |
| 66 | sudo apt-get install -y git curl wget build-essential libssl-dev python3 \ |
| 67 | python3-pip cmake make |
| 68 | |
| 69 | 3. verify cmake version: |
| 70 | |
| 71 | .. code-block:: bash |
| 72 | |
| 73 | cmake --version |
| 74 | |
| 75 | .. note:: |
| 76 | |
Nik Dewally | ae923b1 | 2024-06-26 15:30:09 +0100 | [diff] [blame] | 77 | Please download CMake version 3.21 or later from https://cmake.org/download/. |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 78 | |
| 79 | 4. add CMake path into environment: |
| 80 | |
| 81 | .. code-block:: bash |
| 82 | |
| 83 | export PATH=<CMake path>/bin:$PATH |
| 84 | |
| 85 | .. group-tab:: Windows |
| 86 | |
| 87 | 1. version supported: |
| 88 | |
| 89 | Windows 10 x64 |
| 90 | |
Nik Dewally | ae923b1 | 2024-06-26 15:30:09 +0100 | [diff] [blame] | 91 | 2. install dependencies: |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 92 | |
| 93 | - Git client latest version (https://git-scm.com/download/win) |
Nik Dewally | ae923b1 | 2024-06-26 15:30:09 +0100 | [diff] [blame] | 94 | - CMake version 3.21 or later (`native Windows version <https://cmake.org/download/>`__) |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 95 | - GNU make (http://gnuwin32.sourceforge.net/packages/make.htm) |
| 96 | - Python3 `(native Windows version) <https://www.python.org/downloads/>`__ and |
| 97 | the pip package manager (from Python 3.4 it's included) |
| 98 | |
| 99 | 3. add CMake path into environment: |
| 100 | |
| 101 | .. code-block:: bash |
| 102 | |
Anton Komlev | 3c785b2 | 2022-06-19 16:08:49 +0100 | [diff] [blame] | 103 | set PATH=<CMake_Path>\bin;%PATH% |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 104 | |
| 105 | ########################### |
| 106 | Install python dependencies |
| 107 | ########################### |
| 108 | |
| 109 | Clone the TF-M source code, and then install the TF-M's additional Python |
| 110 | dependencies. |
| 111 | |
| 112 | .. tabs:: |
| 113 | |
| 114 | .. group-tab:: Linux |
| 115 | |
| 116 | 1. get the TF-M source code: |
| 117 | |
| 118 | .. code-block:: bash |
| 119 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 120 | git clone https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git |
| 121 | |
| 122 | 2. TF-M's ``tools/requirements.txt`` file declares additional Python |
| 123 | dependencies. Install them with ``pip3``: |
| 124 | |
| 125 | .. code-block:: bash |
| 126 | |
| 127 | pip3 install --upgrade pip |
| 128 | cd trusted-firmware-m |
| 129 | pip3 install -r tools/requirements.txt |
| 130 | |
| 131 | .. group-tab:: Windows |
| 132 | |
| 133 | 1. get the TF-M source code: |
| 134 | |
| 135 | .. code-block:: bash |
| 136 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 137 | git clone https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git |
| 138 | |
| 139 | 2. TF-M's ``tools/requirements.txt`` file declares additional Python |
| 140 | dependencies. Install them with ``pip3``: |
| 141 | |
| 142 | .. code-block:: bash |
| 143 | |
| 144 | cd trusted-firmware-m |
| 145 | pip3 install -r tools\requirements.txt |
| 146 | |
| 147 | ################### |
| 148 | Install a toolchain |
| 149 | ################### |
| 150 | |
| 151 | To compile TF-M code, at least one of the supported compiler toolchains have to |
| 152 | be available in the build environment. The currently supported compiler |
| 153 | versions are: |
| 154 | |
Chris Brand | 4b381f8 | 2022-12-01 16:30:23 -0800 | [diff] [blame] | 155 | - Arm Compiler v6.13 ~ v6.14, v6.18+ |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 156 | |
| 157 | .. tabs:: |
| 158 | |
| 159 | .. group-tab:: Linux |
| 160 | |
| 161 | - Download the standalone packages from `here <https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6>`__. |
| 162 | - Add Arm Compiler into environment: |
| 163 | |
| 164 | .. code-block:: bash |
| 165 | |
David Hu | 3aca3ed | 2022-01-12 20:58:05 +0800 | [diff] [blame] | 166 | export PATH=<ARM_CLANG_PATH>/bin:$PATH |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 167 | export ARM_PRODUCT_PATH=<ARM_CLANG_PATH>/sw/mappings |
| 168 | |
David Hu | 3aca3ed | 2022-01-12 20:58:05 +0800 | [diff] [blame] | 169 | - Configure proper tool variant and license. |
| 170 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 171 | .. group-tab:: Windows |
| 172 | |
| 173 | - Download the standalone packages from `here <https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6>`__. |
| 174 | - Add Arm Compiler into environment: |
| 175 | |
| 176 | .. code-block:: bash |
| 177 | |
Anton Komlev | 3c785b2 | 2022-06-19 16:08:49 +0100 | [diff] [blame] | 178 | set PATH=<ARM_CLANG_PATH>\bin;%PATH% |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 179 | set ARM_PRODUCT_PATH=<ARM_CLANG_PATH>\sw\mappings |
| 180 | |
David Hu | 3aca3ed | 2022-01-12 20:58:05 +0800 | [diff] [blame] | 181 | - Configure proper tool variant and license. |
| 182 | |
Anton Komlev | c52e2d9 | 2021-11-25 17:20:09 +0000 | [diff] [blame] | 183 | .. note:: |
| 184 | |
David Hu | d9baf20 | 2022-05-17 15:47:21 +0800 | [diff] [blame] | 185 | Arm compiler v6.15 ~ v6.17 may cause MemManage fault. |
| 186 | This defect has been fixed since Arm compiler v6.18. |
| 187 | See [SDCOMP-59788] in Armclang v6.18 `release note`__ for details. |
| 188 | |
Anton Komlev | bd4582c | 2024-04-04 15:37:43 +0100 | [diff] [blame] | 189 | .. __: https://developer.arm.com/documentation/107814/6-18 |
Anton Komlev | c52e2d9 | 2021-11-25 17:20:09 +0000 | [diff] [blame] | 190 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 191 | - GNU Arm compiler v7.3.1+ |
| 192 | |
| 193 | .. tabs:: |
| 194 | |
| 195 | .. group-tab:: Linux |
| 196 | |
| 197 | - Download the GNU Arm compiler from `here <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`__. |
| 198 | - Add GNU Arm into environment: |
| 199 | |
| 200 | .. code-block:: bash |
| 201 | |
| 202 | export PATH=<GNU_ARM_PATH>/bin:$PATH |
| 203 | |
| 204 | .. group-tab:: Windows |
| 205 | |
| 206 | - Download the GNU Arm compiler from `here <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`__. |
| 207 | - Add GNU Arm into environment: |
| 208 | |
| 209 | .. code-block:: bash |
| 210 | |
Anton Komlev | 3c785b2 | 2022-06-19 16:08:49 +0100 | [diff] [blame] | 211 | set PATH=<GNU_ARM_PATH>\bin;%PATH% |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 212 | |
| 213 | .. note:: |
| 214 | |
| 215 | GNU Arm compiler version *10-2020-q4-major* has an issue in CMSE |
| 216 | support. The bug is reported in `here <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157>`__. |
| 217 | Select other GNU Arm compiler versions instead. |
| 218 | |
| 219 | - IAR Arm compiler v8.42.x, v8.50.x |
| 220 | |
| 221 | .. tabs:: |
| 222 | |
| 223 | .. group-tab:: Linux |
| 224 | |
Anton Komlev | bd4582c | 2024-04-04 15:37:43 +0100 | [diff] [blame] | 225 | - Download IAR build tools from `here <https://www.iar.com/products/architectures/arm/iar-embedded-workbench-for-arm>`__. |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 226 | - Add IAR Arm compiler into environment: |
| 227 | |
| 228 | .. code-block:: bash |
| 229 | |
| 230 | export PATH=<IAR_COMPILER_PATH>/bin:$PATH |
| 231 | |
| 232 | .. group-tab:: Windows |
| 233 | |
Anton Komlev | bd4582c | 2024-04-04 15:37:43 +0100 | [diff] [blame] | 234 | - Download IAR build tools from `here <https://www.iar.com/products/architectures/arm/iar-embedded-workbench-for-arm>`__. |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 235 | - Add IAR Arm compiler into environment: |
| 236 | |
| 237 | .. code-block:: bash |
| 238 | |
Anton Komlev | 3c785b2 | 2022-06-19 16:08:49 +0100 | [diff] [blame] | 239 | set PATH=<IAR_COMPILER_PATH>\bin;%PATH% |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 240 | |
| 241 | ############################# |
| 242 | Build AN521 regression sample |
| 243 | ############################# |
| 244 | |
| 245 | Here, we take building TF-M for AN521 platform with regression tests using GCC |
| 246 | as an example: |
| 247 | |
| 248 | .. tabs:: |
| 249 | |
| 250 | .. group-tab:: Linux |
| 251 | |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 252 | Get the TF-M tests source code: |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 253 | |
| 254 | .. code-block:: bash |
| 255 | |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 256 | git clone https://git.trustedfirmware.org/TF-M/tf-m-tests.git |
| 257 | |
| 258 | Build SPE and NSPE. |
| 259 | |
| 260 | .. code-block:: bash |
| 261 | |
| 262 | cd </tf-m-tests/tests_reg> |
Matthew Dalzell | cb5e8b1 | 2024-03-20 14:35:39 +0000 | [diff] [blame] | 263 | cmake -S spe -B build_spe -DTFM_PLATFORM=arm/mps2/an521 -DCONFIG_TFM_SOURCE_PATH=<TF-M source dir absolute path> \ |
| 264 | -DCMAKE_BUILD_TYPE=Debug -DTFM_TOOLCHAIN_FILE=<TF-M source dir absolute path>/toolchain_GNUARM.cmake \ |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 265 | -DTEST_S=ON -DTEST_NS=ON \ |
| 266 | cmake --build build_spe -- install |
| 267 | |
Matthew Dalzell | cb5e8b1 | 2024-03-20 14:35:39 +0000 | [diff] [blame] | 268 | cmake -S . -B build_test -DCONFIG_SPE_PATH=<tf-m-tests absolute path>/tests_reg/build_spe/api_ns \ |
| 269 | -DCMAKE_BUILD_TYPE=Debug -DTFM_TOOLCHAIN_FILE=<tf-m-tests absolute path>/tests_reg/build_spe/api_ns/cmake/toolchain_ns_GNUARM.cmake |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 270 | cmake --build build_test |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 271 | |
| 272 | .. group-tab:: Windows |
| 273 | |
Ken Liu | 6792e04 | 2023-11-13 14:48:00 +0800 | [diff] [blame] | 274 | .. important:: |
| 275 | Use "/" instead of "\\" when assigning Windows paths to CMAKE |
| 276 | variables, for example, use "c:/build" instead of "c:\\\\build". |
| 277 | |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 278 | Get the TF-M tests source code: |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 279 | |
| 280 | .. code-block:: bash |
| 281 | |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 282 | git clone https://git.trustedfirmware.org/TF-M/tf-m-tests.git |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 283 | |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 284 | Build SPE and NSPE. |
| 285 | |
| 286 | .. code-block:: bash |
| 287 | |
| 288 | cd </tf-m-tests/tests_reg> |
Matthew Dalzell | cb5e8b1 | 2024-03-20 14:35:39 +0000 | [diff] [blame] | 289 | cmake -G"Unix Makefiles" -S spe -B build_spe -DTFM_PLATFORM=arm/mps2/an521 -DCONFIG_TFM_SOURCE_PATH=<TF-M source dir absolute path> \ |
| 290 | -DCMAKE_BUILD_TYPE=Debug -DTFM_TOOLCHAIN_FILE=<TF-M source dir absolute path>/toolchain_GNUARM.cmake \ |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 291 | -DTEST_S=ON -DTEST_NS=ON \ |
| 292 | cmake --build build_spe -- install |
| 293 | |
Matthew Dalzell | cb5e8b1 | 2024-03-20 14:35:39 +0000 | [diff] [blame] | 294 | cmake -G"Unix Makefiles" -S . -B build_test -DCONFIG_SPE_PATH=<tf-m-tests absolute path>/tests_reg/build_spe/api_ns \ |
| 295 | -DCMAKE_BUILD_TYPE=Debug -DTFM_TOOLCHAIN_FILE=<tf-m-tests absolute path>/tests_reg/build_spe/api_ns/cmake/toolchain_ns_GNUARM.cmake |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 296 | cmake --build build_test |
Anton Komlev | 8150642 | 2022-02-15 21:53:13 +0000 | [diff] [blame] | 297 | |
| 298 | .. note:: |
| 299 | The latest Windows support long paths, but if you are less lucky |
| 300 | then you can reduce paths by moving the build directory closer to |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 301 | the root by changing the ``-B`` option of the commands, for example, |
| 302 | to ``C:\build_spe`` and ``C:\build_test`` folders. |
Anton Komlev | 8150642 | 2022-02-15 21:53:13 +0000 | [diff] [blame] | 303 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 304 | ########################### |
| 305 | Run AN521 regression sample |
| 306 | ########################### |
| 307 | |
| 308 | Run the sample code on SSE-200 Fast-Model, using FVP_MPS2_AEMv8M provided by |
| 309 | Arm Development Studio. |
| 310 | |
| 311 | .. note:: |
| 312 | |
| 313 | Arm Development Studio is not essential to develop TF-M, you can skip this |
| 314 | section if don't want to try on Arm develop boards. |
| 315 | |
| 316 | .. tabs:: |
| 317 | |
| 318 | .. group-tab:: Linux |
| 319 | |
| 320 | 1. install Arm Development Studio to get the fast-model. |
| 321 | |
| 322 | Download Arm Development Studio from `here <https://developer.arm.com/tools-and-software/embedded/arm-development-studio>`__. |
| 323 | |
| 324 | 2. Add ``bl2.axf`` and ``tfm_s_ns_signed.bin`` to symbol files in Debug |
| 325 | Configuration menu. |
| 326 | |
| 327 | .. code-block:: bash |
| 328 | |
| 329 | <DS_PATH>/sw/models/bin/FVP_MPS2_AEMv8M \ |
| 330 | --parameter fvp_mps2.platform_type=2 \ |
| 331 | --parameter cpu0.baseline=0 \ |
| 332 | --parameter cpu0.INITVTOR_S=0x10000000 \ |
| 333 | --parameter cpu0.semihosting-enable=0 \ |
| 334 | --parameter fvp_mps2.DISABLE_GATING=0 \ |
| 335 | --parameter fvp_mps2.telnetterminal0.start_telnet=1 \ |
| 336 | --parameter fvp_mps2.telnetterminal1.start_telnet=0 \ |
| 337 | --parameter fvp_mps2.telnetterminal2.start_telnet=0 \ |
| 338 | --parameter fvp_mps2.telnetterminal0.quiet=0 \ |
| 339 | --parameter fvp_mps2.telnetterminal1.quiet=1 \ |
| 340 | --parameter fvp_mps2.telnetterminal2.quiet=1 \ |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 341 | --application cpu0=<build_spe>/api_ns/bin/bl2.axf \ |
| 342 | --data cpu0=<build_test>/tfm_s_ns_signed.bin@0x10080000 |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 343 | |
Jason Guo | f64dc6b | 2023-07-06 15:55:26 +0800 | [diff] [blame] | 344 | .. note:: |
| 345 | |
| 346 | The log is output to telnet by default. |
| 347 | It can be also redirected to stdout by adding the following parameter. |
| 348 | |
| 349 | .. code-block:: bash |
| 350 | |
| 351 | --parameter fvp_mps2.UART0.out_file=/dev/stdout |
| 352 | |
| 353 | To automatically terminate the fast-model when it finishes running, |
| 354 | you can add the following parameters: |
| 355 | |
| 356 | .. code-block:: bash |
| 357 | |
| 358 | --parameter fvp_mps2.UART0.shutdown_on_eot=1 |
| 359 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 360 | .. group-tab:: Windows |
| 361 | |
| 362 | 1. install Arm Development Studio to get the fast-model. |
| 363 | |
| 364 | Download Arm Development Studio from `here <https://developer.arm.com/tools-and-software/embedded/arm-development-studio>`__. |
| 365 | |
| 366 | 2. Add ``bl2.axf`` and ``tfm_s_ns_signed.bin`` to symbol files in Debug |
| 367 | Configuration menu. |
| 368 | |
| 369 | .. code-block:: bash |
| 370 | |
| 371 | <DS_PATH>\sw\models\bin\FVP_MPS2_AEMv8M \ |
| 372 | --parameter fvp_mps2.platform_type=2 \ |
| 373 | --parameter cpu0.baseline=0 \ |
| 374 | --parameter cpu0.INITVTOR_S=0x10000000 \ |
| 375 | --parameter cpu0.semihosting-enable=0 \ |
| 376 | --parameter fvp_mps2.DISABLE_GATING=0 \ |
| 377 | --parameter fvp_mps2.telnetterminal0.start_telnet=1 \ |
| 378 | --parameter fvp_mps2.telnetterminal1.start_telnet=0 \ |
| 379 | --parameter fvp_mps2.telnetterminal2.start_telnet=0 \ |
| 380 | --parameter fvp_mps2.telnetterminal0.quiet=0 \ |
| 381 | --parameter fvp_mps2.telnetterminal1.quiet=1 \ |
| 382 | --parameter fvp_mps2.telnetterminal2.quiet=1 \ |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 383 | --application cpu0=<build_spe>/api_ns/bin/bl2.axf \ |
| 384 | --data cpu0=<build_test>/tfm_s_ns_signed.bin@0x10080000 |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 385 | |
Jason Guo | f64dc6b | 2023-07-06 15:55:26 +0800 | [diff] [blame] | 386 | .. note:: |
| 387 | |
| 388 | To automatically terminate the fast-model when it finishes running, |
| 389 | you can add the following parameters: |
| 390 | |
| 391 | .. code-block:: bash |
| 392 | |
| 393 | --parameter fvp_mps2.UART0.shutdown_on_eot=1 |
| 394 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 395 | After completing the procedure you should see the following messages on the |
| 396 | DAPLink UART (baud 115200 8n1):: |
| 397 | |
Kevin Peng | 2d17044 | 2023-11-20 14:09:07 +0800 | [diff] [blame] | 398 | ... |
| 399 | #### Execute test suites for the Secure area #### |
| 400 | Running Test Suite PSA protected storage S interface tests (TFM_S_PS_TEST_1XXX)... |
| 401 | > Executing 'TFM_S_PS_TEST_1001' |
| 402 | Description: 'Set interface' |
| 403 | TEST: TFM_S_PS_TEST_1001 - PASSED! |
| 404 | > Executing 'TFM_S_PS_TEST_1002' |
| 405 | Description: 'Set interface with create flags' |
| 406 | TEST: TFM_S_PS_TEST_1002 - PASSED! |
| 407 | > Executing 'TFM_S_PS_TEST_1003' |
| 408 | Description: 'Set interface with NULL data pointer' |
| 409 | TEST: TFM_S_PS_TEST_1003 - PASSED! |
| 410 | > Executing 'TFM_S_PS_TEST_1005' |
| 411 | Description: 'Set interface with write once UID' |
| 412 | TEST: TFM_S_PS_TEST_1005 - PASSED! |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 413 | .... |
| 414 | |
| 415 | ########################## |
| 416 | Tool & Dependency overview |
| 417 | ########################## |
| 418 | |
| 419 | To build the TF-M firmware the following tools are needed: |
| 420 | |
Anton Komlev | 4c436bf | 2021-10-18 21:59:55 +0100 | [diff] [blame] | 421 | - C compiler of supported toolchains |
Nik Dewally | ae923b1 | 2024-06-26 15:30:09 +0100 | [diff] [blame] | 422 | - CMake version 3.21 or later |
Anton Komlev | 4c436bf | 2021-10-18 21:59:55 +0100 | [diff] [blame] | 423 | - Git |
| 424 | - gmake, aka GNU Make |
| 425 | - Python v3.x |
Nicola Mazzucato | afd24bb | 2024-02-14 17:27:27 +0000 | [diff] [blame] | 426 | - a set of python modules listed in ``tools/requirements.txt`` |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 427 | |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 428 | **************** |
Anton Komlev | 4c436bf | 2021-10-18 21:59:55 +0100 | [diff] [blame] | 429 | Dependency chain |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 430 | **************** |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 431 | |
| 432 | .. uml:: |
| 433 | |
| 434 | @startuml |
| 435 | skinparam state { |
| 436 | BackgroundColor #92AEE0 |
| 437 | FontColor black |
| 438 | FontSize 16 |
| 439 | AttributeFontColor black |
| 440 | AttributeFontSize 16 |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 441 | } |
| 442 | state fw as "Firmware" : TF-M binary |
| 443 | state c_comp as "C Compiler" : C99 |
Anton Komlev | 4c436bf | 2021-10-18 21:59:55 +0100 | [diff] [blame] | 444 | state python as "Python" : v3.x |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 445 | |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 446 | fw --> c_comp |
| 447 | fw --> CMake |
| 448 | CMake --> gmake |
Anton Komlev | 4c436bf | 2021-10-18 21:59:55 +0100 | [diff] [blame] | 449 | CMake --> Ninja |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 450 | fw --> cryptography |
| 451 | fw --> pyasn1 |
| 452 | fw --> yaml |
| 453 | fw --> jinja2 |
Ross Burton | 5ba8239 | 2021-11-10 16:56:10 +0000 | [diff] [blame] | 454 | fw --> cbor2 |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 455 | fw --> click |
| 456 | fw --> imgtool |
Anton Komlev | 4c436bf | 2021-10-18 21:59:55 +0100 | [diff] [blame] | 457 | c_comp --> GCC |
| 458 | c_comp --> CLANG |
| 459 | c_comp --> IAR |
| 460 | cryptography --> python |
| 461 | pyasn1 --> python |
| 462 | yaml --> python |
| 463 | jinja2 --> python |
Ross Burton | 5ba8239 | 2021-11-10 16:56:10 +0000 | [diff] [blame] | 464 | cbor2 --> python |
Anton Komlev | 4c436bf | 2021-10-18 21:59:55 +0100 | [diff] [blame] | 465 | click --> python |
| 466 | imgtool --> python |
Jianliang Shen | dfddc98 | 2022-11-29 15:08:19 +0800 | [diff] [blame] | 467 | kconfiglib --> python |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 468 | @enduml |
| 469 | |
Anton Komlev | 91281f0 | 2022-04-22 09:24:20 +0100 | [diff] [blame] | 470 | .. rubric:: Next steps |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 471 | |
| 472 | Here are some next steps for exploring TF-M: |
| 473 | |
Anton Komlev | 0dbe8f1 | 2022-06-17 16:48:12 +0100 | [diff] [blame] | 474 | - Detailed :doc:`Build instructions </building/tfm_build_instruction>`. |
| 475 | - :doc:`IAR Build instructions </building/tfm_build_instruction_iar>`. |
| 476 | - Try other :doc:`Samples and Demos </building/run_tfm_examples_on_arm_platforms>`. |
| 477 | - :doc:`Documentation generation </building/documentation_generation>`. |
Summer Qin | 6d5c91c | 2021-05-24 15:32:44 +0800 | [diff] [blame] | 478 | |
| 479 | -------------- |
| 480 | |
Nicola Mazzucato | afd24bb | 2024-02-14 17:27:27 +0000 | [diff] [blame] | 481 | *Copyright (c) 2017-2024, Arm Limited. All rights reserved.* |
Chris Brand | 4b381f8 | 2022-12-01 16:30:23 -0800 | [diff] [blame] | 482 | *Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company) |
| 483 | or an affiliate of Cypress Semiconductor Corporation. All rights reserved.* |