MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 1 | ############### |
Kevin Townsend | a26983f | 2020-04-06 13:26:21 +0200 | [diff] [blame] | 2 | LPCXpresso55S69 |
MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 3 | ############### |
Kevin Townsend | a26983f | 2020-04-06 13:26:21 +0200 | [diff] [blame] | 4 | |
MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 5 | **************** |
| 6 | 1. Building TF-M |
| 7 | **************** |
Kevin Townsend | a26983f | 2020-04-06 13:26:21 +0200 | [diff] [blame] | 8 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 9 | Prepare the tf-m-tests repository inside the TF-M base folder. |
| 10 | |
| 11 | .. code-block:: bash |
| 12 | |
| 13 | cd <TF-M base folder> |
| 14 | git clone https://git.trustedfirmware.org/TF-M/tf-m-tests.git |
| 15 | |
MartinaHanusovaNXP | 8dfc288 | 2021-04-29 16:53:49 +0200 | [diff] [blame] | 16 | There are two options for the TF-M build - with or without secondary bootloader (BL2). |
MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 17 | |
| 18 | 1.1 Building TF-M demo without BL2 |
| 19 | ================================== |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 20 | To build S and NS application image without a BL2, run the following commands: |
David Vincze | b56c5ad | 2020-10-08 15:50:46 +0200 | [diff] [blame] | 21 | |
| 22 | .. code:: bash |
| 23 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 24 | cd <TF-M base folder>/tf-m-test/tests_reg |
| 25 | cmake -S spe -B build_spe -DTFM_PLATFORM=nxp/lpcxpresso55s69 -DCONFIG_TFM_SOURCE_PATH=<TF-M base folder>/trusted-firmware-m -G"Unix Makefiles" -DBL2=OFF |
| 26 | cmake --build build_spe -- install |
| 27 | cmake -S . -B build_test -G"Unix Makefiles" -DCONFIG_SPE_PATH=<TF-M base folder>/tf-m-tests/tests_reg/build_spe/api_ns |
| 28 | cmake --build build_test |
David Vincze | b56c5ad | 2020-10-08 15:50:46 +0200 | [diff] [blame] | 29 | |
MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 30 | 1.2 Building TF-M demo with BL2 |
| 31 | =============================== |
| 32 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 33 | To build S and NS application along with a BL2, run the following commands: |
MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 34 | |
| 35 | .. code:: bash |
MartinaHanusovaNXP | 535aefd | 2021-07-20 14:45:01 +0200 | [diff] [blame] | 36 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 37 | cd <TF-M base folder>/tf-m-test/tests_reg |
| 38 | cmake -S spe -B build_spe -DTFM_PLATFORM=nxp/lpcxpresso55s69 -DCONFIG_TFM_SOURCE_PATH=<TF-M base folder>/trusted-firmware-m -G"Unix Makefiles" -DBL2=ON |
| 39 | cmake --build build_spe -- install |
| 40 | cmake -S . -B build_test -G"Unix Makefiles" -DCONFIG_SPE_PATH=<TF-M base folder>/tf-m-tests/tests_reg/build_spe/api_ns |
| 41 | cmake --build build_test |
MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 42 | |
| 43 | 1.3 Building TF-M regression tests |
| 44 | ================================== |
| 45 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 46 | To buld the S and NS regression tests without BL2, run the following commands: |
MartinaHanusovaNXP | 11644b6 | 2021-04-22 10:16:47 +0200 | [diff] [blame] | 47 | |
| 48 | .. code:: bash |
MartinaHanusovaNXP | 535aefd | 2021-07-20 14:45:01 +0200 | [diff] [blame] | 49 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 50 | cd <TF-M base folder>/tf-m-test/tests_reg |
| 51 | cmake -S spe -B build_spe -DTFM_PLATFORM=nxp/lpcxpresso55s69 -DCONFIG_TFM_SOURCE_PATH=<TF-M base folder>/trusted-firmware-m -G"Unix Makefiles" -DTEST_S=ON -DTEST_NS=ON -DBL2=OFF |
| 52 | cmake --build build_spe -- install |
| 53 | cmake -S . -B build_test -G"Unix Makefiles" -DCONFIG_SPE_PATH=<TF-M base folder>/tf-m-tests/tests_reg/build_spe/api_ns |
| 54 | cmake --build build_test |
MartinaHanusovaNXP | 535aefd | 2021-07-20 14:45:01 +0200 | [diff] [blame] | 55 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 56 | *************************** |
| 57 | 2. Flashing TF-M with PyOCD |
| 58 | *************************** |
David Vincze | b56c5ad | 2020-10-08 15:50:46 +0200 | [diff] [blame] | 59 | |
Anton Komlev | bd4582c | 2024-04-04 15:37:43 +0100 | [diff] [blame] | 60 | PyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes. |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 61 | See: `PyOCD <https://pypi.org/project/pyocd/>` |
MartinaHanusovaNXP | 8dfc288 | 2021-04-29 16:53:49 +0200 | [diff] [blame] | 62 | |
| 63 | If you built TF-M with the BL2 secondary bootloader, use the following commands: |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 64 | |
MartinaHanusovaNXP | 8dfc288 | 2021-04-29 16:53:49 +0200 | [diff] [blame] | 65 | :: |
| 66 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 67 | pyocd erase --mass -t LPC55S69 |
| 68 | pyocd flash build_spe/bin/bl2.hex -t LPC55S69 |
| 69 | pyocd flash build_test/tfm_s_ns_signed.bin --base-address 0x8000 -t LPC55S69 |
MartinaHanusovaNXP | 8dfc288 | 2021-04-29 16:53:49 +0200 | [diff] [blame] | 70 | |
| 71 | When BL2 is disabled, flash the generated hex secure and non-secure images: |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 72 | |
MartinaHanusovaNXP | 8dfc288 | 2021-04-29 16:53:49 +0200 | [diff] [blame] | 73 | :: |
| 74 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 75 | pyocd erase --mass -t LPC55S69 |
| 76 | pyocd flash build_spe/bin/tfm_s.hex build_test/bin/tfm_ns.hex -t LPC55S69 |
MartinaHanusovaNXP | 8dfc288 | 2021-04-29 16:53:49 +0200 | [diff] [blame] | 77 | |
| 78 | .. Note:: |
| 79 | |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 80 | There is sometimes a stability issue with the pyocd flash erasing, it is needed to rerun the pyocd erase command again. |
Kevin Townsend | a26983f | 2020-04-06 13:26:21 +0200 | [diff] [blame] | 81 | |
| 82 | -------------- |
| 83 | |
| 84 | *Copyright (c) 2020, Linaro. All rights reserved.* |
Kevin Peng | 300c68d | 2021-08-12 17:40:17 +0800 | [diff] [blame] | 85 | *Copyright (c) 2020-2021, Arm Limited. All rights reserved.* |
Andrej Butok | 5257040 | 2024-04-12 10:24:38 +0200 | [diff] [blame] | 86 | *Copyright 2020-2024 NXP. All rights reserved. |
Anton Komlev | bd4582c | 2024-04-04 15:37:43 +0100 | [diff] [blame] | 87 | *SPDX-License-Identifier: BSD-3-Clause* |