blob: 4a5ef84307d204e5e7fe391633f5d4e7660f4d81 [file] [log] [blame]
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +02001###############
Kevin Townsenda26983f2020-04-06 13:26:21 +02002LPCXpresso55S69
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +02003###############
Kevin Townsenda26983f2020-04-06 13:26:21 +02004
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +02005****************
61. Building TF-M
7****************
Kevin Townsenda26983f2020-04-06 13:26:21 +02008
Andrej Butok52570402024-04-12 10:24:38 +02009Prepare 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
MartinaHanusovaNXP8dfc2882021-04-29 16:53:49 +020016There are two options for the TF-M build - with or without secondary bootloader (BL2).
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +020017
181.1 Building TF-M demo without BL2
19==================================
Andrej Butok52570402024-04-12 10:24:38 +020020To build S and NS application image without a BL2, run the following commands:
David Vinczeb56c5ad2020-10-08 15:50:46 +020021
22.. code:: bash
23
Andrej Butok52570402024-04-12 10:24:38 +020024 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 Vinczeb56c5ad2020-10-08 15:50:46 +020029
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +0200301.2 Building TF-M demo with BL2
31===============================
32
Andrej Butok52570402024-04-12 10:24:38 +020033To build S and NS application along with a BL2, run the following commands:
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +020034
35.. code:: bash
MartinaHanusovaNXP535aefd2021-07-20 14:45:01 +020036
Andrej Butok52570402024-04-12 10:24:38 +020037 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
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +020042
431.3 Building TF-M regression tests
44==================================
45
Andrej Butok52570402024-04-12 10:24:38 +020046To buld the S and NS regression tests without BL2, run the following commands:
MartinaHanusovaNXP11644b62021-04-22 10:16:47 +020047
48.. code:: bash
MartinaHanusovaNXP535aefd2021-07-20 14:45:01 +020049
Andrej Butok52570402024-04-12 10:24:38 +020050 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
MartinaHanusovaNXP535aefd2021-07-20 14:45:01 +020055
Andrej Butok52570402024-04-12 10:24:38 +020056***************************
572. Flashing TF-M with PyOCD
58***************************
David Vinczeb56c5ad2020-10-08 15:50:46 +020059
Anton Komlevbd4582c2024-04-04 15:37:43 +010060PyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes.
Andrej Butok52570402024-04-12 10:24:38 +020061See: `PyOCD <https://pypi.org/project/pyocd/>`
MartinaHanusovaNXP8dfc2882021-04-29 16:53:49 +020062
63If you built TF-M with the BL2 secondary bootloader, use the following commands:
Andrej Butok52570402024-04-12 10:24:38 +020064
MartinaHanusovaNXP8dfc2882021-04-29 16:53:49 +020065::
66
Andrej Butok52570402024-04-12 10:24:38 +020067 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
MartinaHanusovaNXP8dfc2882021-04-29 16:53:49 +020070
71When BL2 is disabled, flash the generated hex secure and non-secure images:
Andrej Butok52570402024-04-12 10:24:38 +020072
MartinaHanusovaNXP8dfc2882021-04-29 16:53:49 +020073::
74
Andrej Butok52570402024-04-12 10:24:38 +020075 pyocd erase --mass -t LPC55S69
76 pyocd flash build_spe/bin/tfm_s.hex build_test/bin/tfm_ns.hex -t LPC55S69
MartinaHanusovaNXP8dfc2882021-04-29 16:53:49 +020077
78.. Note::
79
Andrej Butok52570402024-04-12 10:24:38 +020080 There is sometimes a stability issue with the pyocd flash erasing, it is needed to rerun the pyocd erase command again.
Kevin Townsenda26983f2020-04-06 13:26:21 +020081
82--------------
83
84*Copyright (c) 2020, Linaro. All rights reserved.*
Kevin Peng300c68d2021-08-12 17:40:17 +080085*Copyright (c) 2020-2021, Arm Limited. All rights reserved.*
Andrej Butok52570402024-04-12 10:24:38 +020086*Copyright 2020-2024 NXP. All rights reserved.
Anton Komlevbd4582c2024-04-04 15:37:43 +010087*SPDX-License-Identifier: BSD-3-Clause*