Skip to content

Commit ebd9dc8

Browse files
Michael Schwarczmmahadevan108
authored andcommitted
LPC55S69: Use find_secure_image in post-build and add prebuilt secure images
1 parent 4573d22 commit ebd9dc8

File tree

11 files changed

+93
-4
lines changed

11 files changed

+93
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Permissive Binary License
2+
3+
Version 1.0, December 2018
4+
5+
Redistribution. Redistribution and use in binary form, without
6+
modification, are permitted provided that the following conditions are
7+
met:
8+
9+
1) Redistributions must reproduce the above copyright notice and the
10+
following disclaimer in the documentation and/or other materials
11+
provided with the distribution.
12+
13+
2) Unless to the extent explicitly permitted by law, no reverse
14+
engineering, decompilation, or disassembly of this software is
15+
permitted.
16+
17+
3) Redistribution as part of a software development kit must include the
18+
accompanying file named DEPENDENCIES and any dependencies listed in
19+
that file.
20+
21+
4) Neither the name of the copyright holder nor the names of its
22+
contributors may be used to endorse or promote products derived from
23+
this software without specific prior written permission.
24+
25+
Limited patent license. The copyright holders (and contributors) grant a
26+
worldwide, non-exclusive, no-charge, royalty-free patent license to
27+
make, have made, use, offer to sell, sell, import, and otherwise
28+
transfer this software, where such license applies only to those patent
29+
claims licensable by the copyright holders (and contributors) that are
30+
necessarily infringed by this software. This patent license shall not
31+
apply to any combinations that include this software. No hardware is
32+
licensed hereunder.
33+
34+
If you institute patent litigation against any entity (including a
35+
cross-claim or counterclaim in a lawsuit) alleging that the software
36+
itself infringes your patent(s), then your rights granted under this
37+
license shall terminate as of the date such litigation is filed.
38+
39+
DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
40+
CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
41+
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
42+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
43+
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
45+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
46+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
47+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
48+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
49+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# LPC55S69_NS prebuilt secure binaries
2+
3+
This directory tree contains Secure images released under Permissive Binary License.
4+
5+
Built by mbed-cli using ARM Compiler 6.10.1
6+
7+
These images were compiled by the following command:
8+
9+
## tfm.bin
10+
11+
```sh
12+
mbed compile -t ARMC6 -m LPC55S69_S --app-config tools/psa/tfm/mbed_app.json --profile release
13+
```
14+
15+
## spm_smoke.bin
16+
17+
```sh
18+
mbed test --compile -t ARMC6 -m LPC55S69_S --app-config tools/psa/tfm/mbed_app.json -n tests-psa-spm_smoke -DUSE_PSA_TEST_PARTITIONS -DUSE_SMOKE_TESTS_PART1 --profile release
19+
```
20+
21+
## spm_client.bin
22+
23+
```sh
24+
mbed test --compile -t ARMC6 -m LPC55S69_S --app-config tools/psa/tfm/mbed_app.json -n tests-psa-spm_client -DUSE_PSA_TEST_PARTITIONS -DUSE_CLIENT_TESTS_PART1 --profile release
25+
```
26+
27+
## spm_server.bin
28+
29+
```sh
30+
mbed test --compile -t ARMC6 -m LPC55S69_S --app-config tools/psa/tfm/mbed_app.json -n tests-psa-spm_server -DUSE_PSA_TEST_PARTITIONS -DUSE_SERVER_TESTS_PART1 -DUSE_SERVER_TESTS_PART2 --profile release
31+
```
32+
33+
To update the prebuilt binaries run the previous commands.

targets/targets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,7 @@
20902090
"STDIO_MESSAGES"
20912091
],
20922092
"post_binary_hook": {"function": "LPC55S69Code.binary_hook"},
2093+
"secure_image_filename": "tfm.bin",
20932094
"overrides": {
20942095
"non-secure-rom-start": "0x00040000",
20952096
"non-secure-rom-size": "0x58000",
@@ -2124,7 +2125,7 @@
21242125
"TRNG"
21252126
],
21262127
"deliver_to_target": "LPC55S69_NS",
2127-
"delivery_dir": "TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_M33_NS/device",
2128+
"delivery_dir": "TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_M33_NS/prebuilt",
21282129
"overrides": {
21292130
"non-secure-rom-start": "0x00040000",
21302131
"non-secure-rom-size": "0x58000",

tools/targets/LPC55S69.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525
MBED_OS_ROOT = abspath(path_join(SCRIPT_DIR, os.pardir, os.pardir))
2626
LPC55S69_BASE = path_join(MBED_OS_ROOT, 'targets', 'TARGET_NXP', 'TARGET_MCUXpresso_MCUS', 'TARGET_LPC55S69')
2727

28-
def lpc55s69_tfm_bin(t_self, non_secure_bin):
28+
def lpc55s69_tfm_bin(t_self, non_secure_bin, secure_bin):
2929
tempdir = tempfile.mkdtemp()
3030
flash_layout = path_join(LPC55S69_BASE, 'partition', 'flash_layout.h')
31-
secure_bin = path_join(LPC55S69_BASE, 'TARGET_M33_NS', 'device', 'tfm.bin')
3231
ns_bin_name, ns_bin_ext = splitext(basename(non_secure_bin))
3332
concatenated_bin = path_join(tempdir, 'tfm_' + ns_bin_name + ns_bin_ext)
3433

34+
assert os.path.isfile(flash_layout)
35+
assert os.path.isfile(secure_bin)
36+
assert os.path.isfile(non_secure_bin)
37+
3538
#1. Concatenate secure TFM and non-secure mbed binaries
3639
output = Assembly(flash_layout, concatenated_bin)
3740
output.add_image(secure_bin, "SECURE")

0 commit comments

Comments
 (0)