blob: a97a1e11e6fe247bf03b4c0020d7e8b539131e3c [file] [log] [blame]
David Huc9a45592020-02-17 20:26:10 +08001#######################################
2Trusted Firmware-M Profile Small Design
3#######################################
4
5:Authors: David Hu
6:Organization: Arm Limited
7:Contact: david.hu@arm.com
8
9************
10Introduction
11************
12
13The capabilities and resources may dramatically vary on different IoT devices.
14Some IoT devices may have very limited memory resource. The program on those
15devices should keep small memory footprint and basic functionalities.
16On the other hand, some devices may consist of more memory and extended storage,
17to support stronger software capabilities.
18
19Diverse IoT use cases also require different levels of security and requirements
20on device resource. For example, use cases require different cipher
21capabilities. Selecting cipher suites can be sensitive to memory footprint on
22devices with constrained resource.
23
24Trusted Firmware-M (TF-M) defines 3 general profiles, Profile Small,
25Profile Medium and Profile Large, to provide different levels of security to fit
26diverse device capabilities and use cases.
27Each profile specifies a predefined list of features, targeting typical use
28cases with specific hardware constraints. Profiles can serve as reference
29designs, based on which developers can continue further development and
30configurations, according to use case.
31
32As one of the TF-M Profiles, TF-M Profile Small (Profile S) consists of
33lightweight TF-M framework and basic Secure Services to keep smallest memory
34footprint, supporting fundamental security features on devices with ultra
35constrained resource.
36
37This profile enables connecting with Edge Gateways and IoT Cloud Services
38supporting secure connection based solely on symmetric cryptography.
39
40This document summarizes and discusses the features specified in TF-M Profile
41Small.
42
43**************
44Overall design
45**************
46
47TF-M Profile Small defines the following features:
48
49 - Lightweight framework
50
51 - Library model
52 - Level 1 isolation
53 - Buffer sharing allowed
54 - Single secure context
55
56 - Crypto
57
58 - Symmetric cipher only
59 - Cipher suite for symmetric-key algorithms based protocols, such as
60 cipher suites defined in TLS pre-shared key (TLS-PSK) [1]_.
61
62 - Advanced Encryption Standard (AES) as symmetric crypto algorithm
63 - SHA256 as Hash function
64 - HMAC as Message Authentication Code algorithm
65
66 - Internal Trusted Storage (ITS)
67
68 - No encryption
69 - No rollback protection
70 - Decrease internal transient buffer size
71
72 - Initial Attestation
73
74 - Based on symmetric key algorithms
75
76 - Lightweight boot
77
78 - Single image boot
79 - Anti-rollback protection is enabled
80
81
82Protected Storage, audit logging and other Secure Services provided by TF-M are
83disabled by default.
84
85**************
86Design details
87**************
88
89More details of TF-M Profile Small design are discussed in following sections.
90
91Lightweight framework
92=====================
93
94Library model
95-------------
96
97Profile Small selects Library model in TF-M. Library model implements secure
98function calls, via which clients directly call secure services. It provides a
99more simple implementation of TF-M framework and may reduce memory footprint,
100compared with Inter-Process Communication (IPC) model [2]_.
101
102.. note ::
103
104 **Implementation note**
105
106 Please note that there is no public dedicated specification for Library
107 model.
108 The design, interfaces and implementation of Library model in TF-M may
109 change.
110
111Level 1 isolation
112-----------------
113
114So far, TF-M Library model only supports level 1 isolation [2]_, which isolates
115Secure Processing Environment (SPE) from Non-secure Processing Environment
116(NSPE). Neither level 2 nor level 3 isolation [2]_ is implemented in TF-M
117Library model.
118
119PSA Root of Trust (PSA RoT) and Application Root of Trust (ARoT) are isolated
120from each other in level 2 isolation.
121Individual secure partitions are isolated from each other even within a
122particular security domain (PSA RoT, ARoT), in level 3 isolation.
123
124Profile Small dedicated use cases with simple service model may not require
125level 2 or level 3 isolation. Devices which Profile Small aims at may be unable
126to implement stricter isolation, limited by hardware capabilities.
127
128Level 1 isolation reduces requirements enforced by hardware isolation and cost
129of software for management.
130
131.. note ::
132
133 **Security note**
134
135 If a device or a use case enforces level 2 or level 3 isolation, it is
136 suggested to apply other configurations, other than TF-M Profile Small.
137
138Buffer sharing allowed
139----------------------
140
141To simplify interface and reduce memory footprint, TF-M Library model directly
142handles client call input vectors from non-secure client buffers and later
143writes results back to those buffers, without keeping a copy in a transient
144buffer inside TF-M.
145
146.. note ::
147
148 **Security note**
149
150 There can be security vulnerabilities if non-secure client buffers are
151 directly shared between NSPE and SPE, such as Time-of-check to time-of-use
152 (TOCTOU) attack.
153
154 Developers need to check if this can meet the Security Functional
155 Requirements (SFR) of the integration of their devices.
156 Some SFRs are listed in a set of example Threat Models and Security Analyses
157 (TMSA) offered by PSA for common IoT use cases. [3]_
158
159Single secure context
160---------------------
161
162TF-M Library model only supports single secure context.
163
164It cannot support multiple contexts or the scheduling implemented in IPC model.
165It neither can support multiple outstanding PSA client calls.
166
167But correspondingly, it can save memory footprint and runtime complexity in
168context management and scheduling.
169
170.. note ::
171
172 **Security note**
173
174 Non-secure software should prevent triggering multiple outstanding PSA
175 client calls concurrently. Otherwise, it may crash current running secure
176 context.
177
178Crypto service
179==============
180
181TF-M Profile Small only requires symmetric crypto since symmetric algorithms
182require shorter keys and less computational burden, compared with asymmetric
183crypto.
184
185By default, TF-M Profile Small requires the same capabilities as defined in
186TLS-PSK, to support symmetric key algorithms based protocols.
187
188.. note ::
189
190 **Implementation note**
191
192 Please note that TF-M Profile Small doesn't require that TLS-PSK is
193 mandatory in applications. Instead, Profile Small only requires the same
194 capabilities as defined in TLS-PSK, such as one symmetric cipher algorithm
195 and one hash function.
196
197TF-M Profile Small selects TLS-PSK cipher suite TLS_PSK_WITH_AES_128_CCM [4]_
198as reference, which requires:
199
200 - AES-128-CCM (AES CCM mode with 128-bit key) as symmetric crypto algorithm
201 - SHA256 as Hash function
202 - HMAC as Message Authentication Code algorithm
203
204TLS_PSK_WITH_AES_128_CCM is selected since it requires small key length and less
205hardware capabilities, while keeping enough level of security.
206
207.. note ::
208
209 **Implementation note**
210
211 Developers can replace default algorithms with others or implement more
212 algorithms.
213
214 Proper symmetric key algorithms and cipher suites should be selected
215 according to device capabilities, the use case and the requirement of peers
216 in connection.
217
218 Refer to `Crypto service configuration`_ for implementation details of
219 configuring algorithms and cipher suites.
220
221.. note ::
222
223 **Security note**
224
225 It is recommended not to use MD5 or SHA-1 for message digests as they are
226 subject to collision attacks [5]_ [6]_.
227
228Secure Storage
229==============
230
231TF-M Profile Small assumes that extremely constrained devices only contain basic
232on-chip storage, without external or removable storage.
233As a result, TF-M Profile Small includes ITS service and disables Protected
234Storage service.
235
236Encryption and rollback protection
237----------------------------------
238
239Neither encryption nor rollback protection is enabled in current ITS
240implementation.
241
242It is expected that ITS relies solely on the physical inaccessibility property
243of on-chip storage, together with PSA isolation, without requiring additional
244cryptographic protection.
245
246Internal transient buffer
247-------------------------
248
249ITS implements a internal transient buffer [7]_ to hold the data read
250from/written to storage, especially for flash, to solve the alignment and
251security issues.
252
253The internal transient buffer is aligned to the flash device’s program unit.
254Copying data to it from the caller can align all write requests to the flash
255device’s program unit.
256The internal transient buffer can help protect Flash access from some attacks,
257such as TOCTOU attack.
258
259Although removing this internal buffer can save some memory consumption,
260typically 512 bytes, it may bring alignment or security issues.
261Therefore, to achieve a better trade-off between memory footprint and security,
262TF-M Profile Small optimizes the internal buffer size to 32 bytes by default.
263
264As discussed in `Crypto service`_, TF-M Profile Small requires AES-128 and
265SHA-256, which use 128-bit key and 256-bit key respectively.
266Besides, either long public/private keys or PKI-based certificates should be
267very rare as asymmetric crypto is not supported in Profile Small.
268Therefore, a 32-byte internal buffer should cover the assets in TF-M Profile
269Small use cases.
270
271The buffer size can be adjusted according to use case and device Flash
272attributes. Refer to `Internal Trusted Storage configurations`_ for more
273details.
274
275Initial Attestation
276===================
277
278Profile Small requires an Initial Attestation secure service based on symmetric
279key algorithms. Refer to PSA Attestation API document [8]_ for details of
280Initial Attestation based on symmetric key algorithms.
281
282It can heavily increase memory footprint to support Initial Attestation based on
283asymmetric key algorithms, due to asymmetric ciphers and related PKI modules.
284
285.. note ::
286
287 **Implementation note**
288
289 As pointed out by PSA Attestation API document [8]_, the use cases of
290 Initial Attestation based on symmetric key algorithms can be limited due to
291 the associated infrastructure costs for key management and operational
292 complexities. It may also restrict the ability to interoperate with
293 scenarios that involve third parties.
294
295 If asymmetric key algorithms based Initial Attestation is required in use
296 scenarios, it is recommended to select other TF-M Profiles which support
297 asymmetric key algorithms.
298
299.. note ::
300
301 **Implementation note**
302
303 It is recommended to utilize the same MAC algorithm supported in Crypto
304 service to complete the signing in ``COSE_Mac0``, to minimize memory
305 footprint.
306
307Lightweight boot
308================
309
310If MCUBoot provided by TF-M is enabled, single image boot [9]_ is selected by
311default in Profile Small.
312In case of single image boot, secure and non-secure images are handled as a
313single blob and signed together during image generation.
314
315However, secure and non-secure images must be updated together in single image
316boot. It may decrease the flexibility of image update and cost longer update
317process. Since the image sizes should usually be small with limited
318functionalities in Profile Small dedicated use case, the cost may still be
319reasonable.
320
321BL2 implementation can be device specific. Devices may implement diverse
322boot processes with different features and configurations.
323However, anti-rollback protection is required as a mandatory feature of boot
324loader. Boot loader should be able to prevent unauthorized rollback, to protect
325devices from being downgraded to earlier versions with known vulnerabilities.
326
327**************
328Implementation
329**************
330
331Overview
332========
333
Anton Komlevb8e3af02020-08-28 10:23:57 +0100334The basic idea is to add dedicated profile CMake configuration files under
335folder ``config/profile`` for TF-M Profile Small default configuration.
David Huc9a45592020-02-17 20:26:10 +0800336
Anton Komlevb8e3af02020-08-28 10:23:57 +0100337The top-level Profile Small config file collects all the necessary
338configuration flags and set them to default values, to explicitly enable the
339features required in Profile Small and disable the unnecessary ones, during
340TF-M build.
David Huc9a45592020-02-17 20:26:10 +0800341
342A platform/use case can provide a configuration extension file to overwrite
343Profile Small default setting and append other configurations.
344This configuration extension file can be added via parameter
Anton Komlevb8e3af02020-08-28 10:23:57 +0100345``TFM_EXTRA_CONFIG_PATH`` in build command line.
David Huc9a45592020-02-17 20:26:10 +0800346
Anton Komlevb8e3af02020-08-28 10:23:57 +0100347The behaviour of the Profile Small build flow (particularly the order of
348configuration loading and overriding) can be found at
349:ref:`tfm_cmake_configuration`
David Huc9a45592020-02-17 20:26:10 +0800350
Anton Komlevb8e3af02020-08-28 10:23:57 +0100351The details of configurations will be covered in each module in
352`Implementation details`_.
David Huc9a45592020-02-17 20:26:10 +0800353
354Implementation details
355======================
356
357This section discusses the details of Profile Small implementation.
358
Anton Komlevb8e3af02020-08-28 10:23:57 +0100359Top-level configuration files
360-----------------------------
361
362The firmware framework configurations in ``config/profile/profile_small`` are
363shown below.
364
365.. table:: TFM options in Profile Small top-level CMake config file
366 :widths: auto
367 :align: center
368
369 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
370 | Configs | Default value | Descriptions |
371 +============================================+=====================================================================================================+=====================================+
372 | ``TFM_ISOLATION_LEVEL`` | ``1`` | Select level 2 isolation |
373 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
374 | ``TFM_PSA_API`` | ``FALSE`` | Select IPC model |
375 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
376 | ``TFM_PARTITION_INTERNAL_TRUSTED_STORAGE`` | ``ON`` | Enable ITS SP |
377 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
378 | ``ITS_BUF_SIZE`` | ``32`` | ITS internal transient buffer size |
379 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
380 | ``TFM_PARTITION_CRYPTO`` | ``ON`` | Enable Crypto service |
381 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
382 | ``TFM_MBEDCRYPTO_CONFIG_PATH`` | ``${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto/mbedcrypto_config/tfm_mbedcrypto_config_profile_small.h`` | Mbed Crypto config file path |
383 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
David Hu0c250bc2021-05-12 10:55:53 +0800384 | ``CRYPTO_ASYM_SIGN_MODULE_DISABLED`` | ``ON`` | Disable asymmetric signature |
385 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
386 | ``CRYPTO_ASYM_ENCRYPT_MODULE_DISABLED`` | ``ON`` | Disable asymmetric encryption |
Anton Komlevb8e3af02020-08-28 10:23:57 +0100387 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
388 | ``TFM_PARTITION_INITIAL_ATTESTATION`` | ``ON`` | Enable Initial Attestation service |
389 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
390 | ``SYMMETRIC_INITIAL_ATTESTATION`` | ``ON`` | Enable symmetric attestation |
391 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
392 | ``TFM_PARTITION_PROTECTED_STORAGE`` | ``OFF`` | Enable PS service |
393 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
394 | ``TFM_PARTITION_PLATFORM`` | ``OFF`` | Enable TF-M Platform SP |
395 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
396 | ``TFM_PARTITION_AUDIT_LOG`` | ``OFF`` | Disable TF-M audit logging service |
397 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
398
David Huc9a45592020-02-17 20:26:10 +0800399.. note ::
400
401 **Implementation note**
402
403 The following sections focus on the feature selection via configuration
404 setting.
405 Dedicated optimization on memory footprint is not covered in this document.
406
Anton Komlevb8e3af02020-08-28 10:23:57 +0100407Test configuration
408^^^^^^^^^^^^^^^^^^
David Huc9a45592020-02-17 20:26:10 +0800409
Anton Komlevb8e3af02020-08-28 10:23:57 +0100410Standard regression test configuration applies. This means that enabling
411regression testing via
David Huc9a45592020-02-17 20:26:10 +0800412
Anton Komlevb8e3af02020-08-28 10:23:57 +0100413``-DTEST_S=ON -DTEST_NS=ON``
David Huc9a45592020-02-17 20:26:10 +0800414
Anton Komlevb8e3af02020-08-28 10:23:57 +0100415Will enable testing for all enabled partitions. See above for details of enabled
416partitions. Because Profile Small does not enable IPC mode, the IPC tests are
417not enabled.
418
419Some cryptography tests are disabled due to the reduced Mbed Crypto config.
420
421.. table:: TFM options in Profile Small top-level CMake config file
422 :widths: auto
423 :align: center
424
425 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
426 | Configs | Default value | Descriptions |
427 +============================================+=====================================================================================================+=====================================+
428 | ``TFM_CRYPTO_TEST_ALG_CBC`` | ``OFF`` | Test CBC cryptography mode |
429 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
430 | ``TFM_CRYPTO_TEST_ALG_CCM`` | ``ON`` | Test CCM cryptography mode |
431 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
432 | ``TFM_CRYPTO_TEST_ALG_CFB`` | ``OFF`` | Test CFB cryptography mode |
433 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
434 | ``TFM_CRYPTO_TEST_ALG_CTR`` | ``OFF`` | Test CTR cryptography mode |
435 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
436 | ``TFM_CRYPTO_TEST_ALG_GCM`` | ``OFF`` | Test GCM cryptography mode |
437 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
438 | ``TFM_CRYPTO_TEST_ALG_SHA_512`` | ``OFF`` | Test SHA-512 cryptography algorithm |
439 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
440 | ``TFM_CRYPTO_TEST_HKDF`` | ``OFF`` | Test SHA-512 cryptography algorithm |
441 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
David Huc9a45592020-02-17 20:26:10 +0800442
443Device configuration extension
444^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
445
Anton Komlevb8e3af02020-08-28 10:23:57 +0100446To change default configurations and add platform specific configurations,
447a platform can add a platform configuration file at
448``platform/ext<TFM_PLATFORM>/config.cmake``
David Huc9a45592020-02-17 20:26:10 +0800449
450TF-M framework setting
451----------------------
452
453The top-level Profile Small CMake config file selects Library model and level 1
454isolation.
455
456Crypto service configuration
457----------------------------
458
459Crypto Secure Partition
460^^^^^^^^^^^^^^^^^^^^^^^
461
462TF-M Profile Small enables Crypto Secure Partition (SP) in its top-level CMake
463config file. Crypto SP modules not supported in TF-M Profile Small are disabled.
464The disabled modules are shown below.
465
466 - Disable asymmetric cipher
David Huc9a45592020-02-17 20:26:10 +0800467
468Other modules and configurations [10]_ are kept as default values.
469
470Additional configuration flags with more fine granularity can be added to
471control building of specific crypto algorithms and corresponding test cases.
472
473Mbed Crypto configurations
474^^^^^^^^^^^^^^^^^^^^^^^^^^
475
476TF-M Profile Small adds a dedicated Mbed Crypto config file
Anton Komlevb8e3af02020-08-28 10:23:57 +0100477``tfm_mbedcrypto_config_profile_small.h`` at
478``/lib/ext/mbedcrypto/mbedcrypto_config``
479file, instead of the common one ``tfm_mbedcrypto_config_default.h`` [10]_.
David Huc9a45592020-02-17 20:26:10 +0800480
481Major Mbed Crypto configurations are set as listed below:
482
483 - Enable SHA256
484 - Enable generic message digest wrappers
485 - Enable AES
486 - Enable CCM mode for symmetric ciphers
487 - Disable other modes for symmetric ciphers
488 - Disable asymmetric ciphers
489 - Disable HMAC-based key derivation function (HKDF)
490
491Other configurations can be selected to optimize the memory footprint of Crypto
492module.
493
Anton Komlevb8e3af02020-08-28 10:23:57 +0100494A device/use case can append an extra config header to the Profile Small
495default Mbed Crypto config file. This can be done by setting the
496``TFM_MBEDCRYPTO_PLATFORM_EXTRA_CONFIG_PATH`` cmake variable in the platform
497config file ``platform/ext<TFM_PLATFORM>/config.cmake``. This cmake variable is
498a wrapper around the ``MBEDTLS_USER_CONFIG_FILE`` options, but is preferred as
499it keeps all configuration in cmake.
David Huc9a45592020-02-17 20:26:10 +0800500
501Internal Trusted Storage configurations
502---------------------------------------
503
504ITS service is enabled in top-level Profile Small CMake config file.
505
506The internal transient buffer size ``ITS_BUF_SIZE`` [7]_ is set to 32 bytes by
507default. A platform/use case can overwrite the buffer size in its specific
508configuration extension according to its actual requirement of assets and Flash
509attributes.
510
511Profile Small CMake config file won't touch the configurations of device
512specific Flash hardware attributes [7]_.
513
514Initial Attestation secure service
515----------------------------------
516
517TF-M Profile Small provides a reference implementation of symmetric key
518algorithms based Initial Attestation, using HMAC SHA-256 as MAC algorithm in
519``COSE_Mac0`` structure. The implementation follows PSA Attestation API document
520[8]_.
521
522Profile Small top-level config file enables Initial Attestation secure service
523and selects symmetric key algorithms based Initial Attestation by default.
524
525 - Set ``TFM_PARTITION_INITIAL_ATTESTATION`` to ``ON``
526 - Set ``SYMMETRIC_INITIAL_ATTESTATION`` to ``ON``
527
528Symmetric and asymmetric key algorithms based Initial Attestation can share the
529same generations of token claims, except Instance ID claim.
530
531Profile Small may implement the procedure or rely on a 3rd-party tool to
532construct and sign ``COSE_Mac0`` structure.
533
534Details of symmetric key algorithms based Initial Attestation design will be
535covered in a dedicated document.
536
537Disabled secure services
538------------------------
539
540Audit logging, Protected Storage, and Platform Service are disabled by default
541in Profile Small top-level CMake config file.
542
543BL2 setting
544-----------
545
546Profile Small enables MCUBoot provided by TF-M by default. A platform can
547overwrite this configuration by disabling MCUBoot in its configuration extension
Anton Komlevb8e3af02020-08-28 10:23:57 +0100548file ``platform/ext<TFM_PLATFORM>/config.cmake``.
David Huc9a45592020-02-17 20:26:10 +0800549
550If MCUBoot provided by TF-M is enabled, single image boot is selected in TF-M
551Profile Small top-level CMake config file.
552
David Huc9a45592020-02-17 20:26:10 +0800553If a device implements its own boot loader, the configurations are
554implementation defined.
555
Anton Komlevb8e3af02020-08-28 10:23:57 +0100556.. table:: BL2 options in Profile Small top-level CMake config file
557 :widths: auto
558 :align: center
559
560 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
561 | Configs | Default value | Descriptions |
562 +============================================+=====================================================================================================+=====================================+
563 | ``BL2`` | ``ON`` | Enable MCUBoot bootloader |
564 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
565 | ``MCUBOOT_IMAGE_NUMBER`` | ``1`` | Combine S and NS images |
566 +--------------------------------------------+-----------------------------------------------------------------------------------------------------+-------------------------------------+
567
David Huc9a45592020-02-17 20:26:10 +0800568****************
569Platform support
570****************
571
David Huc9a45592020-02-17 20:26:10 +0800572Building Profile Small
573======================
574
Anton Komlevb8e3af02020-08-28 10:23:57 +0100575To build Profile Small, argument ``TFM_PROFILE`` in build command line should be
576set to ``profile_small``.
David Huc9a45592020-02-17 20:26:10 +0800577
578Take AN521 as an example.
579
580The following commands build Profile Small without test cases on **AN521** with
581build type **MinSizeRel**, built by **Armclang**.
582
583.. code-block:: bash
584
Anton Komlevb8e3af02020-08-28 10:23:57 +0100585 cd <TFM root dir>
586 mkdir build && cd build
Summer Qin2de23d02021-05-14 13:44:14 +0800587 cmake -DTFM_PLATFORM=arm/mps2/an521 \
Raef Coles69817322020-10-19 14:14:14 +0100588 -DTFM_TOOLCHAIN_FILE=../toolchain_ARMCLANG.cmake \
Anton Komlevb8e3af02020-08-28 10:23:57 +0100589 -DTFM_PROFILE=profile_small \
590 -DCMAKE_BUILD_TYPE=MinSizeRel \
591 ../
592 cmake --build ./ -- install
David Huc9a45592020-02-17 20:26:10 +0800593
594The following commands build Profile Small with regression test cases on **AN521**
595with build type **MinSizeRel**, built by **Armclang**.
596
597.. code-block:: bash
598
Anton Komlevb8e3af02020-08-28 10:23:57 +0100599 cd <TFM root dir>
600 mkdir build && cd build
Summer Qin2de23d02021-05-14 13:44:14 +0800601 cmake -DTFM_PLATFORM=arm/mps2/an521 \
Raef Coles69817322020-10-19 14:14:14 +0100602 -DTFM_TOOLCHAIN_FILE=../toolchain_ARMCLANG.cmake \
Anton Komlevb8e3af02020-08-28 10:23:57 +0100603 -DTFM_PROFILE=profile_small \
604 -DCMAKE_BUILD_TYPE=MinSizeRel \
605 -DTEST_S=ON -DTEST_NS=ON \
606 ../
607 cmake --build ./ -- install
608
609.. Note::
610
611 - For devices with more contrained memory and flash requirements, it is
612 possible to build with either only TEST_S enabled or only TEST_NS enabled.
613 This will decrease the size of the test images. Note that both test suites
614 must still be run to ensure correct operation.
David Huc9a45592020-02-17 20:26:10 +0800615
616More details of building instructions and parameters can be found TF-M build
617instruction guide [11]_.
618
David Huc9a45592020-02-17 20:26:10 +0800619*********
620Reference
621*********
622
623.. [1] `Pre-Shared Key Ciphersuites for Transport Layer Security (TLS) <https://tools.ietf.org/html/rfc4279>`_
624
625.. [2] `DEN0063 Arm Platform Security Architecture Firmware Framework 1.0 <https://developer.arm.com/-/media/Files/pdf/DeviceSecurityArchitecture/Architect/DEN0063-PSA_Firmware_Framework-1.0.0-2.pdf?revision=2d1429fa-4b5b-461a-a60e-4ef3d8f7f4b4>`_
626
627.. [3] `PSA analyze stage <https://developer.arm.com/architectures/security-architectures/platform-security-architecture#analyze>`_
628
629.. [4] `AES-CCM Cipher Suites for Transport Layer Security (TLS) <https://tools.ietf.org/html/rfc6655>`_
630
631.. [5] `Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms <https://tools.ietf.org/html/rfc6151>`_
632
633.. [6] `Transitioning the Use of Cryptographic Algorithms and Key Lengths <https://www.nist.gov/publications/transitioning-use-cryptographic-algorithms-and-key-lengths>`_
634
Summer Qinabf66982021-04-06 17:22:15 +0800635.. [7] :doc:`ITS integration guide </docs/integration_guide/services/tfm_its_integration_guide>`
David Huc9a45592020-02-17 20:26:10 +0800636
637.. [8] `PSA Attestation API 1.0 (ARM IHI 0085) <https://developer.arm.com/-/media/Files/pdf/PlatformSecurityArchitecture/Implement/IHI0085-PSA_Attestation_API-1.0.2.pdf?revision=eef78753-c77e-4b24-bcf0-65596213b4c1&la=en&hash=E5E0353D612077AFDCE3F2F3708A50C77A74B2A3>`_
638
Summer Qinabf66982021-04-06 17:22:15 +0800639.. [9] :doc:`Secure boot </docs/technical_references/tfm_secure_boot>`
David Huc9a45592020-02-17 20:26:10 +0800640
Summer Qinabf66982021-04-06 17:22:15 +0800641.. [10] :doc:`Crypto design </docs/technical_references/tfm_crypto_design>`
David Huc9a45592020-02-17 20:26:10 +0800642
Minos Galanakise4094012020-06-12 14:25:34 +0100643.. [11] :doc:`TF-M build instruction </docs/getting_started/tfm_build_instruction>`
David Huc9a45592020-02-17 20:26:10 +0800644
645--------------
646
Summer Qinabf66982021-04-06 17:22:15 +0800647*Copyright (c) 2020-2021, Arm Limited. All rights reserved.*