David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 1 | ######################################## |
| 2 | Trusted Firmware-M Profile Medium Design |
| 3 | ######################################## |
| 4 | |
| 5 | :Authors: David Hu |
| 6 | :Organization: Arm Limited |
| 7 | :Contact: david.hu@arm.com |
| 8 | |
| 9 | ************ |
| 10 | Introduction |
| 11 | ************ |
| 12 | |
| 13 | Compared with Profile Small, Profile Medium aims to securely connect devices to |
| 14 | Cloud services with asymmetric cipher support. |
| 15 | Profile Medium target devices need more resources for more cipher algorithms |
| 16 | and higher isolation levels. |
| 17 | |
| 18 | For more descriptions and background of TF-M Profile, please refer to Profile |
| 19 | Small design document [PROFILE-S]_. |
| 20 | |
| 21 | ************** |
| 22 | Overall design |
| 23 | ************** |
| 24 | |
| 25 | TF-M Profile Medium defines the following feature set: |
| 26 | |
| 27 | - Firmware Framework |
| 28 | |
| 29 | - Inter-Process Communication (IPC) model [PSA-FF-M]_ |
| 30 | - Isolation level 2 [PSA-FF-M]_ |
| 31 | |
| 32 | - Internal Trusted Storage (ITS) |
| 33 | |
| 34 | - Crypto |
| 35 | |
David Hu | f40be93 | 2021-05-12 15:52:16 +0800 | [diff] [blame] | 36 | - Support both symmetric cryptography and asymmetric cryptography |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 37 | - Asymmetric key based cipher suite suggested in TLS/DTLS profiles for |
| 38 | IoT [RFC7925]_ and CoAP [RFC7252]_, including |
| 39 | |
| 40 | - Authenticated Encryption with Associated Data (AEAD) algorithm |
| 41 | - Asymmetric key algorithm based signature and verification |
| 42 | - Public-key cryptography based key exchange |
| 43 | - Hash function |
| 44 | - HMAC for default Pseudorandom Function (PRF) |
| 45 | |
| 46 | - Asymmetric digital signature and verification for Initial Attestation |
| 47 | Token (IAT) |
| 48 | |
| 49 | - Initial Attestation |
| 50 | |
| 51 | - Asymmetric key algorithm based Initial Attestation |
| 52 | |
| 53 | - Lightweight boot |
| 54 | |
| 55 | - Anti-rollback protection |
| 56 | - Multiple image boot |
| 57 | |
| 58 | - Protected Storage (PS) if off-chip storage device is integrated |
| 59 | |
| 60 | - Data confidentiality |
| 61 | - Data integrity |
| 62 | - Rollback protection |
| 63 | |
| 64 | ************** |
| 65 | Design details |
| 66 | ************** |
| 67 | |
| 68 | More details of TF-M Profile Medium design are described in following sections. |
| 69 | |
| 70 | Firmware framework |
| 71 | ================== |
| 72 | |
| 73 | Profile Medium with IPC model and isolation level 2 aims to support usage |
| 74 | scenarios which require more complicated secure service model and additional |
| 75 | protection to PSA RoT. |
| 76 | |
| 77 | Level 2 isolation |
| 78 | ----------------- |
| 79 | |
| 80 | Profile Medium selects isolation level 2 by default. In addition to isolation |
| 81 | level 1, the PSA Root of Trust (PSA RoT) is also protected from access by the |
| 82 | Application Root of Trust (App RoT) in level 2 isolation. |
| 83 | |
| 84 | IPC model |
| 85 | --------- |
| 86 | |
| 87 | Profile Medium enables IPC model by default. IPC model can achieve a more |
| 88 | flexible framework and higher levels of isolation, but may require more memory |
| 89 | footprint and bring in longer latency, compared to Library model. |
| 90 | |
| 91 | TF-M IPC model implementation follows the PSA Firmware Framework for M |
| 92 | (PSA-FF-M) [PSA-FF-M]_. |
| 93 | |
| 94 | Crypto service |
| 95 | ============== |
| 96 | |
David Hu | f40be93 | 2021-05-12 15:52:16 +0800 | [diff] [blame] | 97 | Compared to Profile Small, Profile Medium includes asymmetric cryptography to |
| 98 | support direct connection to Cloud services via common protocols, such as |
| 99 | TLS/DTLS 1.2. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 100 | |
| 101 | As suggested in CoAP [RFC7252]_ and [RFC7925]_, TF-M Profile Medium by default |
| 102 | selects ``TLS_ECDHE_ECDSA_WITH_AES_128_CCM`` as reference, which requires: |
| 103 | |
| 104 | - ECDHE_ECDSA as key exchange algorithm. |
| 105 | - AES-128-CCM (AES CCM mode with 128-bit key) as AEAD algorithm. |
| 106 | Platforms can implement AES-128-CCM with truncated authentication tag to |
| 107 | achieve less network bandwidth [RFC7925]_. |
| 108 | - SHA256 as Hash function. |
| 109 | - HMAC as Message Authentication Code algorithm. |
| 110 | |
| 111 | Applications can also support TLS PSK [RFC4279]_ cipher suites, such as |
| 112 | ``TLS_PSK_WITH_AES_128_CCM`` [RFC7925]_. |
| 113 | |
| 114 | .. note :: |
| 115 | |
| 116 | **Implementation note** |
| 117 | |
| 118 | Developers can replace default algorithms with others or implement more |
| 119 | algorithms according to actual usage scenarios and device capabilities. |
| 120 | |
| 121 | If a Crypto hardware accelerator is integrated, the cipher suites and |
| 122 | algorithms also depend on those accelerator features. |
| 123 | |
| 124 | More details of cipher suite are described below. |
| 125 | |
| 126 | Digital signature and verification |
| 127 | ---------------------------------- |
| 128 | |
| 129 | ECDSA is selected by default in Profile Medium. |
| 130 | ECDSA requires much shorter keys compared with RSA at the same security level. |
| 131 | Therefore, ECDSA can cost less storage area for assets and less network |
| 132 | bandwidth to setup a TLS connection. |
| 133 | ECDSA is also preferred for forward compatibility of future TLS versions. |
| 134 | |
| 135 | As requested in [RFC7251]_, ECC curve ``secp256r1`` should be supported. More |
| 136 | ECC curves can be added based on the requirements in production. |
| 137 | |
| 138 | If usage scenarios require RSA algorithm for backward compatibility and legacy |
| 139 | applications, platforms can add RSA support or replace ECDSA with RSA. The |
| 140 | cipher suite should be switched accordingly. |
| 141 | |
| 142 | AEAD algorithm |
| 143 | -------------- |
| 144 | |
| 145 | If Protected Storage (PS) is implemented, it is recommended to select the same |
| 146 | AEAD algorithm for PS service as the one used by TLS/DTLS cipher suite. |
| 147 | |
| 148 | Internal Trusted Storage |
| 149 | ======================== |
| 150 | |
| 151 | The configuration of ITS is the same as those in Profile Small [PROFILE-S]_. |
| 152 | |
| 153 | Lightweight boot |
| 154 | ================ |
| 155 | |
| 156 | BL2 implementation can be device specific. Devices may implement diverse |
| 157 | boot processes with different features and configurations. |
| 158 | However, the boot loader must support anti-rollback protection. Boot loader must |
| 159 | be able to prevent unauthorized rollback, to protect devices from being |
| 160 | downgraded to earlier versions with known vulnerabilities. |
| 161 | |
| 162 | MCUBoot in TF-M is configured as multiple image boot by default in Profile |
| 163 | Medium. In multiple image boot, secure and non-secure images can be signed |
| 164 | independently with different keys and they can be updated separately. It can |
| 165 | support multiple vendors scenarios, in which non-secure and secure images are |
| 166 | generated and updated by different vendors. |
| 167 | Multiple image boot may require more storage area compared with single image |
| 168 | boot. |
| 169 | |
| 170 | Protected Storage |
| 171 | ================= |
| 172 | |
| 173 | PS service is required if an off-chip storage device is integrated and used on |
| 174 | the platform. |
| 175 | |
| 176 | TF-M PS service relies on an AEAD algorithm to ensure data confidentiality and |
| 177 | integrity. It is recommended to select the same AEAD algorithm as the one used |
| 178 | for TLS/DTLS cipher suite. |
| 179 | |
| 180 | Anti-rollback protection in PS relies on non-volatile counter(s) provided by |
| 181 | TF-M Platform Secure Partition (SP). |
| 182 | |
| 183 | TF-M audit logging service |
| 184 | ========================== |
| 185 | |
| 186 | TF-M audit logging service allows secure services in the system to log critical |
| 187 | system events and information. |
| 188 | |
| 189 | TF-M audit logging service is not enabled in Profile Medium since its IPC model |
| 190 | dedicated interface is not ready yet. |
| 191 | |
| 192 | .. note :: |
| 193 | |
| 194 | **Implementation note** |
| 195 | |
| 196 | Please note that there is no dedicated PSA specification for Audit Logging |
| 197 | yet. |
| 198 | The design, interfaces and implementation of TF-M audit logging service may |
| 199 | change. |
| 200 | |
| 201 | ************** |
| 202 | Implementation |
| 203 | ************** |
| 204 | |
| 205 | Overview |
| 206 | ======== |
| 207 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 208 | The basic idea is to add dedicated profile CMake configuration files under |
| 209 | folder ``config/profile`` for TF-M Profile Medium default configuration, the |
| 210 | same as Profile Small does. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 211 | |
| 212 | The top-level Profile Medium config file collects all the necessary |
| 213 | configuration flags and set them to default values, to explicitly enable the |
| 214 | features required in Profile Medium and disable the unnecessary ones, during |
| 215 | TF-M build. |
| 216 | |
| 217 | A platform/use case can provide a configuration extension file to overwrite |
| 218 | Profile Medium default setting and append other configurations. |
| 219 | This configuration extension file can be added via parameter |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 220 | ``TFM_EXTRA_CONFIG_PATH`` in build command line. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 221 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 222 | The behaviour of the Profile Medium build flow (particularly the order of |
| 223 | configuration loading and overriding) can be found at |
| 224 | :ref:`tfm_cmake_configuration` |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 225 | |
| 226 | The details of configurations will be covered in each module in |
| 227 | `Implementation details`_. |
| 228 | |
| 229 | Implementation details |
| 230 | ====================== |
| 231 | |
| 232 | This section discusses the details of Profile Medium implementation. |
| 233 | |
| 234 | Top-level configuration files |
| 235 | ----------------------------- |
| 236 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 237 | The firmware framework configurations in ``config/profile/profile_medium`` are |
| 238 | shown below. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 239 | |
| 240 | .. table:: Config flags in Profile Medium top-level CMake config file |
| 241 | :widths: auto |
| 242 | :align: center |
| 243 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 244 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 245 | | Configs | Default value | Descriptions | |
| 246 | +============================================+=====================================================================================================+=====================================+ |
| 247 | | ``TFM_ISOLATION_LEVEL`` | ``2`` | Select level 2 isolation | |
| 248 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 249 | | ``TFM_PSA_API`` | ``True`` | Select IPC model | |
| 250 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 251 | | ``TFM_PARTITION_INTERNAL_TRUSTED_STORAGE`` | ``ON`` | Enable ITS SP | |
| 252 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 253 | | ``ITS_BUF_SIZE`` | ``32`` | ITS internal transient buffer size | |
| 254 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 255 | | ``TFM_PARTITION_CRYPTO`` | ``ON`` | Enable Crypto service | |
| 256 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
David Hu | f40be93 | 2021-05-12 15:52:16 +0800 | [diff] [blame] | 257 | | ``CRYPTO_ASYM_ENCRYPT_MODULE_DISABLED`` | ``ON`` | Disable Crypto asymmetric | |
| 258 | | | | encryption operations | |
| 259 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 260 | | ``TFM_MBEDCRYPTO_CONFIG_PATH`` | ``${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto/mbedcrypto_config/tfm_mbedcrypto_config_profile_medium.h`` | Mbed Crypto config file path | |
| 261 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 262 | | ``TFM_PARTITION_INITIAL_ATTESTATION`` | ``ON`` | Enable Initial Attestation service | |
| 263 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 264 | | ``TFM_PARTITION_PROTECTED_STORAGE`` [1]_ | ``ON`` | Enable PS service | |
| 265 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 266 | | ``TFM_PARTITION_PLATFORM`` | ``ON`` | Enable TF-M Platform SP | |
| 267 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
| 268 | | ``TFM_PARTITION_AUDIT_LOG`` | ``OFF`` | Disable TF-M audit logging service | |
| 269 | +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+ |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 270 | |
| 271 | .. [1] PS service is enabled by default. Platforms without off-chip storage |
| 272 | devices can turn off ``TFM_PARTITION_PROTECTED_STORAGE`` to disable PS |
| 273 | service. See `Protected Storage Secure Partition`_ for details. |
| 274 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 275 | .. Note:: |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 276 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 277 | Where a configuration is the same as the default in |
| 278 | ``config/config_default.cmake``, it is omitted from the profile configuration |
| 279 | file. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 280 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 281 | Test configuration |
| 282 | ^^^^^^^^^^^^^^^^^^ |
| 283 | |
| 284 | Standard regression test configuration applies. This means that enabling |
| 285 | regression testing via |
| 286 | |
| 287 | ``-DTEST_S=ON -DTEST_NS=ON`` |
| 288 | |
| 289 | Will enable testing for all enabled partitions. See above for details of enabled |
| 290 | partitions. Because Profile Medium enables IPC mode, the IPC tests are also |
| 291 | enabled. |
| 292 | |
| 293 | Some cryptography tests are disabled due to the reduced Mbed Crypto config. |
| 294 | |
| 295 | .. table:: TFM options in Profile Medium top-level CMake config file |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 296 | :widths: auto |
| 297 | :align: center |
| 298 | |
David Hu | f40be93 | 2021-05-12 15:52:16 +0800 | [diff] [blame] | 299 | +--------------------------------------------+---------------+--------------------------------+ |
| 300 | | Configs | Default value | Descriptions | |
| 301 | +============================================+===============+================================+ |
| 302 | | ``TFM_CRYPTO_TEST_ALG_CBC`` | ``OFF`` | Disable CBC mode test | |
| 303 | +--------------------------------------------+---------------+--------------------------------+ |
| 304 | | ``TFM_CRYPTO_TEST_ALG_CCM`` | ``ON`` | Enable CCM mode test | |
| 305 | +--------------------------------------------+---------------+--------------------------------+ |
| 306 | | ``TFM_CRYPTO_TEST_ALG_CFB`` | ``OFF`` | Disable CFB mode test | |
| 307 | +--------------------------------------------+---------------+--------------------------------+ |
| 308 | | ``TFM_CRYPTO_TEST_ALG_CTR`` | ``OFF`` | Disable CTR mode test | |
| 309 | +--------------------------------------------+---------------+--------------------------------+ |
| 310 | | ``TFM_CRYPTO_TEST_ALG_GCM`` | ``OFF`` | Disable GCM mode test | |
| 311 | +--------------------------------------------+---------------+--------------------------------+ |
| 312 | | ``TFM_CRYPTO_TEST_ALG_SHA_512`` | ``OFF`` | Disable SHA-512 algorithm test | |
| 313 | +--------------------------------------------+---------------+--------------------------------+ |
| 314 | | ``TFM_CRYPTO_TEST_HKDF`` | ``OFF`` | Disable HKDF algorithm test | |
| 315 | +--------------------------------------------+---------------+--------------------------------+ |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 316 | |
| 317 | Device configuration extension |
| 318 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 319 | |
| 320 | To change default configurations and add platform specific configurations, |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 321 | a platform can add a platform configuration file at |
| 322 | ``platform/ext<TFM_PLATFORM>/config.cmake`` |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 323 | |
| 324 | Crypto service configurations |
| 325 | ----------------------------- |
| 326 | |
| 327 | Crypto Secure Partition |
| 328 | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 329 | |
David Hu | f40be93 | 2021-05-12 15:52:16 +0800 | [diff] [blame] | 330 | TF-M Profile Medium enables Crypto SP in top-level CMake config file. |
| 331 | The following PSA Crypto operationts are enabled by default. |
| 332 | |
| 333 | - Hash operations |
| 334 | - Message authentication codes |
| 335 | - Symmetric ciphers |
| 336 | - AEAD operations |
| 337 | - Asymmetric key algorithm based signature and verification |
| 338 | - Key derivation |
| 339 | - Key management |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 340 | |
| 341 | Mbed Crypto configurations |
| 342 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 343 | |
| 344 | TF-M Profile Medium adds a dedicated Mbed Crypto config file |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 345 | ``tfm_mbedcrypto_config_profile_medium.h`` at |
David Hu | f40be93 | 2021-05-12 15:52:16 +0800 | [diff] [blame] | 346 | ``/lib/ext/mbedcrypto/mbedcrypto_config`` folder, instead of the common one |
| 347 | ``tfm_mbedcrypto_config_default.h`` [CRYPTO-DESIGN]_. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 348 | |
| 349 | Major Mbed Crypto configurations are set as listed below: |
| 350 | |
| 351 | - Enable SHA256 |
| 352 | - Enable generic message digest wrappers |
| 353 | - Enable AES |
| 354 | - Enable CCM mode for symmetric ciphers |
| 355 | - Disable other modes for symmetric ciphers |
| 356 | - Enable ECDH |
| 357 | - Enable ECDSA |
| 358 | - Select ECC curve ``secp256r1`` |
| 359 | - Other configurations required by selected option above |
| 360 | |
| 361 | Other configurations can be selected to optimize the memory footprint of Crypto |
| 362 | module. |
| 363 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 364 | A device/use case can append an extra config header to the Profile Medium |
| 365 | default Mbed Crypto config file. This can be done by setting the |
| 366 | ``TFM_MBEDCRYPTO_PLATFORM_EXTRA_CONFIG_PATH`` cmake variable in the platform |
| 367 | config file ``platform/ext<TFM_PLATFORM>/config.cmake``. This cmake variable is |
| 368 | a wrapper around the ``MBEDTLS_USER_CONFIG_FILE`` options, but is preferred as |
| 369 | it keeps all configuration in cmake. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 370 | |
| 371 | Internal Trusted Storage configurations |
| 372 | --------------------------------------- |
| 373 | |
| 374 | ITS service is enabled in top-level Profile Medium CMake config file by default. |
| 375 | |
| 376 | The internal transient buffer size ``ITS_BUF_SIZE`` [ITS-INTEGRATE]_ is set to |
| 377 | 32 bytes by default. A platform/use case can overwrite the buffer size in its |
| 378 | specific configuration extension according to its actual requirement of assets |
| 379 | and Flash attributes. |
| 380 | |
| 381 | Profile Medium CMake config file won't touch the configurations of device |
| 382 | specific Flash hardware attributes [ITS-INTEGRATE]_. |
| 383 | |
| 384 | Protected Storage Secure Partition |
| 385 | ---------------------------------- |
| 386 | |
| 387 | Data confidentiality, integrity and anti-rollback protection are enabled by |
| 388 | default in PS. |
| 389 | |
| 390 | If PS is selected, AES-CCM is used as AEAD algorithm by default. It requires to |
| 391 | enable PS implementation to select diverse AEAD algorithm. |
| 392 | |
| 393 | If platforms don't integrate any off-chip storage device, platforms can disable |
| 394 | PS in platform specific configuration extension file via |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 395 | ``platform/ext<TFM_PLATFORM>/config.cmake``. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 396 | |
| 397 | BL2 setting |
| 398 | ----------- |
| 399 | |
| 400 | Profile Medium enables MCUBoot provided by TF-M by default. A platform can |
| 401 | overwrite this configuration by disabling MCUBoot in its configuration extension |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 402 | file ``platform/ext<TFM_PLATFORM>/config.cmake``. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 403 | |
| 404 | If MCUBoot provided by TF-M is enabled, multiple image boot is selected by |
| 405 | default in TF-M Profile Medium top-level CMake config file. |
| 406 | |
| 407 | If a device implements its own boot loader, the configurations are |
| 408 | implementation defined. |
| 409 | |
| 410 | **************** |
| 411 | Platform support |
| 412 | **************** |
| 413 | |
| 414 | To enable Profile Medium on a platform, the platform specific CMake file should |
| 415 | be added into the platform support list in top-level Profile Medium CMake config |
| 416 | file. |
| 417 | |
| 418 | Building Profile Medium |
| 419 | ======================= |
| 420 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 421 | To build Profile Medium, argument ``TFM_PROFILE`` in build command line should be |
| 422 | set to ``profile_medium``. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 423 | |
| 424 | Take AN521 as an example: |
| 425 | |
| 426 | The following commands build Profile Medium without test cases on **AN521** with |
| 427 | build type **MinSizeRel**, built by **Armclang**. |
| 428 | |
| 429 | .. code-block:: bash |
| 430 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 431 | cd <TFM root dir> |
| 432 | mkdir build && cd build |
Summer Qin | 2de23d0 | 2021-05-14 13:44:14 +0800 | [diff] [blame^] | 433 | cmake -DTFM_PLATFORM=arm/mps2/an521 \ |
Raef Coles | 6981732 | 2020-10-19 14:14:14 +0100 | [diff] [blame] | 434 | -DTFM_TOOLCHAIN_FILE=../toolchain_ARMCLANG.cmake \ |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 435 | -DTFM_PROFILE=profile_medium \ |
| 436 | -DCMAKE_BUILD_TYPE=MinSizeRel \ |
| 437 | ../ |
| 438 | cmake --build ./ -- install |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 439 | |
| 440 | The following commands build Profile Medium with regression test cases on |
| 441 | **AN521** with build type **MinSizeRel**, built by **Armclang**. |
| 442 | |
| 443 | .. code-block:: bash |
| 444 | |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 445 | cd <TFM root dir> |
| 446 | mkdir build && cd build |
Summer Qin | 2de23d0 | 2021-05-14 13:44:14 +0800 | [diff] [blame^] | 447 | cmake -DTFM_PLATFORM=arm/mps2/an521 \ |
Raef Coles | 6981732 | 2020-10-19 14:14:14 +0100 | [diff] [blame] | 448 | -DTFM_TOOLCHAIN_FILE=../toolchain_ARMCLANG.cmake \ |
Anton Komlev | b8e3af0 | 2020-08-28 10:23:57 +0100 | [diff] [blame] | 449 | -DTFM_PROFILE=profile_medium \ |
| 450 | -DCMAKE_BUILD_TYPE=MinSizeRel \ |
| 451 | -DTEST_S=ON -DTEST_NS=ON \ |
| 452 | ../ |
| 453 | cmake --build ./ -- install |
| 454 | |
| 455 | .. Note:: |
| 456 | |
| 457 | - For devices with more contrained memory and flash requirements, it is |
| 458 | possible to build with either only TEST_S enabled or only TEST_NS enabled. |
| 459 | This will decrease the size of the test images. Note that both test suites |
| 460 | must still be run to ensure correct operation. |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 461 | |
| 462 | More details of building instructions and parameters can be found TF-M build |
| 463 | instruction guide [TFM-BUILD]_. |
| 464 | |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 465 | ********* |
| 466 | Reference |
| 467 | ********* |
| 468 | |
| 469 | .. [PSA-FF-M] `Arm Platform Security Architecture Firmware Framework 1.0 <https://developer.arm.com/-/media/Files/pdf/PlatformSecurityArchitecture/Architect/DEN0063-PSA_Firmware_Framework-1.0.0-2.pdf?revision=2d1429fa-4b5b-461a-a60e-4ef3d8f7f4b4>`_ |
| 470 | |
| 471 | .. [RFC7925] `Transport Layer Security (TLS) / Datagram Transport Layer Security (DTLS) Profiles for the Internet of Things <https://tools.ietf.org/html/rfc7925>`_ |
| 472 | |
Summer Qin | abf6698 | 2021-04-06 17:22:15 +0800 | [diff] [blame] | 473 | .. [PROFILE-S] :doc:`Trusted Firmware-M Profile Small Design </docs/technical_references/profiles/tfm_profile_small>` |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 474 | |
| 475 | .. [RFC7252] `The Constrained Application Protocol (CoAP) <https://tools.ietf.org/html/rfc7252>`_ |
| 476 | |
| 477 | .. [RFC4279] `Pre-Shared Key Ciphersuites for Transport Layer Security (TLS) <https://tools.ietf.org/html/rfc4279>`_ |
| 478 | |
| 479 | .. [RFC7251] `AES-CCM Elliptic Curve Cryptography (ECC) Cipher Suites for TLS <https://tools.ietf.org/html/rfc7251>`_ |
| 480 | |
Summer Qin | abf6698 | 2021-04-06 17:22:15 +0800 | [diff] [blame] | 481 | .. [CRYPTO-DESIGN] :doc:`Crypto design </docs/technical_references/tfm_crypto_design>` |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 482 | |
Summer Qin | abf6698 | 2021-04-06 17:22:15 +0800 | [diff] [blame] | 483 | .. [ITS-INTEGRATE] :doc:`ITS integration guide </docs/integration_guide/services/tfm_its_integration_guide>` |
David Hu | 5fc31c1 | 2020-05-16 22:36:06 +0800 | [diff] [blame] | 484 | |
| 485 | .. [TFM-BUILD] :doc:`TF-M build instruction </docs/getting_started/tfm_build_instruction>` |
| 486 | |
| 487 | -------------- |
| 488 | |
Summer Qin | abf6698 | 2021-04-06 17:22:15 +0800 | [diff] [blame] | 489 | *Copyright (c) 2020-2021, Arm Limited. All rights reserved.* |