-
Notifications
You must be signed in to change notification settings - Fork 29
/
tfm.mk
473 lines (412 loc) · 19.5 KB
/
tfm.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# FreeRTOS STM32 Reference Integration
#
# Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# https://www.FreeRTOS.org
# https://github.com/FreeRTOS
#
# WORKSPACE_PATH, BUILD_PATH, and PROJECT_NAME must be provided by the caller.
# This can be done either as an argument to make or in the environment.
# Other vars may be overridden as needed.
###############################################################################
# Config
###############################################################################
SHELL = /bin/bash
.NOTPARALLEL:
.ONESHELL:
.DEFAULT_GOAL = all
# Normalize Paths
BUILD_PATH := .
WORKSPACE_PATH := $(realpath $(WORKSPACE_PATH))
###############################################################################
# Path Definitions
###############################################################################
TOOLS_PATH = ${WORKSPACE_PATH}/tools
MIDDLEWARE_PATH = $(realpath ${WORKSPACE_PATH}/Middleware)
TFM_SRC_PATH = $(realpath ${MIDDLEWARE_PATH}/ARM/trusted-firmware-m)
MBEDTLS_SRC_PATH = $(realpath ${MIDDLEWARE_PATH}/ARM/mbedtls)
MCUBOOT_SRC_PATH = $(realpath ${MIDDLEWARE_PATH}/ARM/mcuboot)
PROJECT_PATH = ..
TFM_BUILD_PATH = $(BUILD_PATH)/tfm_build
###############################################################################
# Include customizations
###############################################################################
-include ${PROJECT_PATH}/project_defs.mk
S_REGION_SIGNING_KEY ?= ${TFM_SRC_PATH}/bl2/ext/mcuboot/root-RSA-3072.pem
NS_REGION_SIGNING_KEY ?= ${TFM_SRC_PATH}/bl2/ext/mcuboot/root-RSA-3072_1.pem
###############################################################################
# Version number definition
###############################################################################
SPE_VERSION ?= "1.5.0"
NSPE_VERSION ?= "1.0.0"
SPE_SECURITY_COUNTER ?= 1
NSPE_SECURITY_COUNTER ?= 1
NUM_PROCESSORS = 8
###############################################################################
# Default / phony targets
###############################################################################
.PHONY: info clean distclean \
spe_patch_libs_clean spe_patch_libs_distclean \
spe_build_reqs spe_build spe_bin \
spe_clean spe_distclean \
tfm_generated_files \
nspe_build_reqs nspe_build_reqs_clean \
spe_signed nspe_signed update factory ota \
tfm_scripts \
all
###############################################################################
# Write Paths to stdout
###############################################################################
info:
@echo "PROJECT_NAME: ${PROJECT_NAME}"
@echo "WORKSPACE_PATH: ${WORKSPACE_PATH}"
@echo "BUILD_PATH: ${BUILD_PATH}"
@echo "TOOLS_PATH: ${TOOLS_PATH}"
@echo "MIDDLEWARE_PATH: ${MIDDLEWARE_PATH}"
@echo "PROJECT_PATH: ${PROJECT_PATH}"
@echo "TFM_BUILD_PATH: ${TFM_BUILD_PATH}"
@echo "TFM_SRC_PATH: ${TFM_SRC_PATH}"
@echo "MBEDTLS_SRC_PATH: ${MBEDTLS_SRC_PATH}"
@echo "MCUBOOT_SRC_PATH: ${MCUBOOT_SRC_PATH}"
@echo "SHELLFLAGS: ${.SHELLFLAGS}"
@echo "CFLAGS: ${CFLAGS}"
@echo "LDFLAGS: ${LDFLAGS}"
@echo "SHELL: ${SHELL}"
###############################################################################
# Rules to apply TF-M patches to mcuboot, mbedtls.
###############################################################################
MBEDTLS_PATCHES := $(wildcard ${TFM_SRC_PATH}/lib/ext/mbedcrypto/*.patch)
MBEDTLS_PATCH_FLAGS = $(foreach file,$(notdir ${MBEDTLS_PATCHES}),${MBEDTLS_SRC_PATH}/$(basename ${file}).patched)
MBEDTLS_PATCHES_APPLIED = ${wildcard ${MBEDTLS_SRC_PATH}/*.patched}
# Apply each mbedtls patch
${MBEDTLS_SRC_PATH}/%.patched : ${TFM_SRC_PATH}/lib/ext/mbedcrypto/%.patch
@echo Applying mbedtls patch: $(notdir $<)
git -C ${MBEDTLS_SRC_PATH} apply --whitespace=nowarn $<
cp "$<" "$@"
touch "$@"
MCUBOOT_PATCHES := $(wildcard ${TFM_SRC_PATH}/lib/ext/mcuboot/*.patch)
MCUBOOT_PATCH_FLAGS = $(foreach file,$(notdir ${MCUBOOT_PATCHES}),${MCUBOOT_SRC_PATH}/$(basename ${file}).patched)
MCUBOOT_PATCHES_APPLIED = ${wildcard ${MCUBOOT_SRC_PATH}/*.patched}
# Apply each mcuboot patch
${MCUBOOT_SRC_PATH}/%.patched : ${TFM_SRC_PATH}/lib/ext/mcuboot/%.patch
@echo Applying mcuboot patch: $(notdir $<)
git -C ${MCUBOOT_SRC_PATH} apply --whitespace=nowarn $<
cp "$<" "$@"
touch "$@"
# Remove any applied mcuboot and mbetls patches
spe_patch_libs_clean :
ifneq ($(MBEDTLS_PATCHES_APPLIED),)
@echo Removing applied mbedtls patches
git -C ${MBEDTLS_SRC_PATH} apply --reverse ${MBEDTLS_PATCHES_APPLIED}
rm -f ${MBEDTLS_PATCHES_APPLIED}
endif
ifneq ($(MCUBOOT_PATCHES_APPLIED),)
@echo Removing applied mcuboot patches
git -C ${MCUBOOT_SRC_PATH} apply --reverse ${MCUBOOT_PATCHES_APPLIED}
rm -f ${MCUBOOT_PATCHES_APPLIED}
endif
# Forcibly remove all applied patches (will clobber any other local changes)
spe_patch_libs_distclean :
git -C ${MBEDTLS_SRC_PATH} clean -f
git -C ${MCUBOOT_PATCHES} clean -f
###############################################################################
# Generate the build system for TF-M "SPE" image
###############################################################################
# Use cmake to generate the Makefile file
${TFM_BUILD_PATH}/.ready : ${MBEDTLS_PATCH_FLAGS} ${MCUBOOT_PATCH_FLAGS}
@echo Calling cmake for artifact: $@ due to prereq: $?
${RM} -rf ${TFM_BUILD_PATH}
mkdir -p ${TFM_BUILD_PATH}
bash -c "${TOOLS_PATH}/env_setup.sh"
source ${TOOLS_PATH}/env_setup.sh && \
cmake -S ${TFM_SRC_PATH} -B ${TFM_BUILD_PATH} \
-DTFM_SPM_LOG_LEVEL_DEBUG=1 \
-DTFM_PLATFORM=stm/b_u585i_iot02a \
-DTFM_TOOLCHAIN_FILE=${TFM_SRC_PATH}/toolchain_GNUARM.cmake \
-DCMAKE_BUILD_TYPE=debug \
-DTFM_DEV_MODE=1 \
-DMBEDCRYPTO_PATH=${MBEDTLS_SRC_PATH} \
-DMCUBOOT_PATH=${MCUBOOT_SRC_PATH} \
-DTFM_PROFILE=profile_large \
-DTFM_ISOLATION_LEVEL=2 \
-DPython_FIND_VIRTUALENV=FIRST \
-DCMAKE_MAKE_PROGRAM=${MAKE} \
-DTFM_PARTITION_FIRMWARE_UPDATE=ON \
-DMCUBOOT_DATA_SHARING=ON \
-G"Unix Makefiles" \
-DCONFIG_TFM_FP=hard \
-DTFM_EXCEPTION_INFO_DUMP=on \
-DCMAKE_OBJECT_PATH_MAX=1024 \
-DCMAKE_OBJECT_NAME_MAX=1019 \
-DNS=0 && touch $@
sleep 1
###############################################################################
# Artifacts generated by a TF-M build
###############################################################################
TFM_BIN_ARTIFACTS := tfm_s.axf \
tfm_s.elf \
tfm_s.bin \
tfm_s.hex \
tfm_s.map
BL2_BIN_ARTIFACTS := bl2.axf \
bl2.elf \
bl2.bin \
bl2.hex \
bl2.map
###############################################################################
# Other artifacts generated by the tfm build system
###############################################################################
TFM_ARTIFACTS := ${addprefix bin/,${TFM_BIN_ARTIFACTS}} \
${addprefix bin/,${BL2_BIN_ARTIFACTS}} \
image_macros_to_preprocess_bl2.c \
tfm_config_export.h \
region_defs.h
TFM_ARTIFACT_PATHS := ${addprefix ${TFM_BUILD_PATH}/,${TFM_ARTIFACTS}}
tfm_bin : ${TFM_ARTIFACT_PATHS}
###############################################################################
# Build TF-M Artifacts / SPE image
###############################################################################
${TFM_ARTIFACT_PATHS} &: ${TFM_BUILD_PATH}/.ready
@echo Calling TFM build for artifact: $@ due to prereq: $?
$(MAKE) -C ${TFM_BUILD_PATH} all install
$(MAKE) -f ${PROJECT_PATH}/generated.mk PROJECT_PATH=${PROJECT_PATH} TFM_BUILD_PATH=${TFM_BUILD_PATH} all
###############################################################################
# Copy TF-M artifacts to the main build directory and rename
###############################################################################
TFM_BIN = ${subst tfm_,${BUILD_PATH}/${PROJECT_NAME}_,${TFM_BIN_ARTIFACTS}}
${BUILD_PATH}/${PROJECT_NAME}_% : ${TFM_BUILD_PATH}/bin/tfm_%
cp "$<" "$@"
BL2_BIN = ${addprefix ${BUILD_PATH}/${PROJECT_NAME}_,${BL2_BIN_ARTIFACTS}}
${BUILD_PATH}/${PROJECT_NAME}_bl2% : ${TFM_BUILD_PATH}/bin/bl2%
cp "$<" "$@"
spe_bin : ${BL2_BIN} ${TFM_BIN}
###############################################################################
# Clean TF-M / SPE build directory
###############################################################################
spe_clean :
if [ -d ${TFM_BUILD_PATH} ]; then make -C ${TFM_BUILD_PATH} clean; fi
rm -f ${TFM_BIN} ${BL2_BIN}
spe_distclean : spe_clean clean
@echo Removing tfm build directory
rm -rf ${TFM_BUILD_PATH}
###############################################################################
# List files to be copied into project build directory with SPE and BL2 bins
###############################################################################
TFM_INTF_LIB = ${PROJECT_PATH}/tfm/interface/libtfm_interface.a
###############################################################################
# Build tfm interface library.
###############################################################################
$(TFM_INTF_LIB) :
$(MAKE) -f ${PROJECT_PATH}/generated.mk PROJECT_PATH=${PROJECT_PATH} TFM_BUILD_PATH=${TFM_BUILD_PATH} all
###############################################################################
# Generate the linker script for the NSPE partition based on the template
###############################################################################
${BUILD_PATH}/stm32u5xx_ns.ld : ${TFM_SRC_PATH}/platform/ext/target/stm/common/hal/template/gcc/appli_ns.ld ${TFM_BUILD_PATH}/tfm_config_export.h
arm-none-eabi-gcc -E -P -xc \
-DBL2 \
-DBL2_HEADER_SIZE=0x400 \
-DBL2_TRAILER_SIZE=0x2000 \
-DDAUTH_CHIP_DEFAULT \
-DMCUBOOT_IMAGE_NUMBER=2 \
-DMCUBOOT_SIGN_RSA \
-DMCUBOOT_SIGN_RSA_LEN=3072 \
-DSTM32U585xx \
-DTFM_PARTITION_CRYPTO \
-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE \
-DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_INFO \
-DTFM_PARTITION_PLATFORM \
-DTFM_PARTITION_PROTECTED_STORAGE \
-DTFM_PSA_API \
-DTFM_SP_LOG_RAW_ENABLED \
-DUSE_HAL_DRIVER \
-DCONFIG_TFM_FP=hard \
-I ${TFM_BUILD_PATH} -include ${TFM_BUILD_PATH}/tfm_config_export.h \
-o $@ $<
###############################################################################
# Preprocess image_macros_to_preprocess_bl2.c
###############################################################################
${BUILD_PATH}/image_macros_preprocessed_bl2.c : ${TFM_BUILD_PATH}/image_macros_to_preprocess_bl2.c
arm-none-eabi-gcc -E -P -xc -DTFM_PSA_API \
-I ${TFM_BUILD_PATH} \
-DBL2 \
-DBL2_HEADER_SIZE=0x400 \
-DBL2_TRAILER_SIZE=0x2000 \
-DDAUTH_CHIP_DEFAULT \
-DMCUBOOT_IMAGE_NUMBER=2 \
-DMCUBOOT_SIGN_RSA \
-DMCUBOOT_SIGN_RSA_LEN=3072 \
-DSTM32U585xx \
-DTFM_PARTITION_CRYPTO \
-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE \
-DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_INFO \
-DTFM_PARTITION_PLATFORM \
-DTFM_PARTITION_PROTECTED_STORAGE \
-DTFM_PSA_API \
-DTFM_SP_LOG_RAW_ENABLED \
-DUSE_HAL_DRIVER \
-DCONFIG_TFM_FP=hard \
-include ${TFM_BUILD_PATH}/tfm_config_export.h \
-o $@ \
${TFM_BUILD_PATH}/image_macros_to_preprocess_bl2.c
###############################################################################
# Export the macros from image_macros_to_preprocess_bl2.c into a shell script
###############################################################################
${BUILD_PATH}/image_defs.sh : ${BUILD_PATH}/image_macros_preprocessed_bl2.c
source ${TOOLS_PATH}/env_setup.sh && \
python ${TOOLS_PATH}/macro_to_kvfile.py ${BUILD_PATH}/image_defs.sh ${BUILD_PATH}/image_macros_preprocessed_bl2.c
nspe_build_reqs_clean:
rm -f ${BUILD_PATH}/image_macros_preprocessed_bl2.c
rm -f ${BUILD_PATH}/stm32u5xx_ns.ld
rm -f ${BUILD_PATH}/image_defs.sh
$(MAKE) -f ${PROJECT_PATH}/generated.mk PROJECT_PATH=${PROJECT_PATH} TFM_BUILD_PATH=${TFM_BUILD_PATH} clean
###############################################################################
# Define phony targets for signed images
###############################################################################
spe_signed : ${BUILD_PATH}/${PROJECT_NAME}_s_signed.bin
nspe_signed : ${BUILD_PATH}/${PROJECT_NAME}_ns_signed.bin
###############################################################################
# Define phony targets for factory and update images
###############################################################################
update : ${BUILD_PATH}/${PROJECT_NAME}_s_update.hex \
${BUILD_PATH}/${PROJECT_NAME}_ns_update.hex \
${BUILD_PATH}/${PROJECT_NAME}_s_ns_update.hex
ota: ${BUILD_PATH}/${PROJECT_NAME}_s_ota.bin \
${BUILD_PATH}/${PROJECT_NAME}_ns_ota.bin
factory : ${BUILD_PATH}/${PROJECT_NAME}_s_signed.hex \
${BUILD_PATH}/${PROJECT_NAME}_ns_signed.hex \
${BUILD_PATH}/${PROJECT_NAME}_s_ns_signed.hex \
${BUILD_PATH}/${PROJECT_NAME}_s_ns_signed.bin \
${BUILD_PATH}/${PROJECT_NAME}_bl2.bin \
${BUILD_PATH}/${PROJECT_NAME}_bl2.hex \
${BUILD_PATH}/${PROJECT_NAME}_bl2_s_ns_factory.hex
###############################################################################
# Rule to generate combined s and ns "factory" images
###############################################################################
${BUILD_PATH}/${PROJECT_NAME}_s_ns% : ${BUILD_PATH}/${PROJECT_NAME}_s% ${BUILD_PATH}/${PROJECT_NAME}_ns%
source ${TOOLS_PATH}/env_setup.sh && \
python ${PROJECT_PATH}/tfm/scripts/assemble.py \
--layout ${abspath "${PROJECT_PATH}"}/tfm/layout_files/signing_layout_s.o \
-s ${BUILD_PATH}/${PROJECT_NAME}_s$* \
-n ${BUILD_PATH}/${PROJECT_NAME}_ns$* \
-o $@
###############################################################################
# Rule to sign SPE / secure / tf-m images
###############################################################################
${BUILD_PATH}/${PROJECT_NAME}_s_signed.bin : ${BUILD_PATH}/${PROJECT_NAME}_s.bin
source ${TOOLS_PATH}/env_setup.sh && \
python ${PROJECT_PATH}/tfm/scripts/wrapper/wrapper.py \
--version ${SPE_VERSION} \
--layout "${abspath ${PROJECT_PATH}}/tfm/layout_files/signing_layout_s.o" \
--key "${S_REGION_SIGNING_KEY}" \
--public-key-format full \
--align 16 --pad --pad-header \
--header-size 0x400 \
--security-counter ${SPE_SECURITY_COUNTER} \
--confirm \
--dependencies "(1,0.0.0+0)" \
$< \
$@
###############################################################################
# Rule to sign SPE OTA images (note lack of --confirm argument)
###############################################################################
${BUILD_PATH}/${PROJECT_NAME}_s_ota.bin : ${BUILD_PATH}/${PROJECT_NAME}_s.bin
source ${TOOLS_PATH}/env_setup.sh && \
python ${PROJECT_PATH}/tfm/scripts/wrapper/wrapper.py \
--version ${SPE_VERSION} \
--layout "${abspath ${PROJECT_PATH}}/tfm/layout_files/signing_layout_s.o" \
--key "${S_REGION_SIGNING_KEY}" \
--public-key-format full \
--align 16 --pad --pad-header \
--header-size 0x400 \
--security-counter ${SPE_SECURITY_COUNTER} \
--dependencies "(1,0.0.0+0)" \
$< \
$@
###############################################################################
# Rule to sign NSPE / non-secure envronment images
###############################################################################
${BUILD_PATH}/${PROJECT_NAME}_ns_signed.bin : ${BUILD_PATH}/${PROJECT_NAME}_ns.bin
source ${TOOLS_PATH}/env_setup.sh && \
python ${PROJECT_PATH}/tfm/scripts/wrapper/wrapper.py \
--version ${NSPE_VERSION} \
--layout ${abspath "${PROJECT_PATH}"}/tfm/layout_files/signing_layout_ns.o \
--key ${NS_REGION_SIGNING_KEY} \
--public-key-format full \
--align 16 --pad --pad-header \
--header-size 0x400 \
--security-counter ${NSPE_SECURITY_COUNTER} \
--confirm \
--dependencies "(0,${SPE_VERSION}+0)" \
$< \
$@
###############################################################################
# Rule to sign NSPE OTA images (note lack of --confirm argument)
###############################################################################
${BUILD_PATH}/${PROJECT_NAME}_ns_ota.bin : ${BUILD_PATH}/${PROJECT_NAME}_ns.bin
source ${TOOLS_PATH}/env_setup.sh && \
python ${PROJECT_PATH}/tfm/scripts/wrapper/wrapper.py \
--version ${NSPE_VERSION} \
--layout ${abspath "${PROJECT_PATH}"}/tfm/layout_files/signing_layout_ns.o \
--key ${NS_REGION_SIGNING_KEY} \
--public-key-format full \
--align 16 --pad --pad-header \
--header-size 0x400 \
--security-counter ${NSPE_SECURITY_COUNTER} \
--dependencies "(0,${SPE_VERSION}+0)" \
$< \
$@
###############################################################################
# Convert signed images from bin to hex format
###############################################################################
${BUILD_PATH}/${PROJECT_NAME}_s_update.hex : ${BUILD_PATH}/${PROJECT_NAME}_s_signed.bin ${BUILD_PATH}/image_defs.sh
source ${BUILD_PATH}/image_defs.sh && \
source ${TOOLS_PATH}/env_setup.sh && \
bin2hex.py --offset $$RE_IMAGE_FLASH_SECURE_UPDATE $< $@
${BUILD_PATH}/${PROJECT_NAME}_ns_update.hex : ${BUILD_PATH}/${PROJECT_NAME}_ns_signed.bin ${BUILD_PATH}/image_defs.sh
source ${BUILD_PATH}/image_defs.sh && \
source ${TOOLS_PATH}/env_setup.sh && \
bin2hex.py --offset $$RE_IMAGE_FLASH_NON_SECURE_UPDATE $< $@
${BUILD_PATH}/${PROJECT_NAME}_s_signed.hex : ${BUILD_PATH}/${PROJECT_NAME}_s_signed.bin ${BUILD_PATH}/image_defs.sh
source ${BUILD_PATH}/image_defs.sh && \
source ${TOOLS_PATH}/env_setup.sh && \
bin2hex.py --offset $$RE_IMAGE_FLASH_ADDRESS_SECURE $< $@
${BUILD_PATH}/${PROJECT_NAME}_ns_signed.hex : ${BUILD_PATH}/${PROJECT_NAME}_ns_signed.bin ${BUILD_PATH}/image_defs.sh
source ${BUILD_PATH}/image_defs.sh && \
source ${TOOLS_PATH}/env_setup.sh && \
bin2hex.py --offset $$RE_IMAGE_FLASH_ADDRESS_NON_SECURE $< $@
${BUILD_PATH}/${PROJECT_NAME}_s_ns_signed.hex : ${BUILD_PATH}/${PROJECT_NAME}_s_signed.hex ${BUILD_PATH}/${PROJECT_NAME}_ns_signed.hex
source ${TOOLS_PATH}/env_setup.sh && \
hexmerge.py $^ -o $@
${BUILD_PATH}/${PROJECT_NAME}_s_ns_update.hex : ${BUILD_PATH}/${PROJECT_NAME}_s_update.hex ${BUILD_PATH}/${PROJECT_NAME}_ns_update.hex
source ${TOOLS_PATH}/env_setup.sh && \
hexmerge.py $^ -o $@
${BUILD_PATH}/${PROJECT_NAME}_bl2_s_ns_factory.hex : ${BUILD_PATH}/${PROJECT_NAME}_s_signed.hex ${BUILD_PATH}/${PROJECT_NAME}_ns_signed.hex ${BUILD_PATH}/${PROJECT_NAME}_bl2.hex
source ${TOOLS_PATH}/env_setup.sh && \
hexmerge.py $^ -o $@
spe_build_reqs : ${TFM_BUILD_PATH}/.ready
spe_bin : ${BL2_BIN} ${TFM_BIN}
nspe_build_reqs : ${BL2_BIN} \
${TFM_BIN} \
${TFM_INTF_LIB} \
${BUILD_PATH}/stm32u5xx_ns.ld \
${BUILD_PATH}/image_defs.sh
all: info spe_build_reqs nspe_build_reqs spe_signed nspe_signed update factory ota
clean: spe_clean spe_patch_libs_clean nspe_build_reqs_clean
distclean : clean tfm_distclean spe_patch_libs_distclean