Awadhy Mohammed | 71bd937 | 2023-08-07 14:46:15 +0100 | [diff] [blame^] | 1 | ######################## |
| 2 | TF-M Example Application |
| 3 | ######################## |
| 4 | |
| 5 | This sub-directory provides a bare metal example NS application, demonstrating how to use the |
| 6 | artifacts exported by TF-M build. |
| 7 | |
| 8 | The application outputs "Hello TF-M world" and uses a PSA service function to demonstrate |
| 9 | that a NS application can be successfully run. |
| 10 | |
| 11 | ***************** |
| 12 | The Build Process |
| 13 | ***************** |
| 14 | |
| 15 | 1. Clone the TF-M repository at anywhere, assume the root directory is ``<TF-M Source Dir>`` |
| 16 | |
| 17 | 2. Create a build folder, for example ``build``. |
| 18 | |
| 19 | 3. Build the TF-M with the following command: |
| 20 | |
| 21 | ..code-block::bash |
| 22 | |
| 23 | cmake -S <TF-M Source Dir> -B build/spe -DTFM_PLATFORM=arm/mps2/an521 -DTFM_PROFILE=profile_small |
| 24 | cmake --build build/spe -- install |
| 25 | |
| 26 | 4. The files necessary to build TF-M will appear in ``build/spe/api_ns`` |
| 27 | |
| 28 | 5. Build this example application: |
| 29 | |
| 30 | ..code-block::bash |
| 31 | |
| 32 | cmake -S <path_to_this_example> -B build/nspe \ |
| 33 | -DCONFIG_SPE_PATH=<absolute_path_to>/build/spe/api_ns |
| 34 | cmake --build build/nspe |
| 35 | |
| 36 | ******************* |
| 37 | Run the Application |
| 38 | ******************* |
| 39 | The output binary for the application will be located in ``build/spe/bin`` and ``build/nspe``. |
| 40 | The application can be run using the SSE-200 fast-model using FVP_MPS2_AEMv8M provided by Arm |
| 41 | Development Studio. |
| 42 | Add ``bl2.axf`` and ``tfm_s_ns_signed.bin`` to the symbol files in the Debug Configuration menu. |
| 43 | |
| 44 | *Copyright (c) 2023, Arm Limited. All rights reserved.* |