Skip to content

Commit e285695

Browse files
committed
modules: trusted-firmware-m: Allow to adjust hex file base address
This commit allows to append an optional --hex-addr argument to the wrapper script if speficied. This can adjust the base address of the output hex file when signing the non-secure or secure firmware images. Signed-off-by: Yestin Sun <[email protected]>
1 parent ff5b040 commit e285695

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ if (CONFIG_BUILD_WITH_TFM)
278278
set(TFM_PUBLIC_KEY_FORMAT "full")
279279
endif()
280280

281+
if(DEFINED TFM_HEX_BASE_ADDRESS_S)
282+
set(HEX_ADDR_ARGS_S "--hex-addr=${TFM_HEX_BASE_ADDRESS_S}")
283+
endif()
284+
285+
if(DEFINED TFM_HEX_BASE_ADDRESS_NS)
286+
set(HEX_ADDR_ARGS_NS "--hex-addr=${TFM_HEX_BASE_ADDRESS_NS}")
287+
endif()
288+
281289
function(tfm_sign OUT_ARG SUFFIX PAD INPUT_FILE OUTPUT_FILE)
282290
if(PAD)
283291
set(pad_args --pad --pad-header)
@@ -290,6 +298,7 @@ if (CONFIG_BUILD_WITH_TFM)
290298
--align 1
291299
-v ${TFM_IMAGE_VERSION_${SUFFIX}}
292300
${pad_args}
301+
${HEX_ADDR_ARGS_${SUFFIX}}
293302
${ADD_${SUFFIX}_IMAGE_MIN_VER}
294303
-s auto
295304
-H ${CONFIG_ROM_START_OFFSET}

0 commit comments

Comments
 (0)