Elena Uziunaite | 3ad0ecc | 2023-10-27 15:15:35 +0100 | [diff] [blame] | 1 | ################################ |
David Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 2 | Trusted Firmware-M Extras |
Elena Uziunaite | 3ad0ecc | 2023-10-27 15:15:35 +0100 | [diff] [blame] | 3 | ################################ |
| 4 | |
David Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 5 | The Trusted Firmware-M (TF-M) Extras repository is the extension of the TF-M |
| 6 | main repository to host the examples, demonstrations, third-party modules, |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 7 | third-party secure partitions, etc. |
David Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 8 | |
| 9 | ******* |
| 10 | License |
| 11 | ******* |
| 12 | |
Elena Uziunaite | 676a146 | 2023-11-14 16:58:45 +0000 | [diff] [blame] | 13 | The 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 Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 14 | |
| 15 | Some source files are contributed by the third-parties or derived from the |
| 16 | external projects. A license file should be included in the root folder of these |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 17 | source files if it has a different license. |
David Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 18 | |
| 19 | **************** |
| 20 | Folder Structure |
| 21 | **************** |
| 22 | |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 23 | - `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 Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 26 | |
Gergely Korcsák | 60e1b1e | 2024-04-19 17:25:37 +0200 | [diff] [blame] | 27 | ***************** |
| 28 | Building examples |
| 29 | ***************** |
| 30 | |
| 31 | Folders 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 | |
| 42 | 1. 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 | |
| 53 | 2. 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 | |
| 62 | Some examples use different flags in Secure and Non-Secure side. |
| 63 | Check the examples description for further steps on proper building. |
| 64 | |
David Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 65 | ***************************** |
| 66 | Contribute to this repository |
| 67 | ***************************** |
| 68 | |
Elena Uziunaite | 676a146 | 2023-11-14 16:58:45 +0000 | [diff] [blame] | 69 | Refer to :doc:`contributing process <TF-M:contributing/contributing_process>` |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 70 | for the TF-M general contribution guideline. |
David Wang | f55bc4e | 2021-08-18 15:39:24 +0800 | [diff] [blame] | 71 | |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 72 | Please contact `TF-M development mailing list <https://lists.trustedfirmware.org/mailman3/lists/tf-m.lists.trustedfirmware.org>`_ |
| 73 | for 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 Angelis | 4f78f0d | 2025-01-07 21:21:02 +0000 | [diff] [blame] | 79 | This repository accepts source files only. |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 80 | |
| 81 | Additional 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 Uziunaite | 676a146 | 2023-11-14 16:58:45 +0000 | [diff] [blame] | 89 | :doc:`example readme <examples/examples>` and |
| 90 | :doc:`secure partition readme <partitions/partitions>` respectively. |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 91 | |
| 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 Uziunaite | 3ad0ecc | 2023-10-27 15:15:35 +0100 | [diff] [blame] | 119 | .. toctree:: |
| 120 | :caption: Overview |
Elena Uziunaite | d9c1db1 | 2023-11-07 16:58:32 +0000 | [diff] [blame] | 121 | :titlesonly: |
Elena Uziunaite | 3ad0ecc | 2023-10-27 15:15:35 +0100 | [diff] [blame] | 122 | :hidden: |
| 123 | |
| 124 | Partitions <partitions/index> |
| 125 | Examples <examples/index> |
| 126 | |
| 127 | .. toctree:: |
| 128 | :caption: Links |
Elena Uziunaite | 3ad0ecc | 2023-10-27 15:15:35 +0100 | [diff] [blame] | 129 | :hidden: |
| 130 | |
| 131 | Trusted Firmware-M <https://trustedfirmware-m.readthedocs.io/en/latest/> |
Elena Uziunaite | d9c1db1 | 2023-11-07 16:58:32 +0000 | [diff] [blame] | 132 | 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 Uziunaite | 3ad0ecc | 2023-10-27 15:15:35 +0100 | [diff] [blame] | 134 | |
| 135 | -------------- |
David Hu | 1a65cd7 | 2022-06-08 21:01:24 +0800 | [diff] [blame] | 136 | |
Gergely Korcsák | 60e1b1e | 2024-04-19 17:25:37 +0200 | [diff] [blame] | 137 | *Copyright (c) 2021-2024, Arm Limited. All rights reserved.* |