blob: 3237422161c24abef377aa4b586d6e05a6ca317e [file] [log] [blame]
Elena Uziunaite3ad0ecc2023-10-27 15:15:35 +01001################################
David Wangf55bc4e2021-08-18 15:39:24 +08002Trusted Firmware-M Extras
Elena Uziunaite3ad0ecc2023-10-27 15:15:35 +01003################################
4
David Wangf55bc4e2021-08-18 15:39:24 +08005The Trusted Firmware-M (TF-M) Extras repository is the extension of the TF-M
6main repository to host the examples, demonstrations, third-party modules,
David Hu1a65cd72022-06-08 21:01:24 +08007third-party secure partitions, etc.
David Wangf55bc4e2021-08-18 15:39:24 +08008
9*******
10License
11*******
12
Elena Uziunaite676a1462023-11-14 16:58:45 +000013The default license of new source code in this repository is `BSD 3-clause <https://git.trustedfirmware.org/TF-M/tf-m-extras.git/tree/license.rst>`_.
David Wangf55bc4e2021-08-18 15:39:24 +080014
15Some source files are contributed by the third-parties or derived from the
16external projects. A license file should be included in the root folder of these
David Hu1a65cd72022-06-08 21:01:24 +080017source files if it has a different license.
David Wangf55bc4e2021-08-18 15:39:24 +080018
19****************
20Folder Structure
21****************
22
David Hu1a65cd72022-06-08 21:01:24 +080023- `examples`: This folder hosts the examples and demos for TF-M.
24- `partitions`: This folder hosts the supplementary or third-party secure
25 partitions for TF-M.
David Wangf55bc4e2021-08-18 15:39:24 +080026
Gergely Korcsák60e1b1e2024-04-19 17:25:37 +020027*****************
28Building examples
29*****************
30
31Folders represented in the example:
32
33.. code-block:: bash
34
35 <TF-M Source Dir> Full path to TF-M Source directory/repository
36 └── <toolchain-file-from-tf-m>
37 <build-dir> Common build directory
38 ├── spe Secure side build directory
39 └── api_ns Non-Secure API callables directory
40 └── nspe Non-Secure side build directory
41
421. Building the Secure side (comes from TF-M):
43
44.. code-block:: bash
45
46 $ cmake -S <TF-M Source Dir> \
47 -B <build-dir>/spe \
48 -DTFM_PLATFORM=<tf-m-target> \
49 -DTFM_TOOLCHAIN_FILE=<toolchain-file-from-tf-m> \
50 -DCMAKE_BUILD_TYPE=<Debug,Release>
51 $ cmake --build <build-dir>/spe -- -j$(nproc) install
52
532. Build the Non-Secure side (from examples found here):
54
55.. code-block:: bash
56
57 $ cmake -S <example-path> \
58 -B <build-dir> \
59 -DCONFIG_SPE_PATH=<build-dir>/spe/api_ns
60 $ cmake --build <build-dir> -- -j$(nproc)
61
62Some examples use different flags in Secure and Non-Secure side.
63Check the examples description for further steps on proper building.
64
David Wangf55bc4e2021-08-18 15:39:24 +080065*****************************
66Contribute to this repository
67*****************************
68
Elena Uziunaite676a1462023-11-14 16:58:45 +000069Refer to :doc:`contributing process <TF-M:contributing/contributing_process>`
David Hu1a65cd72022-06-08 21:01:24 +080070for the TF-M general contribution guideline.
David Wangf55bc4e2021-08-18 15:39:24 +080071
David Hu1a65cd72022-06-08 21:01:24 +080072Please contact `TF-M development mailing list <https://lists.trustedfirmware.org/mailman3/lists/tf-m.lists.trustedfirmware.org>`_
73for any question.
74
75.. note::
76 If your contribution consists of pre-bulit binaries, please upload your
77 binary components to
78 `Trusted Firmware binary repository (tf-binaries) <https://git.trustedfirmware.org/tf-binaries.git/about/>`_.
Antonio de Angelis4f78f0d2025-01-07 21:21:02 +000079 This repository accepts source files only.
David Hu1a65cd72022-06-08 21:01:24 +080080
81Additional requirements
82=======================
83
84- It is expected and strongly recommended to integrate and test your
85 example/secure partition with TF-M latest release, to enable new features and
86 mitigate known security vulnerabilities.
87
88- List the example and secure partition in
Elena Uziunaite676a1462023-11-14 16:58:45 +000089 :doc:`example readme <examples/examples>` and
90 :doc:`secure partition readme <partitions/partitions>` respectively.
David Hu1a65cd72022-06-08 21:01:24 +080091
92 - Each example/secure partition shall specify the following information
93
94 - A brief description
95 - Maintainers with their contact emails
96 - If the example/secure partition is not integrated or tested with the
97 latest TF-M release, specify the TF-M version/commit ID tested with.
98
99 - Each example/secure partition shall follow the structure below
100
101 .. code-block:: rst
102
103 Folder name
104 ===========
105
106 Description
107 -----------
108 Simple description
109
110 Maintainers
111 -----------
112 Maintainer list and emails
113
114 TF-M version
115 ------------
116 Optional. Specify the TF-M version/commit ID if it is not integrated or
117 test with latest TF-M release.
118
Elena Uziunaite3ad0ecc2023-10-27 15:15:35 +0100119.. toctree::
120 :caption: Overview
Elena Uziunaited9c1db12023-11-07 16:58:32 +0000121 :titlesonly:
Elena Uziunaite3ad0ecc2023-10-27 15:15:35 +0100122 :hidden:
123
124 Partitions <partitions/index>
125 Examples <examples/index>
126
127.. toctree::
128 :caption: Links
Elena Uziunaite3ad0ecc2023-10-27 15:15:35 +0100129 :hidden:
130
131 Trusted Firmware-M <https://trustedfirmware-m.readthedocs.io/en/latest/>
Elena Uziunaited9c1db12023-11-07 16:58:32 +0000132 TF-M Tests <https://trustedfirmware-m.readthedocs.io/projects/tf-m-tests/en/latest/>
133 TF-M Tools <https://trustedfirmware-m.readthedocs.io/projects/tf-m-tools/en/latest/>
Elena Uziunaite3ad0ecc2023-10-27 15:15:35 +0100134
135--------------
David Hu1a65cd72022-06-08 21:01:24 +0800136
Gergely Korcsák60e1b1e2024-04-19 17:25:37 +0200137*Copyright (c) 2021-2024, Arm Limited. All rights reserved.*