1###############
2LPCXpresso55S69
3###############
4
5****************
61. Building TF-M
7****************
8
9Prepare 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
16There are two options for the TF-M build - with or without secondary bootloader (BL2).
17
181.1 Building TF-M demo without BL2
19==================================
20To build S and NS application image without a BL2, run the following commands:
21
22.. code:: bash
23
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
29
301.2 Building TF-M demo with BL2
31===============================
32
33To build S and NS application along with a BL2, run the following commands:
34
35.. code:: bash
36
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
42
431.3 Building TF-M regression tests
44==================================
45
46To buld the S and NS regression tests without BL2, run the following commands:
47
48.. code:: bash
49
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
55
56***************************
572. Flashing TF-M with PyOCD
58***************************
59
60PyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes.
61See: `PyOCD <https://pypi.org/project/pyocd/>`
62
63If you built TF-M with the BL2 secondary bootloader, use the following commands:
64
65::
66
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
70
71When BL2 is disabled, flash the generated hex secure and non-secure images:
72
73::
74
75    pyocd erase --mass -t LPC55S69
76    pyocd flash build_spe/bin/tfm_s.hex build_test/bin/tfm_ns.hex -t LPC55S69
77
78.. Note::
79
80    There is sometimes a stability issue with the pyocd flash erasing, it is needed to rerun the pyocd erase command again.
81
82--------------
83
84*Copyright (c) 2020, Linaro. All rights reserved.*
85*Copyright (c) 2020-2021, Arm Limited. All rights reserved.*
86*Copyright 2020-2024 NXP. All rights reserved.
87*SPDX-License-Identifier: BSD-3-Clause*
88